svn commit: r269324 - stable/10/share/mk

2014-07-31 Thread Rui Paulo
Author: rpaulo
Date: Thu Jul 31 07:27:59 2014
New Revision: 269324
URL: http://svnweb.freebsd.org/changeset/base/269324

Log:
  MFC r268300:
  
   bsd.dep.mk: add support for generating DTrace header files from .d
   files.

Modified:
  stable/10/share/mk/bsd.dep.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/bsd.dep.mk
==
--- stable/10/share/mk/bsd.dep.mk   Thu Jul 31 05:56:15 2014
(r269323)
+++ stable/10/share/mk/bsd.dep.mk   Thu Jul 31 07:27:59 2014
(r269324)
@@ -78,6 +78,7 @@ ${_S:R}.o: ${_S}
 .endfor
 .endif
 
+# Lexical analyzers
 .for _LSRC in ${SRCS:M*.l:N*/*}
 .for _LC in ${_LSRC:R}.c
 ${_LC}: ${_LSRC}
@@ -90,6 +91,7 @@ CLEANFILES+= ${_LC}
 .endfor
 .endfor
 
+# Yacc grammars
 .for _YSRC in ${SRCS:M*.y:N*/*}
 .for _YC in ${_YSRC:R}.c
 SRCS:= ${SRCS:S/${_YSRC}/${_YC}/}
@@ -117,6 +119,16 @@ ${_YC:R}.o: ${_YC}
 .endif
 .endfor
 .endfor
+
+# DTrace probe definitions
+.for _DSRC in ${SRCS:M*.d:N*/*}
+.for _DH in ${_DSRC:R}.h
+${_DH}: ${_DSRC}
+   ${DTRACE} -xnolibs -h -s ${.ALLSRC} 
+SRCS:= ${SRCS:S/${_DSRC}/${_DH}/}
+CLEANFILES+= ${_DH}
+.endfor
+.endfor
 .endif
 
 .if !target(depend)
___
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: r269323 - head/usr.bin/m4

2014-07-31 Thread Sergey Kandaurov
On 31 July 2014 09:56, Baptiste Daroussin b...@freebsd.org wrote:
 Author: bapt
 Date: Thu Jul 31 05:56:15 2014
 New Revision: 269323
 URL: http://svnweb.freebsd.org/changeset/base/269323

 Log:
   lower warning level to fix build with gcc

 Modified:
   head/usr.bin/m4/Makefile

 Modified: head/usr.bin/m4/Makefile
 ==
 --- head/usr.bin/m4/MakefileThu Jul 31 05:12:21 2014(r269322)
 +++ head/usr.bin/m4/MakefileThu Jul 31 05:56:15 2014(r269323)
 @@ -16,6 +16,7 @@ NO_WMISSING_VARIABLE_DECLARATIONS=
  SRCS=  eval.c expr.c look.c main.c misc.c gnum4.c trace.c parser.y 
 tokenizer.l
  .PATH: ${.CURDIR}/lib
  SRCS+= ohash.c
 +WARNS= 3

  tokenizer.o: parser.h



I am suspicious of this approach.
Unless objections, I'd like to commit the following one
(it also follows the NetBSD way in fixing up .Ox m4 import).
Although it is low quality as well, it allows to keep WARNS.

Index: lib/ohash.c
===
--- lib/ohash.c(revision 269324)
+++ lib/ohash.c(working copy)
@@ -120,7 +120,7 @@
 void *
 ohash_remove(struct ohash *h, unsigned int i)
 {
-void*result = (void *)h-t[i].p;
+void*result = __DECONST(void *, h-t[i].p);

 if (result == NULL || result == DELETED)
 return NULL;
@@ -141,7 +141,7 @@
 if (h-t[i].p == DELETED)
 return NULL;
 else
-return (void *)h-t[i].p;
+return __DECONST(void *, h-t[i].p);
 }

 void *
@@ -180,7 +180,7 @@
 {
 for (; *pos  h-size; (*pos)++)
 if (h-t[*pos].p != DELETED  h-t[*pos].p != NULL)
-return (void *)h-t[(*pos)++].p;
+return __DECONST(void *, h-t[(*pos)++].p);
 return NULL;
 }

Index: misc.c
===
--- misc.c(revision 269324)
+++ misc.c(working copy)
@@ -265,7 +265,7 @@
 extern char *__progname;

 void
-m4errx(int eval, const char *fmt, ...)
+m4errx(int exval, const char *fmt, ...)
 {
 fprintf(stderr, %s: , __progname);
 fprintf(stderr, %s at line %lu: , CURRENT_NAME, CURRENT_LINE);
@@ -277,7 +277,7 @@
 va_end(ap);
 }
 fprintf(stderr, \n);
-exit(eval);
+exit(exval);
 }

 /*


-- 
wbr,
pluknet
___
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: r269325 - in head/sys: cddl/contrib/opensolaris/common/util modules/dtrace/dtrace

2014-07-31 Thread Rui Paulo
Author: rpaulo
Date: Thu Jul 31 08:07:23 2014
New Revision: 269325
URL: http://svnweb.freebsd.org/changeset/base/269325

Log:
  Copy strtolctype.h to sys/cddl/contrib/opensolaris/common/util to keep
  the kernel self-contained.
  
  Requested by: jhb

Added:
  head/sys/cddl/contrib/opensolaris/common/util/
  head/sys/cddl/contrib/opensolaris/common/util/strtolctype.h
 - copied unchanged from r268542, 
head/cddl/contrib/opensolaris/common/util/strtolctype.h
Modified:
  head/sys/modules/dtrace/dtrace/Makefile

Copied: head/sys/cddl/contrib/opensolaris/common/util/strtolctype.h (from 
r268542, head/cddl/contrib/opensolaris/common/util/strtolctype.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/cddl/contrib/opensolaris/common/util/strtolctype.h Thu Jul 31 
08:07:23 2014(r269325, copy of r268542, 
head/cddl/contrib/opensolaris/common/util/strtolctype.h)
@@ -0,0 +1,79 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the License).
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets [] replaced with your own identifying
+ * information: Portions Copyright [] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/* Copyright (c) 1988 ATT */
+/*   All Rights Reserved   */
+
+#ifndef_COMMON_UTIL_CTYPE_H
+#define_COMMON_UTIL_CTYPE_H
+
+#ifdef __cplusplus
+extern C {
+#endif
+
+/*
+ * This header file contains a collection of macros that the strtou?ll?
+ * functions in common/util use to test characters.  What we need is a kernel
+ * version of ctype.h.
+ *
+ * NOTE: These macros are used within several DTrace probe context functions.
+ * They must not be altered to make function calls or perform actions not
+ * safe in probe context.
+ */
+
+#if defined(sun) (defined(_KERNEL) || defined(_BOOT))
+
+#defineisalnum(ch) (isalpha(ch) || isdigit(ch))
+#defineisalpha(ch) (isupper(ch) || islower(ch))
+#defineisdigit(ch) ((ch) = '0'  (ch) = '9')
+#defineislower(ch) ((ch) = 'a'  (ch) = 'z')
+#defineisspace(ch) (((ch) == ' ') || ((ch) == '\r') || ((ch) == 
'\n') || \
+   ((ch) == '\t') || ((ch) == '\f'))
+#defineisupper(ch) ((ch) = 'A'  (ch) = 'Z')
+#defineisxdigit(ch)(isdigit(ch) || ((ch) = 'a'  (ch) = 'f') || 
\
+   ((ch) = 'A'  (ch) = 'F'))
+
+#endif /* _KERNEL || _BOOT */
+
+#defineDIGIT(x)\
+   (isdigit(x) ? (x) - '0' : islower(x) ? (x) + 10 - 'a' : (x) + 10 - 'A')
+
+#defineMBASE   ('z' - 'a' + 1 + 10)
+
+/*
+ * The following macro is a version of isalnum() that limits alphabetic
+ * characters to the ranges a-z and A-Z; locale dependent characters will not
+ * return 1.  The members of a-z and A-Z are assumed to be in ascending order
+ * and contiguous.
+ */
+#definelisalnum(x) \
+   (isdigit(x) || ((x) = 'a'  (x) = 'z') || ((x) = 'A'  (x) = 'Z'))
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _COMMON_UTIL_CTYPE_H */

Modified: head/sys/modules/dtrace/dtrace/Makefile
==
--- head/sys/modules/dtrace/dtrace/Makefile Thu Jul 31 07:27:59 2014
(r269324)
+++ head/sys/modules/dtrace/dtrace/Makefile Thu Jul 31 08:07:23 2014
(r269325)
@@ -4,8 +4,6 @@ SYSDIR?=${.CURDIR}/../../..
 
 ARCHDIR=   ${MACHINE_CPUARCH}
 
-SUNW=  ${SYSDIR}/../cddl/contrib/opensolaris
-
 .PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/common/dtrace
 .PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
 .PATH: ${SYSDIR}/cddl/kern
@@ -44,7 +42,7 @@ CFLAGS+=  -I${SYSDIR}/cddl/compat/opensol
-I${SYSDIR}/cddl/dev/dtrace \
-I${SYSDIR}/cddl/dev/dtrace/${ARCHDIR} \
-I${SYSDIR}/cddl/contrib/opensolaris/uts/common \
-   -I${SUNW}/common/util \
+   -I${SYSDIR}/cddl/contrib/opensolaris/common/util \
-I${SYSDIR} -DDIS_MEM
 
 CFLAGS+=   -DSMP
___
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: r269326 - head/lib/libc/stdio

2014-07-31 Thread Nick Hibma
Author: n_hibma
Date: Thu Jul 31 08:28:42 2014
New Revision: 269326
URL: http://svnweb.freebsd.org/changeset/base/269326

Log:
  Fix the example: free the memory that was allocated by getline().

Modified:
  head/lib/libc/stdio/getline.3

Modified: head/lib/libc/stdio/getline.3
==
--- head/lib/libc/stdio/getline.3   Thu Jul 31 08:07:23 2014
(r269325)
+++ head/lib/libc/stdio/getline.3   Thu Jul 31 08:28:42 2014
(r269326)
@@ -95,6 +95,7 @@ size_t linecap = 0;
 ssize_t linelen;
 while ((linelen = getline(line, linecap, fp))  0)
fwrite(line, linelen, 1, stdout);
+free(line);
 .Ed
 .Sh COMPATIBILITY
 Many application writers used the name
___
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: r269323 - head/usr.bin/m4

2014-07-31 Thread Baptiste Daroussin
On Thu, Jul 31, 2014 at 11:51:23AM +0400, Sergey Kandaurov wrote:
 On 31 July 2014 09:56, Baptiste Daroussin b...@freebsd.org wrote:
  Author: bapt
  Date: Thu Jul 31 05:56:15 2014
  New Revision: 269323
  URL: http://svnweb.freebsd.org/changeset/base/269323
 
  Log:
lower warning level to fix build with gcc
 

I tried to stay as close a possible to the OpenBSD version but sure go ahead
I'll talk to upstream about it

regards,
Bapt


pgpgChIn6e4iZ.pgp
Description: PGP signature


Re: svn commit: r269134 - head/sys/vm

2014-07-31 Thread Andreas Tobler

On 31.07.14 06:35, Alan Cox wrote:

On 07/30/2014 16:26, Andreas Tobler wrote:

On 30.07.14 23:17, Alan Cox wrote:

On 07/30/2014 15:15, Andreas Tobler wrote:

On 30.07.14 21:54, Alan Cox wrote:

On 07/30/2014 14:46, Alan Cox wrote:

On 07/30/2014 13:58, Andreas Tobler wrote:

Hi Alan,

On 26.07.14 20:10, Alan Cox wrote:

Author: alc
Date: Sat Jul 26 18:10:18 2014
New Revision: 269134
URL: http://svnweb.freebsd.org/changeset/base/269134

Log:
  When unwiring a region of an address space, do not assume that
the
  underlying physical pages are mapped by the pmap.  If, for
example, the
  application has performed an mprotect(..., PROT_NONE) on
any part
of the
  wired region, then those pages will no longer be mapped by the
pmap.
  So, using the pmap to lookup the wired pages in order to
unwire them
  doesn't always work, and when it doesn't work wired pages are
leaked.

  To avoid the leak, introduce and use a new function
vm_object_unwire()
  that locates the wired pages by traversing the object and its
backing
  objects.

  At the same time, switch from using pmap_change_wiring() to
the
recently
  introduced function pmap_unwire() for unwiring the region's
mappings.
  pmap_unwire() is faster, because it operates a range of
virtual
addresses
  rather than a single virtual page at a time.  Moreover, by
operating on
  a range, it is superpage friendly.  It doesn't waste time
performing
  unnecessary demotions.

  Reported by:markj
  Reviewed by:kib
  Tested by:pho, jmg (arm)
  Sponsored by:EMC / Isilon Storage Division

This commit brings my 32- and 64-bit PowerMac's into panic.
Unfortunately I'm not able to give you a backtrace in the form of a
textdump nor of a core dump.

The only thing I have is this picture:

http://people.freebsd.org/~andreast/r269134_panic.jpg

Exactly this revision gives a panic and breaks the textdump/coredump
facility.

How can I help debugging?


It appears to me that moea64_pvo_enter() had a pre-existing bug that
got
tickled by this change.  Specifically, moea64_pvo_enter() doesn't set
the PVO_WIRED flag when an unwired mapping already exists.  It just
returns with the mapping still in an unwired state.  Consequently,
when
pmap_unwire() finally runs, it doesn't find a wired mapping.

Try this:

Index: powerpc/aim/mmu_oea64.c
===
--- powerpc/aim/mmu_oea64.c (revision 269127)
+++ powerpc/aim/mmu_oea64.c (working copy)
@@ -2274,7 +2274,8 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm,
uma_zone_t
   if (pvo-pvo_pmap == pm  PVO_VADDR(pvo) == va) {
   if ((pvo-pvo_pte.lpte.pte_lo  LPTE_RPGN)
== pa 
   (pvo-pvo_pte.lpte.pte_lo 
(LPTE_NOEXEC |
LPTE_PP))
-   == (pte_lo  (LPTE_NOEXEC | LPTE_PP))) {
+   == (pte_lo  (LPTE_NOEXEC | LPTE_PP)) 
+   ((pvo-pvo_vaddr ^ flags)  PVO_WIRED)) {
   if (!(pvo-pvo_pte.lpte.pte_hi 
LPTE_VALID)) {
   /* Re-insert if spilled */
   i = MOEA64_PTE_INSERT(mmu,
ptegidx,



The new conditional test needs to be inverted.  Try this instead:

Index: powerpc/aim/mmu_oea64.c
===
--- powerpc/aim/mmu_oea64.c (revision 269127)
+++ powerpc/aim/mmu_oea64.c (working copy)
@@ -2274,7 +2274,8 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm,
uma_zone_t
   if (pvo-pvo_pmap == pm  PVO_VADDR(pvo) == va) {
   if ((pvo-pvo_pte.lpte.pte_lo  LPTE_RPGN)
== pa 
   (pvo-pvo_pte.lpte.pte_lo 
(LPTE_NOEXEC |
LPTE_PP))
-   == (pte_lo  (LPTE_NOEXEC | LPTE_PP))) {
+   == (pte_lo  (LPTE_NOEXEC | LPTE_PP)) 
+   ((pvo-pvo_vaddr ^ flags)  PVO_WIRED) ==
0) {
   if (!(pvo-pvo_pte.lpte.pte_hi 
LPTE_VALID)) {
   /* Re-insert if spilled */
   i = MOEA64_PTE_INSERT(mmu,
ptegidx,




The panic stays, but the message is different:

panic: moea64_pvo_to_pte: pvo 0x10147ea0 has invalid pte 0xb341180 in
moea64_pteg_table but valid in pvo.



My attempted fix is doing something else wrong.  Do you have a stack
trace?


iPhone sei Dank:

http://people.freebsd.org/~andreast/r269134-1_panic.jpg


Ok, this patch should fix both the original panic and the new one.  They
are two distinct problems.


Yep, thank you!

Additionally I tried to adapt the 32-bit path and successfully booted 
the below, ok?


Again, thanks a lot!
Andreas

Index: powerpc/aim/mmu_oea.c
===
--- powerpc/aim/mmu_oea.c   (revision 269326)
+++ 

svn commit: r269327 - head/share/examples/hwpmc

2014-07-31 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jul 31 09:18:15 2014
New Revision: 269327
URL: http://svnweb.freebsd.org/changeset/base/269327

Log:
  Add an example program to show how to use libpmc from a program.
  This particular program attempts to use the TSC to measure how long
  certainly libpmc operations take.  Depending on the quality of
  the rdtsc() macro on a particular architecture this may work
  more or less well.

Added:
  head/share/examples/hwpmc/Makefile   (contents, props changed)
  head/share/examples/hwpmc/overhead.c   (contents, props changed)
Modified:
  head/share/examples/hwpmc/README

Added: head/share/examples/hwpmc/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/examples/hwpmc/Makefile  Thu Jul 31 09:18:15 2014
(r269327)
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+PROG=  overhead
+LDFLAGS+= -lpmc
+MAN=
+
+install:
+
+.include bsd.prog.mk

Modified: head/share/examples/hwpmc/README
==
--- head/share/examples/hwpmc/READMEThu Jul 31 08:28:42 2014
(r269326)
+++ head/share/examples/hwpmc/READMEThu Jul 31 09:18:15 2014
(r269327)
@@ -3,6 +3,4 @@
 Examples illustrating the use of the hwpmc(4) driver and pmc(3)
 library interface.
 
-While there is nothing here yet, the source code for pmccontrol(8)
-and pmcstat(8) could serve as examples.
 

Added: head/share/examples/hwpmc/overhead.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/examples/hwpmc/overhead.cThu Jul 31 09:18:15 2014
(r269327)
@@ -0,0 +1,115 @@
+/* 
+ * Copyright (c) 2014, Neville-Neil Consulting
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * 
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 
+ * Neither the name of Neville-Neil Consulting nor the names of its 
+ * contributors may be used to endorse or promote products derived from 
+ * this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ *
+ * Author: George V. Neville-Neil
+ *
+ *
+ */
+
+#ifndef lint
+static char rcsid [] = $Header:$ ;
+#endif
+
+/*
+ * Calculate the time overhead of starting, stopping, and recording
+ * pmc counters.
+ *
+ * The only argument is a counter name, such as instruction-retired
+ * which is CPU dependent and can be found with pmmcontrol(8) using
+ * pmccontrol -L.
+ *
+ * The start, stop, read and write operations are timed using the
+ * rdtsc() macro which reads the Time Stamp Counter on the CPU.
+ */
+
+#include stdio.h
+#include err.h
+#include sysexits.h
+#include sys/types.h
+#include machine/cpufunc.h
+#include pmc.h
+
+int main(int argc, char **argv)
+{
+   pmc_id_t pmcid;
+   pmc_value_t read_value;
+   pmc_value_t read_clear_value;
+   uint64_t tsc1, write_cyc, start_cyc, read_cyc, stop_cyc;
+   char *counter_name;
+   
+   if (argc != 2)
+   err(EX_USAGE, counter-name required);
+
+   counter_name = argv[1];
+   
+   if (pmc_init() != 0)
+   err(EX_OSERR, hwpmc(4) not loaded, kldload or update your 
kernel);
+
+   if (pmc_allocate(counter_name, PMC_MODE_SC, 0, 0, pmcid)  0)
+   err(EX_OSERR, failed to allocate %s as a system counter in 
counting mode,
+   counter_name);
+
+   tsc1 = rdtsc();
+   if (pmc_write(pmcid, 0)  0)
+   err(EX_OSERR, failed to zero counter %s, counter_name);
+   write_cyc = rdtsc() - tsc1;
+
+   tsc1 = rdtsc();
+   if (pmc_start(pmcid)  0)
+   err(EX_OSERR, failed to start counter %s, 

svn commit: r269328 - head/sys/netinet

2014-07-31 Thread Steven Hartland
Author: smh
Date: Thu Jul 31 09:18:29 2014
New Revision: 269328
URL: http://svnweb.freebsd.org/changeset/base/269328

Log:
  Only check error if one could have been generated

Modified:
  head/sys/netinet/in.c

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Thu Jul 31 09:18:15 2014(r269327)
+++ head/sys/netinet/in.c   Thu Jul 31 09:18:29 2014(r269328)
@@ -418,20 +418,22 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat
LIST_INSERT_HEAD(INADDR_HASH(ia-ia_addr.sin_addr.s_addr), ia, ia_hash);
IN_IFADDR_WUNLOCK();
 
-   if (vhid != 0)
+   if (vhid != 0) {
error = (*carp_attach_p)(ia-ia_ifa, vhid);
-   if (error)
-   goto fail1;
+   if (error)
+   goto fail1;
+   }
 
/*
 * Give the interface a chance to initialize
 * if this is its first address,
 * and to validate the address if necessary.
 */
-   if (ifp-if_ioctl != NULL)
+   if (ifp-if_ioctl != NULL) {
error = (*ifp-if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia);
-   if (error)
-   goto fail2;
+   if (error)
+   goto fail2;
+   }
 
/*
 * Add route for the network.
___
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: r269334 - stable/10/usr.sbin/ctld

2014-07-31 Thread Warren Block
Author: wblock (doc committer)
Date: Thu Jul 31 14:53:07 2014
New Revision: 269334
URL: http://svnweb.freebsd.org/changeset/base/269334

Log:
  MFC 268931:
  
  Correct spelling errors in ctld.8.  While here, correct similar errors
  in ctl.conf.5 and fix a couple of contractions.

Modified:
  stable/10/usr.sbin/ctld/ctl.conf.5
  stable/10/usr.sbin/ctld/ctld.8
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/ctld/ctl.conf.5
==
--- stable/10/usr.sbin/ctld/ctl.conf.5  Thu Jul 31 14:48:35 2014
(r269333)
+++ stable/10/usr.sbin/ctld/ctl.conf.5  Thu Jul 31 14:53:07 2014
(r269334)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd April 24, 2014
+.Dd July 20, 2014
 .Dt CTL.CONF 5
 .Os
 .Sh NAME
@@ -104,14 +104,14 @@ The following statements are available a
 .It Ic auth-type Ao Ar type Ac
 Specifies authentication type.
 Type can be either none, deny, chap, or chap-mutual.
-In most cases it is not neccessary to set the type using this clause;
+In most cases it is not necessary to set the type using this clause;
 it is usually used to disable authentication for a given auth-group.
 .It Ic chap Ao Ar user Ac Aq Ar secret
 Specifies CHAP authentication credentials.
 .It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar 
mutualsecret
 Specifies mutual CHAP authentication credentials.
 Note that for any auth-group, configuration may contain either chap,
-or chap-mutual entries; it's an error to mix them.
+or chap-mutual entries; it is an error to mix them.
 .It Ic initiator-name Ao Ar initiator-name Ac
 Specifies iSCSI initiator name.
 If not defined, there will be no restrictions based on initiator
@@ -158,18 +158,18 @@ without authentication.
 .It Ic auth-type Ao Ar type Ac
 Specifies authentication type.
 Type can be either none, deny, chap, or chap-mutual.
-In most cases it is not neccessary to set the type using this clause;
+In most cases it is not necessary to set the type using this clause;
 it is usually used to disable authentication for a given target.
 This clause is mutually exclusive with auth-group; one cannot use
 both in a single target.
 .It Ic chap Ao Ar user Ac Aq Ar secret
 Specifies CHAP authentication credentials.
 Note that targets must use either auth-group, or chap,
-or chap-mutual clauses; it's a configuration error to mix them in one target.
+or chap-mutual clauses; it is a configuration error to mix them in one target.
 .It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar 
mutualsecret
 Specifies mutual CHAP authentication credentials.
 Note that targets must use either auth-group, chap, or
-chap-mutual clauses; it's a configuration error to mix them in one target.
+chap-mutual clauses; it is a configuration error to mix them in one target.
 .It Ic initiator-name Ao Ar initiator-name Ac
 Specifies iSCSI initiator name.
 If not defined, there will be no restrictions based on initiator

Modified: stable/10/usr.sbin/ctld/ctld.8
==
--- stable/10/usr.sbin/ctld/ctld.8  Thu Jul 31 14:48:35 2014
(r269333)
+++ stable/10/usr.sbin/ctld/ctld.8  Thu Jul 31 14:53:07 2014
(r269334)
@@ -27,7 +27,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 20, 2012
+.Dd July 20, 2014
 .Dt CTLD 8
 .Os
 .Sh NAME
@@ -51,7 +51,7 @@ Then it compares the configuration with 
 by previously running
 .Nm
 instances, removes LUNs no longer existing in the configuration file,
-and creates new LUNs as neccessary.
+and creates new LUNs as necessary.
 After that it listens for the incoming iSCSI connections, performs
 authentication, and, if successful, passes the connections to the kernel part
 of CTL iSCSI target, which handles it from that point.
@@ -59,13 +59,13 @@ of CTL iSCSI target, which handles it fr
 When it receives a SIGHUP signal, the
 .Nm
 reloads its configuration and applies the changes to the kernel.
-Changes are applied in a way that avoids unneccessary disruptions;
+Changes are applied in a way that avoids unnecessary disruptions;
 for example removing one LUN does not affect other LUNs.
 .Pp
 When exiting gracefully, the
 .Nm
 daemon removes LUNs it managed and forcibly disconnects all the clients.
-Otherwise - e.g. when killed with SIGKILL - LUNs stay configured
+Otherwise - for example, when killed with SIGKILL - LUNs stay configured
 and clients remain connected.
 .Pp
 To perform administrative actions that apply to already connected
___
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: r269337 - in head: sys/sys usr.bin/elfdump

2014-07-31 Thread Ed Maste
Author: emaste
Date: Thu Jul 31 15:25:12 2014
New Revision: 269337
URL: http://svnweb.freebsd.org/changeset/base/269337

Log:
  elfdump: add EM_AARCH64 64-bit ARM machine architecture

Modified:
  head/sys/sys/elf_common.h
  head/usr.bin/elfdump/elfdump.c

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Thu Jul 31 15:15:46 2014(r269336)
+++ head/sys/sys/elf_common.h   Thu Jul 31 15:25:12 2014(r269337)
@@ -237,6 +237,7 @@ typedef struct {
 #defineEM_ARCA 109 /* Arca RISC Microprocessor. */
 #defineEM_UNICORE  110 /* Microprocessor series from PKU-Unity 
Ltd.
   and MPRC of Peking University */
+#defineEM_AARCH64  183 /* AArch64 (64-bit ARM) */
 
 /* Non-standard or deprecated. */
 #defineEM_486  6   /* Intel i486. */

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Thu Jul 31 15:15:46 2014
(r269336)
+++ head/usr.bin/elfdump/elfdump.c  Thu Jul 31 15:25:12 2014
(r269337)
@@ -267,6 +267,7 @@ e_machines(u_int mach)
case EM_SPARCV9:return EM_SPARCV9;
case EM_IA_64:  return EM_IA_64;
case EM_X86_64: return EM_X86_64;
+   case EM_AARCH64:return EM_AARCH64;
}
snprintf(machdesc, sizeof(machdesc),
(unknown machine) -- type 0x%x, mach);
___
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: r269338 - head/usr.bin/elfdump

2014-07-31 Thread Ed Maste
Author: emaste
Date: Thu Jul 31 15:40:03 2014
New Revision: 269338
URL: http://svnweb.freebsd.org/changeset/base/269338

Log:
  elfdump: use existing ELF constants where available
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Thu Jul 31 15:25:12 2014
(r269337)
+++ head/usr.bin/elfdump/elfdump.c  Thu Jul 31 15:40:03 2014
(r269338)
@@ -172,74 +172,74 @@ d_tags(u_int64_t tag)
static char unknown_tag[48];
 
switch (tag) {
-   case 0: return DT_NULL;
-   case 1: return DT_NEEDED;
-   case 2: return DT_PLTRELSZ;
-   case 3: return DT_PLTGOT;
-   case 4: return DT_HASH;
-   case 5: return DT_STRTAB;
-   case 6: return DT_SYMTAB;
-   case 7: return DT_RELA;
-   case 8: return DT_RELASZ;
-   case 9: return DT_RELAENT;
-   case 10: return DT_STRSZ;
-   case 11: return DT_SYMENT;
-   case 12: return DT_INIT;
-   case 13: return DT_FINI;
-   case 14: return DT_SONAME;
-   case 15: return DT_RPATH;
-   case 16: return DT_SYMBOLIC;
-   case 17: return DT_REL;
-   case 18: return DT_RELSZ;
-   case 19: return DT_RELENT;
-   case 20: return DT_PLTREL;
-   case 21: return DT_DEBUG;
-   case 22: return DT_TEXTREL;
-   case 23: return DT_JMPREL;
-   case 24: return DT_BIND_NOW;
-   case 25: return DT_INIT_ARRAY;
-   case 26: return DT_FINI_ARRAY;
-   case 27: return DT_INIT_ARRAYSZ;
-   case 28: return DT_FINI_ARRAYSZ;
-   case 29: return DT_RUNPATH;
-   case 30: return DT_FLAGS;
-   case 32: return DT_PREINIT_ARRAY; /* XXX: DT_ENCODING */
-   case 33: return DT_PREINIT_ARRAYSZ;
+   case DT_NULL:   return DT_NULL;
+   case DT_NEEDED: return DT_NEEDED;
+   case DT_PLTRELSZ:   return DT_PLTRELSZ;
+   case DT_PLTGOT: return DT_PLTGOT;
+   case DT_HASH:   return DT_HASH;
+   case DT_STRTAB: return DT_STRTAB;
+   case DT_SYMTAB: return DT_SYMTAB;
+   case DT_RELA:   return DT_RELA;
+   case DT_RELASZ: return DT_RELASZ;
+   case DT_RELAENT:return DT_RELAENT;
+   case DT_STRSZ:  return DT_STRSZ;
+   case DT_SYMENT: return DT_SYMENT;
+   case DT_INIT:   return DT_INIT;
+   case DT_FINI:   return DT_FINI;
+   case DT_SONAME: return DT_SONAME;
+   case DT_RPATH:  return DT_RPATH;
+   case DT_SYMBOLIC:   return DT_SYMBOLIC;
+   case DT_REL:return DT_REL;
+   case DT_RELSZ:  return DT_RELSZ;
+   case DT_RELENT: return DT_RELENT;
+   case DT_PLTREL: return DT_PLTREL;
+   case DT_DEBUG:  return DT_DEBUG;
+   case DT_TEXTREL:return DT_TEXTREL;
+   case DT_JMPREL: return DT_JMPREL;
+   case DT_BIND_NOW:   return DT_BIND_NOW;
+   case DT_INIT_ARRAY: return DT_INIT_ARRAY;
+   case DT_FINI_ARRAY: return DT_FINI_ARRAY;
+   case DT_INIT_ARRAYSZ:   return DT_INIT_ARRAYSZ;
+   case DT_FINI_ARRAYSZ:   return DT_FINI_ARRAYSZ;
+   case DT_RUNPATH:return DT_RUNPATH;
+   case DT_FLAGS:  return DT_FLAGS;
+   case DT_PREINIT_ARRAY:  return DT_PREINIT_ARRAY; /* XXX DT_ENCODING */
+   case DT_PREINIT_ARRAYSZ:return DT_PREINIT_ARRAYSZ;
/* 0x600D - 0x6000 operating system-specific semantics */
-   case 0x6df5: return DT_GNU_PRELINKED;
-   case 0x6df6: return DT_GNU_CONFLICTSZ;
-   case 0x6df7: return DT_GNU_LIBLISTSZ;
-   case 0x6df8: return DT_SUNW_CHECKSUM;
-   case 0x6df9: return DT_PLTPADSZ;
-   case 0x6dfa: return DT_MOVEENT;
-   case 0x6dfb: return DT_MOVESZ;
-   case 0x6dfc: return DT_FEATURE;
-   case 0x6dfd: return DT_POSFLAG_1;
-   case 0x6dfe: return DT_SYMINSZ;
-   case 0x6dff: return DT_SYMINENT (DT_VALRNGHI);
-   case 0x6e00: return DT_ADDRRNGLO;
-   case 0x6ef5: return DT_GNU_HASH;
-   case 0x6ef8: return DT_GNU_CONFLICT;
-   case 0x6ef9: return DT_GNU_LIBLIST;
-   case 0x6efa: return DT_SUNW_CONFIG;
-   case 0x6efb: return DT_SUNW_DEPAUDIT;
-   case 0x6efc: return DT_SUNW_AUDIT;
-   case 0x6efd: return DT_SUNW_PLTPAD;
-   case 0x6efe: return DT_SUNW_MOVETAB;
-   case 0x6eff: return DT_SYMINFO (DT_ADDRRNGHI);
-   case 0x6ff9: return DT_RELACOUNT;
-   case 0x6ffa: return DT_RELCOUNT;
-   case 0x6ffb: return DT_FLAGS_1;
-   case 0x6ffc: return DT_VERDEF;
-   case 0x6ffd: return DT_VERDEFNUM;
-   case 0x6ffe: return DT_VERNEED;
-   case 0x6fff: return DT_VERNEEDNUM;
-   case 0x6ff0: return 

Re: svn commit: r269143 - head/usr.bin/elfdump

2014-07-31 Thread Ed Maste
On 26 July 2014 16:00, Ian Lepore i...@freebsd.org wrote:
 + case EM_ARM:
 + switch (sht) {
 + case 0x7001: return SHT_ARM_EXIDX;
 + case 0x7002: return SHT_ARM_PREEMPTMAP;
 + case 0x7003: return SHT_ARM_ATTRIBUTES;
 + case 0x7004: return SHT_ARM_DEBUGOVERLAY;
 + case 0x7005: return SHT_ARM_OVERLAYSECTION;
 + }
 + break;
   case EM_MIPS:
   switch (sht) {
   case 0x700d: return SHT_MIPS_OPTIONS;


 I'm curious why this code is all full of 0x numbers when there
 are named constants defined for all this stuff.

I don't think there's a good reason for it.  It seems to have just
evolved that way after sh_types() and d_tags() switched from an array
of names, when the first non-contiguous entries were added.  In
r269338 I've replaced the constants with #defines that exist.
___
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: r269339 - head/sys/powerpc/aim

2014-07-31 Thread Alan Cox
Author: alc
Date: Thu Jul 31 16:17:30 2014
New Revision: 269339
URL: http://svnweb.freebsd.org/changeset/base/269339

Log:
  Correct a defect in r268591.  In the implementation of the new function
  pmap_unwire(), the call to MOEA64_PVO_TO_PTE() must be performed before
  any changes are made to the PVO.  Otherwise, MOEA64_PVO_TO_PTE() will
  panic.
  
  Reported by:  andreast

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cThu Jul 31 15:40:03 2014
(r269338)
+++ head/sys/powerpc/aim/mmu_oea64.cThu Jul 31 16:17:30 2014
(r269339)
@@ -1090,6 +1090,7 @@ moea64_unwire(mmu_t mmu, pmap_t pm, vm_o
for (pvo = RB_NFIND(pvo_tree, pm-pmap_pvo, key);
pvo != NULL  PVO_VADDR(pvo)  eva;
pvo = RB_NEXT(pvo_tree, pm-pmap_pvo, pvo)) {
+   pt = MOEA64_PVO_TO_PTE(mmu, pvo);
if ((pvo-pvo_vaddr  PVO_WIRED) == 0)
panic(moea64_unwire: pvo %p is missing PVO_WIRED,
pvo);
@@ -1098,7 +1099,7 @@ moea64_unwire(mmu_t mmu, pmap_t pm, vm_o
panic(moea64_unwire: pte %p is missing LPTE_WIRED,
pvo-pvo_pte.lpte);
pvo-pvo_pte.lpte.pte_hi = ~LPTE_WIRED;
-   if ((pt = MOEA64_PVO_TO_PTE(mmu, pvo)) != -1) {
+   if (pt != -1) {
/*
 * The PTE's wired attribute is not a hardware
 * feature, so there is no need to invalidate any TLB
___
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: r269340 - head/sys/netinet

2014-07-31 Thread Steven Hartland
Author: smh
Date: Thu Jul 31 16:43:56 2014
New Revision: 269340
URL: http://svnweb.freebsd.org/changeset/base/269340

Log:
  Ensure that IP's added to CARP always use the CARP MAC
  
  Previously there was a race condition between the address addition
  and associating it with the CARP which resulted in the interface
  MAC, instead of the CARP MAC, being used for a brief amount of time.
  
  This caused is using my IP address warnings as well as data being
  sent to the wrong machine due to incorrect ARP entries being recorded
  by other devices on the network.

Modified:
  head/sys/netinet/in.c

Modified: head/sys/netinet/in.c
==
--- head/sys/netinet/in.c   Thu Jul 31 16:17:30 2014(r269339)
+++ head/sys/netinet/in.c   Thu Jul 31 16:43:56 2014(r269340)
@@ -407,6 +407,12 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat
if (ifp-if_flags  IFF_LOOPBACK)
 ia-ia_dstaddr = ia-ia_addr;
 
+   if (vhid != 0) {
+   error = (*carp_attach_p)(ia-ia_ifa, vhid);
+   if (error)
+   return (error);
+   }
+
/* if_addrhead is already referenced by ifa_alloc() */
IF_ADDR_WLOCK(ifp);
TAILQ_INSERT_TAIL(ifp-if_addrhead, ifa, ifa_link);
@@ -418,12 +424,6 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat
LIST_INSERT_HEAD(INADDR_HASH(ia-ia_addr.sin_addr.s_addr), ia, ia_hash);
IN_IFADDR_WUNLOCK();
 
-   if (vhid != 0) {
-   error = (*carp_attach_p)(ia-ia_ifa, vhid);
-   if (error)
-   goto fail1;
-   }
-
/*
 * Give the interface a chance to initialize
 * if this is its first address,
@@ -432,7 +432,7 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat
if (ifp-if_ioctl != NULL) {
error = (*ifp-if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia);
if (error)
-   goto fail2;
+   goto fail1;
}
 
/*
@@ -446,7 +446,7 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat
 
error = in_addprefix(ia, flags);
if (error)
-   goto fail2;
+   goto fail1;
}
 
/*
@@ -464,7 +464,7 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat
error = ifa_add_loopback_route((struct ifaddr *)ia,
(struct sockaddr *)ia-ia_addr);
if (error)
-   goto fail3;
+   goto fail2;
} else
ifa_free(eia-ia_ifa);
}
@@ -484,15 +484,14 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat
 
return (error);
 
-fail3:
+fail2:
if (vhid == 0)
(void )in_scrubprefix(ia, LLE_STATIC);
 
-fail2:
+fail1:
if (ia-ia_ifa.ifa_carp)
(*carp_detach_p)(ia-ia_ifa);
 
-fail1:
IF_ADDR_WLOCK(ifp);
TAILQ_REMOVE(ifp-if_addrhead, ia-ia_ifa, ifa_link);
IF_ADDR_WUNLOCK(ifp);
___
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: r269341 - head/sys/dev/mmc

2014-07-31 Thread Ian Lepore
Author: ian
Date: Thu Jul 31 16:54:54 2014
New Revision: 269341
URL: http://svnweb.freebsd.org/changeset/base/269341

Log:
  Export an mmc or sd card's serial number from the mmc layer as an ivar.
  In the mmcsd layer use this value to populate disk-d_ident.  Also set
  disk-d_descr to the full set of card identification info (includes vendor,
  model, manufacturing date, etc).

Modified:
  head/sys/dev/mmc/mmc.c
  head/sys/dev/mmc/mmcsd.c
  head/sys/dev/mmc/mmcvar.h

Modified: head/sys/dev/mmc/mmc.c
==
--- head/sys/dev/mmc/mmc.c  Thu Jul 31 16:43:56 2014(r269340)
+++ head/sys/dev/mmc/mmc.c  Thu Jul 31 16:54:54 2014(r269341)
@@ -102,6 +102,7 @@ struct mmc_ivars {
uint32_t hs_tran_speed; /* Max speed in high speed mode */
uint32_t erase_sector;  /* Card native erase sector size */
char card_id_string[64];/* Formatted CID info (serial, MFG, etc) */
+   char card_sn_string[16];/* Formatted serial # for disk-d_ident */
 };
 
 #define CMD_RETRIES3
@@ -887,6 +888,9 @@ mmc_format_card_id_string(struct mmc_iva
 * mmcsd0: 968MB SD SD01G 8.0 SN 2686905 Mfg 08/2008 by 3 TN at mmc0
 * 22.5MHz/4bit/128-block
 *
+* Also format just the card serial number, which the mmcsd driver will
+* use as the disk-d_ident string.
+*
 * The card_id_string in mmc_ivars is currently allocated as 64 bytes,
 * and our max formatted length is currently 55 bytes if every field
 * contains the largest value.
@@ -900,8 +904,10 @@ mmc_format_card_id_string(struct mmc_iva
snprintf(oidstr, sizeof(oidstr), %c%c, c1, c2);
else
snprintf(oidstr, sizeof(oidstr), 0x%04x, ivar-cid.oid);
+   snprintf(ivar-card_sn_string, sizeof(ivar-card_sn_string),
+   %08X, ivar-cid.psn);
snprintf(ivar-card_id_string, sizeof(ivar-card_id_string),
-   %s%s %s %d.%d SN %u MFG %02d/%04d by %d %s,
+   %s%s %s %d.%d SN %08X MFG %02d/%04d by %d %s,
ivar-mode == mode_sd ? SD : MMC, ivar-high_cap ? HC : ,
ivar-cid.pnm, ivar-cid.prv  4, ivar-cid.prv  0x0f,
ivar-cid.psn, ivar-cid.mdt_month, ivar-cid.mdt_year,
@@ -1698,6 +1704,9 @@ mmc_read_ivar(device_t bus, device_t chi
case MMC_IVAR_CARD_ID_STRING:
*(char **)result = ivar-card_id_string;
break;
+   case MMC_IVAR_CARD_SN_STRING:
+   *(char **)result = ivar-card_sn_string;
+   break;
}
return (0);
 }

Modified: head/sys/dev/mmc/mmcsd.c
==
--- head/sys/dev/mmc/mmcsd.cThu Jul 31 16:43:56 2014(r269340)
+++ head/sys/dev/mmc/mmcsd.cThu Jul 31 16:54:54 2014(r269341)
@@ -163,6 +163,9 @@ mmcsd_attach(device_t dev)
d-d_unit = device_get_unit(dev);
d-d_flags = DISKFLAG_CANDELETE;
d-d_delmaxsize = mmc_get_erase_sector(dev) * d-d_sectorsize * 1; /* 
conservative */
+   strlcpy(d-d_ident, mmc_get_card_sn_string(dev), sizeof(d-d_ident));
+   strlcpy(d-d_descr, mmc_get_card_id_string(dev), sizeof(d-d_descr));
+
/*
 * Display in most natural units.  There's no cards  1MB.  The SD
 * standard goes to 2GiB due to its reliance on FAT, but the data
@@ -188,7 +191,7 @@ mmcsd_attach(device_t dev)
speed = mmcbr_get_clock(device_get_parent(dev));
maxblocks = mmc_get_max_data(dev);
device_printf(dev, %ju%cB %s%s at %s %d.%01dMHz/%dbit/%d-block\n,
-   mb, unit, mmc_get_card_id_string(dev),
+   mb, unit, d-d_descr,
mmc_get_read_only(dev) ?  (read-only) : ,
device_get_nameunit(device_get_parent(dev)),
speed / 100, (speed / 10) % 10,

Modified: head/sys/dev/mmc/mmcvar.h
==
--- head/sys/dev/mmc/mmcvar.h   Thu Jul 31 16:43:56 2014(r269340)
+++ head/sys/dev/mmc/mmcvar.h   Thu Jul 31 16:54:54 2014(r269341)
@@ -69,11 +69,12 @@ enum mmc_device_ivars {
 MMC_IVAR_BUS_WIDTH,
 MMC_IVAR_ERASE_SECTOR,
 MMC_IVAR_MAX_DATA,
-MMC_IVAR_CARD_ID_STRING
+MMC_IVAR_CARD_ID_STRING,
+MMC_IVAR_CARD_SN_STRING,
 };
 
 /*
- * Simplified accessors for pci devices
+ * Simplified accessors for mmc devices
  */
 #define MMC_ACCESSOR(var, ivar, type)  \
__BUS_ACCESSOR(mmc, var, MMC, ivar, type)
@@ -90,5 +91,6 @@ MMC_ACCESSOR(bus_width, BUS_WIDTH, int)
 MMC_ACCESSOR(erase_sector, ERASE_SECTOR, int)
 MMC_ACCESSOR(max_data, MAX_DATA, int)
 MMC_ACCESSOR(card_id_string, CARD_ID_STRING, const char *)
+MMC_ACCESSOR(card_sn_string, CARD_SN_STRING, const char *)
 
 #endif /* DEV_MMC_MMCVAR_H */
___
svn-src-all@freebsd.org mailing list

svn commit: r269343 - in stable/9/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/common/sys contrib/opensolaris/uts/intel/dtrace dev/dtrace

2014-07-31 Thread Mark Johnston
Author: markj
Date: Thu Jul 31 17:10:04 2014
New Revision: 269343
URL: http://svnweb.freebsd.org/changeset/base/269343

Log:
  MFC r264434:
  DTrace's pid provider works by inserting breakpoint instructions at probe
  sites and installing a hook at the kernel's trap handler. The fasttrap code
  will emulate the overwritten instruction in some common cases, but otherwise
  copies it out into some scratch space in the traced process' address space
  and ensures that it's executed after returning from the trap.
  
  In Solaris and illumos, this (per-thread) scratch space comes from some
  reserved space in TLS, accessible via the fs segment register. This
  approach is somewhat unappealing on FreeBSD since it would require some
  modifications to rtld and jemalloc (for static TLS) to ensure that TLS is
  executable, and would thus introduce dependencies on their implementation
  details. I think it would also be impossible to safely trace static binaries
  compiled without these modifications.
  
  This change implements the functionality in a different way, by having
  fasttrap map pages into the target process' address space on demand. Each
  page is divided into 64-byte chunks for use by individual threads, and
  fasttrap's process descriptor struct has been extended to keep track of
  any scratch space allocated for the corresponding process.
  
  With this change it's possible to trace all libc functions in a program,
  e.g. with
  
pid$target:libc.so.*::entry {@[probefunc] = count();}
  
  Previously this would generally cause the victim process to crash, as
  tracing memcpy on amd64 requires the functionality described above.

Modified:
  stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h
  stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
  stable/9/sys/cddl/dev/dtrace/dtrace_cddl.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c  Thu Jul 
31 17:10:03 2014(r269342)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c  Thu Jul 
31 17:10:04 2014(r269343)
@@ -61,8 +61,13 @@
 #include sys/mutex.h
 #include sys/kernel.h
 #if !defined(sun)
-#include sys/user.h
 #include sys/dtrace_bsd.h
+#include sys/eventhandler.h
+#include sys/user.h
+#include vm/vm.h
+#include vm/pmap.h
+#include vm/vm_map.h
+#include vm/vm_param.h
 #include cddl/dev/dtrace/dtrace_cddl.h
 #endif
 
@@ -206,6 +211,10 @@ static void fasttrap_provider_free(fastt
 static fasttrap_proc_t *fasttrap_proc_lookup(pid_t);
 static void fasttrap_proc_release(fasttrap_proc_t *);
 
+#if !defined(sun)
+static void fasttrap_thread_dtor(void *, struct thread *);
+#endif
+
 #defineFASTTRAP_PROVS_INDEX(pid, name) \
((fasttrap_hash_str(name) + (pid))  fasttrap_provs.fth_mask)
 
@@ -213,6 +222,7 @@ static void fasttrap_proc_release(fasttr
 
 #if !defined(sun)
 static kmutex_t fasttrap_cpuc_pid_lock[MAXCPU];
+static eventhandler_tag fasttrap_thread_dtor_tag;
 #endif
 
 static int
@@ -289,6 +299,118 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t
 #endif
 }
 
+#if !defined(sun)
+/*
+ * Obtain a chunk of scratch space in the address space of the target process.
+ */
+fasttrap_scrspace_t *
+fasttrap_scraddr(struct thread *td, fasttrap_proc_t *fprc)
+{
+   fasttrap_scrblock_t *scrblk;
+   fasttrap_scrspace_t *scrspc;
+   struct proc *p;
+   vm_offset_t addr;
+   int error, i;
+
+   scrspc = NULL;
+   if (td-t_dtrace_sscr != NULL) {
+   /* If the thread already has scratch space, we're done. */
+   scrspc = (fasttrap_scrspace_t *)td-t_dtrace_sscr;
+   return (scrspc);
+   }
+
+   p = td-td_proc;
+
+   mutex_enter(fprc-ftpc_mtx);
+   if (LIST_EMPTY(fprc-ftpc_fscr)) {
+   /*
+* No scratch space is available, so we'll map a new scratch
+* space block into the traced process' address space.
+*/
+   addr = 0;
+   error = vm_map_find(p-p_vmspace-vm_map, NULL, 0, addr,
+   FASTTRAP_SCRBLOCK_SIZE, VMFS_ANY_SPACE, VM_PROT_ALL,
+   VM_PROT_ALL, 0);
+   if (error != KERN_SUCCESS)
+   goto done;
+
+   scrblk = malloc(sizeof(*scrblk), M_SOLARIS, M_WAITOK);
+   scrblk-ftsb_addr = addr;
+   LIST_INSERT_HEAD(fprc-ftpc_scrblks, scrblk, ftsb_next);
+
+   /*
+* Carve the block up into chunks and put them on the free list.
+*/
+   for (i = 0;
+   i  FASTTRAP_SCRBLOCK_SIZE / FASTTRAP_SCRSPACE_SIZE; i++) {
+  

svn commit: r269342 - in stable/10/sys/cddl: contrib/opensolaris/uts/common/dtrace contrib/opensolaris/uts/common/sys contrib/opensolaris/uts/intel/dtrace dev/dtrace

2014-07-31 Thread Mark Johnston
Author: markj
Date: Thu Jul 31 17:10:03 2014
New Revision: 269342
URL: http://svnweb.freebsd.org/changeset/base/269342

Log:
  MFC r264434:
  DTrace's pid provider works by inserting breakpoint instructions at probe
  sites and installing a hook at the kernel's trap handler. The fasttrap code
  will emulate the overwritten instruction in some common cases, but otherwise
  copies it out into some scratch space in the traced process' address space
  and ensures that it's executed after returning from the trap.
  
  In Solaris and illumos, this (per-thread) scratch space comes from some
  reserved space in TLS, accessible via the fs segment register. This
  approach is somewhat unappealing on FreeBSD since it would require some
  modifications to rtld and jemalloc (for static TLS) to ensure that TLS is
  executable, and would thus introduce dependencies on their implementation
  details. I think it would also be impossible to safely trace static binaries
  compiled without these modifications.
  
  This change implements the functionality in a different way, by having
  fasttrap map pages into the target process' address space on demand. Each
  page is divided into 64-byte chunks for use by individual threads, and
  fasttrap's process descriptor struct has been extended to keep track of
  any scratch space allocated for the corresponding process.
  
  With this change it's possible to trace all libc functions in a program,
  e.g. with
  
pid$target:libc.so.*::entry {@[probefunc] = count();}
  
  Previously this would generally cause the victim process to crash, as
  tracing memcpy on amd64 requires the functionality described above.

Modified:
  stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
  stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h
  stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
  stable/10/sys/cddl/dev/dtrace/dtrace_cddl.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==
--- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Jul 
31 16:54:54 2014(r269341)
+++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Jul 
31 17:10:03 2014(r269342)
@@ -61,8 +61,13 @@
 #include sys/mutex.h
 #include sys/kernel.h
 #if !defined(sun)
-#include sys/user.h
 #include sys/dtrace_bsd.h
+#include sys/eventhandler.h
+#include sys/user.h
+#include vm/vm.h
+#include vm/pmap.h
+#include vm/vm_map.h
+#include vm/vm_param.h
 #include sys/u8_textprep.h
 #include cddl/dev/dtrace/dtrace_cddl.h
 #endif
@@ -207,6 +212,10 @@ static void fasttrap_provider_free(fastt
 static fasttrap_proc_t *fasttrap_proc_lookup(pid_t);
 static void fasttrap_proc_release(fasttrap_proc_t *);
 
+#if !defined(sun)
+static void fasttrap_thread_dtor(void *, struct thread *);
+#endif
+
 #defineFASTTRAP_PROVS_INDEX(pid, name) \
((fasttrap_hash_str(name) + (pid))  fasttrap_provs.fth_mask)
 
@@ -214,6 +223,7 @@ static void fasttrap_proc_release(fasttr
 
 #if !defined(sun)
 static kmutex_t fasttrap_cpuc_pid_lock[MAXCPU];
+static eventhandler_tag fasttrap_thread_dtor_tag;
 #endif
 
 static int
@@ -290,6 +300,118 @@ fasttrap_sigtrap(proc_t *p, kthread_t *t
 #endif
 }
 
+#if !defined(sun)
+/*
+ * Obtain a chunk of scratch space in the address space of the target process.
+ */
+fasttrap_scrspace_t *
+fasttrap_scraddr(struct thread *td, fasttrap_proc_t *fprc)
+{
+   fasttrap_scrblock_t *scrblk;
+   fasttrap_scrspace_t *scrspc;
+   struct proc *p;
+   vm_offset_t addr;
+   int error, i;
+
+   scrspc = NULL;
+   if (td-t_dtrace_sscr != NULL) {
+   /* If the thread already has scratch space, we're done. */
+   scrspc = (fasttrap_scrspace_t *)td-t_dtrace_sscr;
+   return (scrspc);
+   }
+
+   p = td-td_proc;
+
+   mutex_enter(fprc-ftpc_mtx);
+   if (LIST_EMPTY(fprc-ftpc_fscr)) {
+   /*
+* No scratch space is available, so we'll map a new scratch
+* space block into the traced process' address space.
+*/
+   addr = 0;
+   error = vm_map_find(p-p_vmspace-vm_map, NULL, 0, addr,
+   FASTTRAP_SCRBLOCK_SIZE, 0, VMFS_ANY_SPACE, VM_PROT_ALL,
+   VM_PROT_ALL, 0);
+   if (error != KERN_SUCCESS)
+   goto done;
+
+   scrblk = malloc(sizeof(*scrblk), M_SOLARIS, M_WAITOK);
+   scrblk-ftsb_addr = addr;
+   LIST_INSERT_HEAD(fprc-ftpc_scrblks, scrblk, ftsb_next);
+
+   /*
+* Carve the block up into chunks and put them on the free list.
+*/
+   for (i = 0;
+   i  FASTTRAP_SCRBLOCK_SIZE / FASTTRAP_SCRSPACE_SIZE; i++) {
+   scrspc = 

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

2014-07-31 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jul 31 17:18:40 2014
New Revision: 269344
URL: http://svnweb.freebsd.org/changeset/base/269344

Log:
  - Updated SYSCTL manual pages after recent changes to the kernel
  SYSCTL code. Added description of new macros and functions.
  - Merged dynamic and static SYSCTL related content into a single
  manual page, hence parameters and functionality is very much the same.
  - Uppercased all occurrences of OID.
  - Updated all SYSCTL examples.
  
  PR:   192101

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/sysctl.9
  head/share/man/man9/sysctl_add_oid.9
  head/share/man/man9/sysctl_ctx_init.9

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileThu Jul 31 17:10:04 2014
(r269343)
+++ head/share/man/man9/MakefileThu Jul 31 17:18:40 2014
(r269344)
@@ -1351,33 +1351,36 @@ MLINKS+=sx.9 sx_assert.9 \
sx.9 sx_xlocked.9 \
sx.9 sx_xunlock.9
 MLINKS+=sysctl.9 SYSCTL_DECL.9 \
+   sysctl.9 SYSCTL_ADD_INT.9 \
+   sysctl.9 SYSCTL_ADD_LONG.9 \
+   sysctl.9 SYSCTL_ADD_NODE.9 \
+   sysctl.9 SYSCTL_ADD_OPAQUE.9 \
+   sysctl.9 SYSCTL_ADD_PROC.9 \
+   sysctl.9 SYSCTL_ADD_QUAD.9 \
+   sysctl.9 SYSCTL_ADD_ROOT_NODE.9 \
+   sysctl.9 SYSCTL_ADD_STRING.9 \
+   sysctl.9 SYSCTL_ADD_STRUCT.9 \
+   sysctl.9 SYSCTL_ADD_UINT.9 \
+   sysctl.9 SYSCTL_ADD_ULONG.9 \
+   sysctl.9 SYSCTL_ADD_UQUAD.9 \
+   sysctl.9 SYSCTL_CHILDREN.9 \
+   sysctl.9 SYSCTL_STATIC_CHILDREN.9 \
+   sysctl.9 SYSCTL_NODE_CHILDREN.9 \
+   sysctl.9 SYSCTL_PARENT.9 \
sysctl.9 SYSCTL_INT.9 \
sysctl.9 SYSCTL_LONG.9 \
sysctl.9 SYSCTL_NODE.9 \
sysctl.9 SYSCTL_OPAQUE.9 \
sysctl.9 SYSCTL_PROC.9 \
sysctl.9 SYSCTL_QUAD.9 \
+   sysctl.9 SYSCTL_ROOT_NODE.9 \
sysctl.9 SYSCTL_STRING.9 \
sysctl.9 SYSCTL_STRUCT.9 \
sysctl.9 SYSCTL_UINT.9 \
sysctl.9 SYSCTL_ULONG.9 \
sysctl.9 SYSCTL_UQUAD.9
-MLINKS+=sysctl_add_oid.9 SYSCTL_ADD_INT.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_LONG.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_NODE.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_OID.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_OPAQUE.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_PROC.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_QUAD.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_STRING.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_STRUCT.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_UINT.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_ULONG.9 \
-   sysctl_add_oid.9 SYSCTL_ADD_UQUAD.9 \
-   sysctl_add_oid.9 SYSCTL_CHILDREN.9 \
-   sysctl_add_oid.9 sysctl_move_oid.9 \
-   sysctl_add_oid.9 sysctl_remove_oid.9 \
-   sysctl_add_oid.9 SYSCTL_STATIC_CHILDREN.9
+MLINKS+=sysctl_add_oid.9 sysctl_move_oid.9 \
+   sysctl_add_oid.9 sysctl_remove_oid.9
 MLINKS+=sysctl_ctx_init.9 sysctl_ctx_entry_add.9 \
sysctl_ctx_init.9 sysctl_ctx_entry_del.9 \
sysctl_ctx_init.9 sysctl_ctx_entry_find.9 \

Modified: head/share/man/man9/sysctl.9
==
--- head/share/man/man9/sysctl.9Thu Jul 31 17:10:04 2014
(r269343)
+++ head/share/man/man9/sysctl.9Thu Jul 31 17:18:40 2014
(r269344)
@@ -25,79 +25,421 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd September 12, 2013
+.Dd July 31, 2014
 .Dt SYSCTL 9
 .Os
 .Sh NAME
 .Nm SYSCTL_DECL ,
+.Nm SYSCTL_ADD_INT ,
+.Nm SYSCTL_ADD_LONG ,
+.Nm SYSCTL_ADD_NODE ,
+.Nm SYSCTL_ADD_OPAQUE ,
+.Nm SYSCTL_ADD_PROC ,
+.Nm SYSCTL_ADD_QUAD ,
+.Nm SYSCTL_ADD_ROOT_NODE ,
+.Nm SYSCTL_ADD_STRING ,
+.Nm SYSCTL_ADD_STRUCT ,
+.Nm SYSCTL_ADD_UINT ,
+.Nm SYSCTL_ADD_ULONG ,
+.Nm SYSCTL_ADD_UQUAD ,
+.Nm SYSCTL_CHILDREN ,
+.Nm SYSCTL_STATIC_CHILDREN ,
+.Nm SYSCTL_NODE_CHILDREN ,
+.Nm SYSCTL_PARENT ,
 .Nm SYSCTL_INT ,
 .Nm SYSCTL_LONG ,
 .Nm SYSCTL_NODE ,
 .Nm SYSCTL_OPAQUE ,
 .Nm SYSCTL_PROC ,
 .Nm SYSCTL_QUAD ,
+.Nm SYSCTL_ROOT_NODE ,
 .Nm SYSCTL_STRING ,
 .Nm SYSCTL_STRUCT ,
 .Nm SYSCTL_UINT ,
 .Nm SYSCTL_ULONG ,
 .Nm SYSCTL_UQUAD
-.Nd Static sysctl declaration functions
+.Nd Dynamic and static sysctl MIB creation functions
 .Sh SYNOPSIS
 .In sys/types.h
 .In sys/sysctl.h
 .Fn SYSCTL_DECL name
-.Fn SYSCTL_INT parent nbr name access ptr val descr
-.Fn SYSCTL_LONG parent nbr name access ptr val descr
-.Fn SYSCTL_NODE parent nbr name access handler descr
-.Fn SYSCTL_OPAQUE parent nbr name access ptr len fmt descr
-.Fn SYSCTL_PROC parent nbr name access ptr arg handler fmt descr
-.Fn SYSCTL_QUAD parent nbr name access ptr val descr
-.Fn SYSCTL_STRING parent nbr name access arg len descr
-.Fn SYSCTL_STRUCT parent nbr name access ptr type descr
-.Fn SYSCTL_UINT parent nbr name access ptr val descr
-.Fn SYSCTL_ULONG parent nbr name access ptr val descr
-.Fn SYSCTL_UQUAD parent nbr name access ptr val descr
+.Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_INT
+.Fa struct sysctl_ctx_list *ctx
+.Fa struct 

svn commit: r269345 - head/share/examples/hwpmc

2014-07-31 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jul 31 18:02:38 2014
New Revision: 269345
URL: http://svnweb.freebsd.org/changeset/base/269345

Log:
  Various style(9) and related fixes.
  Update the copyright to be more in line with the current version in
  our tree.
  Remove the ancient rcsid.
  Add a proper return from the main function
  
  Pointed out by: bz

Modified:
  head/share/examples/hwpmc/overhead.c

Modified: head/share/examples/hwpmc/overhead.c
==
--- head/share/examples/hwpmc/overhead.cThu Jul 31 17:18:40 2014
(r269344)
+++ head/share/examples/hwpmc/overhead.cThu Jul 31 18:02:38 2014
(r269345)
@@ -1,45 +1,34 @@
-/* 
+/*-
  * Copyright (c) 2014, Neville-Neil Consulting
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- * 
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 
- * Neither the name of Neville-Neil Consulting nor the names of its 
- * contributors may be used to endorse or promote products derived from 
- * this software without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  *
  * $FreeBSD$
  *
  * Author: George V. Neville-Neil
  *
- *
  */
 
-#ifndef lint
-static char rcsid [] = $Header:$ ;
-#endif
-
 /*
  * Calculate the time overhead of starting, stopping, and recording
  * pmc counters.
@@ -59,7 +48,8 @@ static char rcsid [] = $Header:$ ;
 #include machine/cpufunc.h
 #include pmc.h
 
-int main(int argc, char **argv)
+int
+main(int argc, char **argv)
 {
pmc_id_t pmcid;
pmc_value_t read_value;
@@ -111,5 +101,6 @@ int main(int argc, char **argv)
printf(Cycles to start: %ld\tstop: %ld\tread: %ld\twrite: %ld\n,
start_cyc, stop_cyc, read_cyc, stop_cyc);
 
+   return(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: r269134 - head/sys/vm

2014-07-31 Thread Alan Cox
On 07/31/2014 04:00, Andreas Tobler wrote:
 On 31.07.14 06:35, Alan Cox wrote:
 On 07/30/2014 16:26, Andreas Tobler wrote:
 On 30.07.14 23:17, Alan Cox wrote:
 On 07/30/2014 15:15, Andreas Tobler wrote:
 On 30.07.14 21:54, Alan Cox wrote:
 On 07/30/2014 14:46, Alan Cox wrote:
 On 07/30/2014 13:58, Andreas Tobler wrote:
 Hi Alan,

 On 26.07.14 20:10, Alan Cox wrote:
 Author: alc
 Date: Sat Jul 26 18:10:18 2014
 New Revision: 269134
 URL: http://svnweb.freebsd.org/changeset/base/269134

 Log:
   When unwiring a region of an address space, do not
 assume that
 the
   underlying physical pages are mapped by the pmap.  If, for
 example, the
   application has performed an mprotect(..., PROT_NONE) on
 any part
 of the
   wired region, then those pages will no longer be mapped
 by the
 pmap.
   So, using the pmap to lookup the wired pages in order to
 unwire them
   doesn't always work, and when it doesn't work wired
 pages are
 leaked.

   To avoid the leak, introduce and use a new function
 vm_object_unwire()
   that locates the wired pages by traversing the object
 and its
 backing
   objects.

   At the same time, switch from using pmap_change_wiring() to
 the
 recently
   introduced function pmap_unwire() for unwiring the region's
 mappings.
   pmap_unwire() is faster, because it operates a range of
 virtual
 addresses
   rather than a single virtual page at a time.  Moreover, by
 operating on
   a range, it is superpage friendly.  It doesn't waste time
 performing
   unnecessary demotions.

   Reported by:markj
   Reviewed by:kib
   Tested by:pho, jmg (arm)
   Sponsored by:EMC / Isilon Storage Division
 This commit brings my 32- and 64-bit PowerMac's into panic.
 Unfortunately I'm not able to give you a backtrace in the form
 of a
 textdump nor of a core dump.

 The only thing I have is this picture:

 http://people.freebsd.org/~andreast/r269134_panic.jpg

 Exactly this revision gives a panic and breaks the
 textdump/coredump
 facility.

 How can I help debugging?

 It appears to me that moea64_pvo_enter() had a pre-existing bug
 that
 got
 tickled by this change.  Specifically, moea64_pvo_enter()
 doesn't set
 the PVO_WIRED flag when an unwired mapping already exists.  It just
 returns with the mapping still in an unwired state.  Consequently,
 when
 pmap_unwire() finally runs, it doesn't find a wired mapping.

 Try this:

 Index: powerpc/aim/mmu_oea64.c
 ===
 --- powerpc/aim/mmu_oea64.c (revision 269127)
 +++ powerpc/aim/mmu_oea64.c (working copy)
 @@ -2274,7 +2274,8 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm,
 uma_zone_t
if (pvo-pvo_pmap == pm  PVO_VADDR(pvo) ==
 va) {
if ((pvo-pvo_pte.lpte.pte_lo 
 LPTE_RPGN)
 == pa 
(pvo-pvo_pte.lpte.pte_lo 
 (LPTE_NOEXEC |
 LPTE_PP))
 -   == (pte_lo  (LPTE_NOEXEC |
 LPTE_PP))) {
 +   == (pte_lo  (LPTE_NOEXEC |
 LPTE_PP)) 
 +   ((pvo-pvo_vaddr ^ flags) 
 PVO_WIRED)) {
if (!(pvo-pvo_pte.lpte.pte_hi 
 LPTE_VALID)) {
/* Re-insert if
 spilled */
i =
 MOEA64_PTE_INSERT(mmu,
 ptegidx,


 The new conditional test needs to be inverted.  Try this instead:

 Index: powerpc/aim/mmu_oea64.c
 ===
 --- powerpc/aim/mmu_oea64.c (revision 269127)
 +++ powerpc/aim/mmu_oea64.c (working copy)
 @@ -2274,7 +2274,8 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm,
 uma_zone_t
if (pvo-pvo_pmap == pm  PVO_VADDR(pvo) ==
 va) {
if ((pvo-pvo_pte.lpte.pte_lo 
 LPTE_RPGN)
 == pa 
(pvo-pvo_pte.lpte.pte_lo 
 (LPTE_NOEXEC |
 LPTE_PP))
 -   == (pte_lo  (LPTE_NOEXEC | LPTE_PP))) {
 +   == (pte_lo  (LPTE_NOEXEC | LPTE_PP)) 
 +   ((pvo-pvo_vaddr ^ flags) 
 PVO_WIRED) ==
 0) {
if (!(pvo-pvo_pte.lpte.pte_hi 
 LPTE_VALID)) {
/* Re-insert if
 spilled */
i =
 MOEA64_PTE_INSERT(mmu,
 ptegidx,



 The panic stays, but the message is different:

 panic: moea64_pvo_to_pte: pvo 0x10147ea0 has invalid pte 0xb341180 in
 moea64_pteg_table but valid in pvo.


 My attempted fix is doing something else wrong.  Do you have a stack
 trace?

 iPhone sei Dank:

 http://people.freebsd.org/~andreast/r269134-1_panic.jpg

 Ok, this patch should fix both the original panic and the new one.  They
 are two distinct problems.

 Yep, thank you!

 Additionally I tried to adapt the 32-bit path and successfully booted
 the below, ok?

 Again, thanks a lot!
 Andreas

 

svn commit: r269347 - in head/sys/fs: nfs nfsserver

2014-07-31 Thread Konstantin Belousov
Author: kib
Date: Thu Jul 31 19:24:44 2014
New Revision: 269347
URL: http://svnweb.freebsd.org/changeset/base/269347

Log:
  Do not generate 1000 unique lock names for nfsrc hash chain locks.
  It overflows witness.
  
  Shorten the names of some nfs mutexes.
  
  Reported and tested by:   pho
  No objections from:   rmacklem, mav
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/fs/nfs/nfsrvcache.h
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfs/nfsrvcache.h
==
--- head/sys/fs/nfs/nfsrvcache.hThu Jul 31 18:54:40 2014
(r269346)
+++ head/sys/fs/nfs/nfsrvcache.hThu Jul 31 19:24:44 2014
(r269347)
@@ -116,7 +116,6 @@ LIST_HEAD(nfsrvhashhead, nfsrvcache);
 /* The fine-grained locked cache hash table for TCP. */
 struct nfsrchash_bucket {
struct mtx  mtx;
-   charlock_name[16];
struct nfsrvhashheadtbl;
 };
 

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cThu Jul 31 18:54:40 2014
(r269346)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cThu Jul 31 19:24:44 2014
(r269347)
@@ -3321,23 +3321,16 @@ nfsd_modevent(module_t mod, int type, vo
goto out;
newnfs_portinit();
for (i = 0; i  NFSRVCACHE_HASHSIZE; i++) {
-   snprintf(nfsrchash_table[i].lock_name,
-   sizeof(nfsrchash_table[i].lock_name), nfsrc_tcp%d,
-   i);
-   mtx_init(nfsrchash_table[i].mtx,
-   nfsrchash_table[i].lock_name, NULL, MTX_DEF);
-   snprintf(nfsrcahash_table[i].lock_name,
-   sizeof(nfsrcahash_table[i].lock_name), 
nfsrc_tcpa%d,
-   i);
-   mtx_init(nfsrcahash_table[i].mtx,
-   nfsrcahash_table[i].lock_name, NULL, MTX_DEF);
+   mtx_init(nfsrchash_table[i].mtx, nfsrtc, NULL,
+   MTX_DEF);
+   mtx_init(nfsrcahash_table[i].mtx, nfsrtca, NULL,
+   MTX_DEF);
}
-   mtx_init(nfsrc_udpmtx, nfs_udpcache_mutex, NULL, MTX_DEF);
-   mtx_init(nfs_v4root_mutex, nfs_v4root_mutex, NULL, MTX_DEF);
-   mtx_init(nfsv4root_mnt.mnt_mtx, struct mount mtx, NULL,
-   MTX_DEF);
+   mtx_init(nfsrc_udpmtx, nfsuc, NULL, MTX_DEF);
+   mtx_init(nfs_v4root_mutex, nfs4rt, NULL, MTX_DEF);
+   mtx_init(nfsv4root_mnt.mnt_mtx, nfs4mnt, NULL, MTX_DEF);
for (i = 0; i  NFSSESSIONHASHSIZE; i++)
-   mtx_init(nfssessionhash[i].mtx, nfs_session_mutex,
+   mtx_init(nfssessionhash[i].mtx, nfssm,
NULL, MTX_DEF);
lockinit(nfsv4root_mnt.mnt_explock, PVFS, explock, 0, 0);
nfsrvd_initcache();
___
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: r269134 - head/sys/vm

2014-07-31 Thread Andreas Tobler

On 31.07.14 20:34, Alan Cox wrote:


Here is a better fix for the problem in moea64_pvo_enter().  The
original fix destroys and recreates the PTE in order to wire it.  This
new fix simply updates the PTE.

In the case of moea_pvo_enter(), there is also no need to destroy and
recreate the PTE.


Awesome! All with no runtime tests?

Nothing to say beside it works, on PowerMac G5 (64-bit)(2/4-CPU's) and 
MacMini G4 (32-bit)(1-CPU).


Thank you again!
Andreas

___
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: r269351 - head/usr.sbin/bsdconfig/share

2014-07-31 Thread Devin Teske
Author: dteske
Date: Thu Jul 31 22:00:36 2014
New Revision: 269351
URL: http://svnweb.freebsd.org/changeset/base/269351

Log:
  Define a setvar() function for platforms using a shell unlike FreeBSD's
  sh(1) for `/bin/sh' (e.g., bash(1) which lacks a setvar definition).
  This is to improve portability to other Operating Systems (e.g., Linux).

Modified:
  head/usr.sbin/bsdconfig/share/common.subr

Modified: head/usr.sbin/bsdconfig/share/common.subr
==
--- head/usr.sbin/bsdconfig/share/common.subr   Thu Jul 31 20:55:05 2014
(r269350)
+++ head/usr.sbin/bsdconfig/share/common.subr   Thu Jul 31 22:00:36 2014
(r269351)
@@ -220,6 +220,32 @@ f_have()
f_quietly type $@
 }
 
+# setvar $var_to_set [$value]
+#
+# Implement setvar for shells such as unlike FreeBSD sh(1).
+#
+if ! f_have setvar; then
+setvar()
+{
+   [ $# -gt 0 ] || return $SUCCESS
+   local __setvar_var_to_set=$1 __setvar_right=$2 __setvar_left=
+   case $# in
+   1) unset $__setvar_var_to_set
+  return $? ;;
+   2) : fall through ;;
+   *) f_err setvar: too many arguments\n
+  return $FAILURE
+   esac
+   while case $__setvar_r in *\'*) : ;; *) false ; esac
+   do
+   __setvar_left=$__setvar_left${__setvar_right%%\'*}'\\''
+   __setvar_right=${__setvar_right#*\'}
+   done
+   __setvar_left=$__setvar_left${__setvar_right#*\'}
+   eval $__setvar_var_to_set='$__setvar_left'
+}
+fi
+
 # f_which $anything [$var_to_set]
 #
 # A fast built-in replacement for syntaxes such as foo=$( which bar ). In a
___
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: r269352 - head/usr.sbin/bsdconfig/share

2014-07-31 Thread Devin Teske
Author: dteske
Date: Thu Jul 31 22:05:18 2014
New Revision: 269352
URL: http://svnweb.freebsd.org/changeset/base/269352

Log:
  Fix a syntax error when running under bash(1) for portability.

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==
--- head/usr.sbin/bsdconfig/share/dialog.subr   Thu Jul 31 22:00:36 2014
(r269351)
+++ head/usr.sbin/bsdconfig/share/dialog.subr   Thu Jul 31 22:05:18 2014
(r269352)
@@ -2099,9 +2099,13 @@ f_dialog_init()
#
# Process stored command-line arguments
#
+   # NB: Using backticks instead of $(...) for portability since Linux
+   # bash(1) balks at the right parentheses encountered in the case-
+   # statement (incorrectly interpreting it as the close of $(...)).
+   #
f_dprintf f_dialog_init: ARGV=[%s] GETOPTS_STDARGS=[%s] \
  $ARGV $GETOPTS_STDARGS
-   SECURE=$( set -- $ARGV
+   SECURE=`set -- $ARGV
while getopts \
$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS \
flag  /dev/null; do
@@ -2109,8 +2113,8 @@ f_dialog_init()
S) echo 1 ;;
esac
done
-   )
-   USE_XDIALOG=$( set -- $ARGV
+   ` # END-BACKTICK
+   USE_XDIALOG=`set -- $ARGV
while getopts \
$GETOPTS_STDARGS$GETOPTS_EXTRA$GETOPTS_ALLFLAGS \
flag  /dev/null; do
@@ -2118,7 +2122,7 @@ f_dialog_init()
S|X) echo 1 ;;
esac
done
-   )
+   ` # END-BACKTICK
f_dprintf f_dialog_init: SECURE=[%s] USE_XDIALOG=[%s] \
  $SECURE $USE_XDIALOG
 
___
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: r269353 - head/sys/cam/scsi

2014-07-31 Thread Joerg Wunsch
Author: joerg
Date: Thu Jul 31 22:09:50 2014
New Revision: 269353
URL: http://svnweb.freebsd.org/changeset/base/269353

Log:
  Fix breakage introduced by r256843: removing the SA_CCB_WAITING bit
  left some of the decisions based on its counterpart, SA_CCB_BUFFER_IO
  being random.  As a result, propagation of the residual information
  for the SPACE command was broken, so the number of filemarks
  encountered during a SPACE operation was miscalculated.  Consequently,
  systems relying on properly tracked filemark counters (like Bacula)
  fell apart.
  
  The change also removes a switch/case in sadone() which r256843
  degraded to a single remaining case label.
  
  PR:   192285
  Approved by:  ken
  MFC after:2 weeks

Modified:
  head/sys/cam/scsi/scsi_sa.c

Modified: head/sys/cam/scsi/scsi_sa.c
==
--- head/sys/cam/scsi/scsi_sa.c Thu Jul 31 22:05:18 2014(r269352)
+++ head/sys/cam/scsi/scsi_sa.c Thu Jul 31 22:09:50 2014(r269353)
@@ -113,16 +113,8 @@ typedef enum {
 #define ccb_pflags ppriv_field0
 #define ccb_bp ppriv_ptr1
 
-#defineSA_CCB_BUFFER_IO0x0
-#defineSA_CCB_TYPEMASK 0x1
-#defineSA_POSITION_UPDATED 0x2
-
-#defineSet_CCB_Type(x, type)   \
-   x-ccb_h.ccb_pflags = ~SA_CCB_TYPEMASK;\
-   x-ccb_h.ccb_pflags |= type
-
-#defineCCB_Type(x) (x-ccb_h.ccb_pflags  SA_CCB_TYPEMASK)
-
+/* bits in ccb_pflags */
+#defineSA_POSITION_UPDATED 0x1
 
 
 typedef enum {
@@ -1835,7 +1827,6 @@ again:
bp-bio_data, bp-bio_bcount, SSD_FULL_SIZE,
IO_TIMEOUT);
start_ccb-ccb_h.ccb_pflags = ~SA_POSITION_UPDATED;
-   Set_CCB_Type(start_ccb, SA_CCB_BUFFER_IO);
start_ccb-ccb_h.ccb_bp = bp;
bp = bioq_first(softc-bio_queue);
xpt_action(start_ccb);
@@ -1860,92 +1851,86 @@ sadone(struct cam_periph *periph, union 
 {
struct sa_softc *softc;
struct ccb_scsiio *csio;
+   struct bio *bp;
+   int error;
 
softc = (struct sa_softc *)periph-softc;
csio = done_ccb-csio;
-   switch (CCB_Type(csio)) {
-   case SA_CCB_BUFFER_IO:
-   {
-   struct bio *bp;
-   int error;
 
-   softc-dsreg = MTIO_DSREG_REST;
-   bp = (struct bio *)done_ccb-ccb_h.ccb_bp;
-   error = 0;
-   if ((done_ccb-ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP) {
-   if ((error = saerror(done_ccb, 0, 0)) == ERESTART) {
-   /*
-* A retry was scheduled, so just return.
-*/
-   return;
-   }
+   softc-dsreg = MTIO_DSREG_REST;
+   bp = (struct bio *)done_ccb-ccb_h.ccb_bp;
+   error = 0;
+   if ((done_ccb-ccb_h.status  CAM_STATUS_MASK) != CAM_REQ_CMP) {
+   if ((error = saerror(done_ccb, 0, 0)) == ERESTART) {
+   /*
+* A retry was scheduled, so just return.
+*/
+   return;
}
+   }
 
-   if (error == EIO) {
+   if (error == EIO) {
 
-   /*
-* Catastrophic error. Mark the tape as frozen
-* (we no longer know tape position).
-*
-* Return all queued I/O with EIO, and unfreeze
-* our queue so that future transactions that
-* attempt to fix this problem can get to the
-* device.
-*
-*/
+   /*
+* Catastrophic error. Mark the tape as frozen
+* (we no longer know tape position).
+*
+* Return all queued I/O with EIO, and unfreeze
+* our queue so that future transactions that
+* attempt to fix this problem can get to the
+* device.
+*
+*/
 
-   softc-flags |= SA_FLAG_TAPE_FROZEN;
-   bioq_flush(softc-bio_queue, NULL, EIO);
-   }
-   if (error != 0) {
-   bp-bio_resid = bp-bio_bcount;
-   bp-bio_error = error;
+   softc-flags |= SA_FLAG_TAPE_FROZEN;
+   bioq_flush(softc-bio_queue, NULL, EIO);
+   }
+   if (error != 0) {
+   bp-bio_resid = bp-bio_bcount;
+   bp-bio_error = error;
+   bp-bio_flags |= BIO_ERROR;
+   /*
+* In the error case, position is updated in saerror.
+*/

svn commit: r269354 - head/usr.sbin/bsdconfig/share

2014-07-31 Thread Devin Teske
Author: dteske
Date: Thu Jul 31 22:13:31 2014
New Revision: 269354
URL: http://svnweb.freebsd.org/changeset/base/269354

Log:
  Update command and add check for edge-case.

Modified:
  head/usr.sbin/bsdconfig/share/common.subr

Modified: head/usr.sbin/bsdconfig/share/common.subr
==
--- head/usr.sbin/bsdconfig/share/common.subr   Thu Jul 31 22:09:50 2014
(r269353)
+++ head/usr.sbin/bsdconfig/share/common.subr   Thu Jul 31 22:13:31 2014
(r269354)
@@ -222,7 +222,7 @@ f_have()
 
 # setvar $var_to_set [$value]
 #
-# Implement setvar for shells such as unlike FreeBSD sh(1).
+# Implement setvar for shells unlike FreeBSD sh(1).
 #
 if ! f_have setvar; then
 setvar()
@@ -236,6 +236,10 @@ setvar()
*) f_err setvar: too many arguments\n
   return $FAILURE
esac
+   case $__setvar_var_to_set in *[!0-9A-Za-z_]*)
+   f_err setvar: %s: bad variable name\n $__setvar_var_to_set
+   return 2
+   esac
while case $__setvar_r in *\'*) : ;; *) false ; esac
do
__setvar_left=$__setvar_left${__setvar_right%%\'*}'\\''
___
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: r269355 - head/tools/tools/nanobsd/dhcpd

2014-07-31 Thread Warner Losh
Author: imp
Date: Thu Jul 31 22:32:39 2014
New Revision: 269355
URL: http://svnweb.freebsd.org/changeset/base/269355

Log:
  Fix a typo in the example script.

Modified:
  head/tools/tools/nanobsd/dhcpd/README

Modified: head/tools/tools/nanobsd/dhcpd/README
==
--- head/tools/tools/nanobsd/dhcpd/README   Thu Jul 31 22:13:31 2014
(r269354)
+++ head/tools/tools/nanobsd/dhcpd/README   Thu Jul 31 22:32:39 2014
(r269355)
@@ -9,6 +9,6 @@ and DHCPd.
 
 This is a work in progress. Generally, to build this you should
  cd tools/tools/nanobsd/dhcpd
- sudo sh ../nandobsd.sh -C os-base
+ sudo sh ../nanobsd.sh -C os-base
 but do be careful if things are interrupted. There may still be
 bugs lurking that cause your entire FreeBSD tree to disappear.
___
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: r269356 - stable/10/sys/dev/cxgbe

2014-07-31 Thread Navdeep Parhar
Author: np
Date: Thu Jul 31 23:04:41 2014
New Revision: 269356
URL: http://svnweb.freebsd.org/changeset/base/269356

Log:
  MFC r268971 and r269032.
  
  r268971:
  Simplify r267600, there's no need to distinguish between allocated and
  inlined mbufs.
  
  r269032:
  cxgbe(4):  Keep track of the clusters that have to be freed by the
  custom free routine (rxb_free) in the driver.  Fail MOD_UNLOAD with
  EBUSY if any such cluster has been handed up to the kernel but hasn't
  been freed yet.  This prevents a panic later when the cluster finally
  needs to be freed but rxb_free is gone from the kernel.

Modified:
  stable/10/sys/dev/cxgbe/adapter.h
  stable/10/sys/dev/cxgbe/t4_main.c
  stable/10/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/cxgbe/adapter.h
==
--- stable/10/sys/dev/cxgbe/adapter.h   Thu Jul 31 22:32:39 2014
(r269355)
+++ stable/10/sys/dev/cxgbe/adapter.h   Thu Jul 31 23:04:41 2014
(r269356)
@@ -254,8 +254,7 @@ struct cluster_metadata {
 
 struct fl_sdesc {
caddr_t cl;
-   uint8_t nimbuf; /* # of inline mbufs with ref on the cluster */
-   uint8_t nembuf; /* # of allocated mbufs with ref */
+   uint16_t nmbuf; /* # of driver originated mbufs with ref on cluster */
struct cluster_layout cll;
 };
 
@@ -852,6 +851,8 @@ void end_synchronized_op(struct adapter 
 
 /* t4_sge.c */
 void t4_sge_modload(void);
+void t4_sge_modunload(void);
+uint64_t t4_sge_extfree_refs(void);
 void t4_init_sge_cpl_handlers(struct adapter *);
 void t4_tweak_chip_settings(struct adapter *);
 int t4_read_chip_settings(struct adapter *);

Modified: stable/10/sys/dev/cxgbe/t4_main.c
==
--- stable/10/sys/dev/cxgbe/t4_main.c   Thu Jul 31 22:32:39 2014
(r269355)
+++ stable/10/sys/dev/cxgbe/t4_main.c   Thu Jul 31 23:04:41 2014
(r269356)
@@ -8090,6 +8090,9 @@ tweak_tunables(void)
t4_intr_types = INTR_MSIX | INTR_MSI | INTR_INTX;
 }
 
+static struct sx mlu;  /* mod load unload */
+SX_SYSINIT(cxgbe_mlu, mlu, cxgbe mod load/unload);
+
 static int
 mod_event(module_t mod, int cmd, void *arg)
 {
@@ -8098,41 +8101,67 @@ mod_event(module_t mod, int cmd, void *a
 
switch (cmd) {
case MOD_LOAD:
-   if (atomic_fetchadd_int(loaded, 1))
-   break;
-   t4_sge_modload();
-   sx_init(t4_list_lock, T4/T5 adapters);
-   SLIST_INIT(t4_list);
+   sx_xlock(mlu);
+   if (loaded++ == 0) {
+   t4_sge_modload();
+   sx_init(t4_list_lock, T4/T5 adapters);
+   SLIST_INIT(t4_list);
 #ifdef TCP_OFFLOAD
-   sx_init(t4_uld_list_lock, T4/T5 ULDs);
-   SLIST_INIT(t4_uld_list);
+   sx_init(t4_uld_list_lock, T4/T5 ULDs);
+   SLIST_INIT(t4_uld_list);
 #endif
-   t4_tracer_modload();
-   tweak_tunables();
+   t4_tracer_modload();
+   tweak_tunables();
+   }
+   sx_xunlock(mlu);
break;
 
case MOD_UNLOAD:
-   if (atomic_fetchadd_int(loaded, -1)  1)
-   break;
-   t4_tracer_modunload();
+   sx_xlock(mlu);
+   if (--loaded == 0) {
+   int tries;
+
+   sx_slock(t4_list_lock);
+   if (!SLIST_EMPTY(t4_list)) {
+   rc = EBUSY;
+   sx_sunlock(t4_list_lock);
+   goto done_unload;
+   }
+#ifdef TCP_OFFLOAD
+   sx_slock(t4_uld_list_lock);
+   if (!SLIST_EMPTY(t4_uld_list)) {
+   rc = EBUSY;
+   sx_sunlock(t4_uld_list_lock);
+   sx_sunlock(t4_list_lock);
+   goto done_unload;
+   }
+#endif
+   tries = 0;
+   while (tries++  5  t4_sge_extfree_refs() != 0) {
+   uprintf(%ju clusters with custom free routine 
+   still is use.\n, t4_sge_extfree_refs());
+   pause(t4unload, 2 * hz);
+   }
 #ifdef TCP_OFFLOAD
-   sx_slock(t4_uld_list_lock);
-   if (!SLIST_EMPTY(t4_uld_list)) {
-   rc = EBUSY;
sx_sunlock(t4_uld_list_lock);
-   break;
-   }
-   sx_sunlock(t4_uld_list_lock);
-   sx_destroy(t4_uld_list_lock);
 #endif
-   sx_slock(t4_list_lock);
-   if 

svn commit: r269357 - stable/10/tools/tools/cxgbetool

2014-07-31 Thread Navdeep Parhar
Author: np
Date: Thu Jul 31 23:09:22 2014
New Revision: 269357
URL: http://svnweb.freebsd.org/changeset/base/269357

Log:
  MFC r269106:
  
  Add a 'raw' parameter to the 'modinfo' subcommand.  This is handy when
  trying to figure out why a QSFP+/SFP+ connector or cable wasn't
  identified correctly by cxgbe(4).  Its output looks like this:
  
  # cxgbetool t5nex0 modinfo 0 raw
  00:  03 04 21 00  00 00 00 00  ..!. 
  08:  04 00 00 00  67 00 00 00   g...
  10:  00 00 05 00  41 6d 70 68   Amph
  18:  65 6e 6f 6c  20 20 20 20  enol
  20:  20 20 20 20  00 41 50 48   .APH
  28:  35 37 31 35  34 30 30 30  5715 4000
  30:  33 20 20 20  20 20 20 20  3
  38:  4b 20 20 20  01 00 00 fa  K
  40:  00 00 00 00  41 50 46 31   APF1
  48:  30 30 34 30  30 33 30 30  0040 0300
  50:  30 33 20 20  31 30 30 31  03   1001
  58:  33 30 20 20  00 00 00 97  30   

Modified:
  stable/10/tools/tools/cxgbetool/cxgbetool.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tools/tools/cxgbetool/cxgbetool.c
==
--- stable/10/tools/tools/cxgbetool/cxgbetool.c Thu Jul 31 23:04:41 2014
(r269356)
+++ stable/10/tools/tools/cxgbetool/cxgbetool.c Thu Jul 31 23:09:22 2014
(r269357)
@@ -95,7 +95,7 @@ usage(FILE *fp)
\ti2c port devaddr addr [len] read from i2c device\n
\tloadfw fw-image.bin   install firmware\n
\tmemdump addr lendump a memory range\n
-   \tmodinfo port  optics/cable information\n
+   \tmodinfo port [raw]optics/cable information\n
\treg address[=val]   read/write register\n
\treg64 address[=val] read/write 64 bit register\n
\tregdump [module] ...  dump registers\n
@@ -1873,6 +1873,41 @@ tracer_cmd(int argc, const char *argv[])
 }
 
 static int
+modinfo_raw(int port_id)
+{
+   uint8_t offset;
+   struct t4_i2c_data i2cd;
+   int rc;
+
+   for (offset = 0; offset  96; offset += sizeof(i2cd.data)) {
+   bzero(i2cd, sizeof(i2cd));
+   i2cd.port_id = port_id;
+   i2cd.dev_addr = 0xa0;
+   i2cd.offset = offset;
+   i2cd.len = sizeof(i2cd.data);
+   rc = doit(CHELSIO_T4_GET_I2C, i2cd);
+   if (rc != 0)
+   return (rc);
+   printf(%02x:  %02x %02x %02x %02x  %02x %02x %02x %02x,
+   offset, i2cd.data[0], i2cd.data[1], i2cd.data[2],
+   i2cd.data[3], i2cd.data[4], i2cd.data[5], i2cd.data[6],
+   i2cd.data[7]);
+
+   printf(  %c%c%c%c %c%c%c%c\n,
+   isprint(i2cd.data[0]) ? i2cd.data[0] : '.',
+   isprint(i2cd.data[1]) ? i2cd.data[1] : '.',
+   isprint(i2cd.data[2]) ? i2cd.data[2] : '.',
+   isprint(i2cd.data[3]) ? i2cd.data[3] : '.',
+   isprint(i2cd.data[4]) ? i2cd.data[4] : '.',
+   isprint(i2cd.data[5]) ? i2cd.data[5] : '.',
+   isprint(i2cd.data[6]) ? i2cd.data[6] : '.',
+   isprint(i2cd.data[7]) ? i2cd.data[7] : '.');
+   }
+
+   return (0);
+}
+
+static int
 modinfo(int argc, const char *argv[])
 {
long port;
@@ -1881,17 +1916,31 @@ modinfo(int argc, const char *argv[])
int rc, i;
uint16_t temp, vcc, tx_bias, tx_power, rx_power;
 
-   if (argc != 1) {
+   if (argc  1) {
warnx(must supply a port);
return (EINVAL);
}
 
+   if (argc  2) {
+   warnx(too many arguments);
+   return (EINVAL);
+   }
+
p = str_to_number(argv[0], port, NULL);
if (*p || port  UCHAR_MAX) {
warnx(invalid port id \%s\, argv[0]);
return (EINVAL);
}
 
+   if (argc == 2) {
+   if (!strcmp(argv[1], raw))
+   return (modinfo_raw(port));
+   else {
+   warnx(second argument can only be \raw\);
+   return (EINVAL);
+   }
+   }
+
bzero(i2cd, sizeof(i2cd));
i2cd.len = 1;
i2cd.port_id = port;
___
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: r269358 - stable/9/sys/dev/cxgbe

2014-07-31 Thread Navdeep Parhar
Author: np
Date: Thu Jul 31 23:14:59 2014
New Revision: 269358
URL: http://svnweb.freebsd.org/changeset/base/269358

Log:
  MFC r268971:
  Simplify r267600, there's no need to distinguish between allocated and
  inlined mbufs.

Modified:
  stable/9/sys/dev/cxgbe/adapter.h
  stable/9/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/cxgbe/adapter.h
==
--- stable/9/sys/dev/cxgbe/adapter.hThu Jul 31 23:09:22 2014
(r269357)
+++ stable/9/sys/dev/cxgbe/adapter.hThu Jul 31 23:14:59 2014
(r269358)
@@ -253,8 +253,7 @@ struct cluster_metadata {
 
 struct fl_sdesc {
caddr_t cl;
-   uint8_t nimbuf; /* # of inline mbufs with ref on the cluster */
-   uint8_t nembuf; /* # of allocated mbufs with ref */
+   uint16_t nmbuf; /* # of driver originated mbufs with ref on cluster */
struct cluster_layout cll;
 };
 

Modified: stable/9/sys/dev/cxgbe/t4_sge.c
==
--- stable/9/sys/dev/cxgbe/t4_sge.c Thu Jul 31 23:09:22 2014
(r269357)
+++ stable/9/sys/dev/cxgbe/t4_sge.c Thu Jul 31 23:14:59 2014
(r269358)
@@ -1469,7 +1469,7 @@ get_scatter_segment(struct adapter *sc, 
/* copy data to mbuf */
bcopy(payload, mtod(m, caddr_t), len);
 
-   } else if (sd-nimbuf * MSIZE  cll-region1) {
+   } else if (sd-nmbuf * MSIZE  cll-region1) {
 
/*
 * There's spare room in the cluster for an mbuf.  Create one
@@ -1477,14 +1477,14 @@ get_scatter_segment(struct adapter *sc, 
 */
 
MPASS(clm != NULL);
-   m = (struct mbuf *)(sd-cl + sd-nimbuf * MSIZE);
+   m = (struct mbuf *)(sd-cl + sd-nmbuf * MSIZE);
/* No bzero required */
if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, flags | M_NOFREE))
return (NULL);
fl-mbuf_inlined++;
m_extaddref(m, payload, padded_len, clm-refcount, rxb_free,
swz-zone, sd-cl);
-   sd-nimbuf++;
+   sd-nmbuf++;
 
} else {
 
@@ -1501,7 +1501,7 @@ get_scatter_segment(struct adapter *sc, 
if (clm != NULL) {
m_extaddref(m, payload, padded_len, clm-refcount,
rxb_free, swz-zone, sd-cl);
-   sd-nembuf++;
+   sd-nmbuf++;
} else {
m_cljset(m, sd-cl, swz-type);
sd-cl = NULL;  /* consumed, not a recycle candidate */
@@ -3026,7 +3026,7 @@ refill_fl(struct adapter *sc, struct sge
 
if (sd-cl != NULL) {
 
-   if (sd-nimbuf + sd-nembuf == 0) {
+   if (sd-nmbuf == 0) {
/*
 * Fast recycle without involving any atomics on
 * the cluster's metadata (if the cluster has
@@ -3085,8 +3085,7 @@ recycled:
 #endif
clm-refcount = 1;
}
-   sd-nimbuf = 0;
-   sd-nembuf = 0;
+   sd-nmbuf = 0;
 recycled_fast:
fl-pending++;
fl-needed--;
@@ -3155,7 +3154,7 @@ free_fl_sdesc(struct adapter *sc, struct
 
cll = sd-cll;
clm = cl_metadata(sc, fl, cll, sd-cl);
-   if (sd-nimbuf + sd-nembuf == 0 ||
+   if (sd-nmbuf == 0 ||
(clm  atomic_fetchadd_int(clm-refcount, -1) == 1)) {
uma_zfree(sc-sge.sw_zone_info[cll-zidx].zone, sd-cl);
}
___
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: r269359 - stable/9/tools/tools/cxgbetool

2014-07-31 Thread Navdeep Parhar
Author: np
Date: Thu Jul 31 23:17:59 2014
New Revision: 269359
URL: http://svnweb.freebsd.org/changeset/base/269359

Log:
  MFC r269106:
  Add a 'raw' parameter to the 'modinfo' subcommand.  This is handy when
  trying to figure out why a QSFP+/SFP+ connector or cable wasn't
  identified correctly by cxgbe(4).  Its output looks like this:
  
  # cxgbetool t5nex0 modinfo 0 raw
  00:  03 04 21 00  00 00 00 00  ..!. 
  08:  04 00 00 00  67 00 00 00   g...
  10:  00 00 05 00  41 6d 70 68   Amph
  18:  65 6e 6f 6c  20 20 20 20  enol
  20:  20 20 20 20  00 41 50 48   .APH
  28:  35 37 31 35  34 30 30 30  5715 4000
  30:  33 20 20 20  20 20 20 20  3
  38:  4b 20 20 20  01 00 00 fa  K
  40:  00 00 00 00  41 50 46 31   APF1
  48:  30 30 34 30  30 33 30 30  0040 0300
  50:  30 33 20 20  31 30 30 31  03   1001
  58:  33 30 20 20  00 00 00 97  30   

Modified:
  stable/9/tools/tools/cxgbetool/cxgbetool.c
Directory Properties:
  stable/9/tools/tools/cxgbetool/   (props changed)

Modified: stable/9/tools/tools/cxgbetool/cxgbetool.c
==
--- stable/9/tools/tools/cxgbetool/cxgbetool.c  Thu Jul 31 23:14:59 2014
(r269358)
+++ stable/9/tools/tools/cxgbetool/cxgbetool.c  Thu Jul 31 23:17:59 2014
(r269359)
@@ -95,7 +95,7 @@ usage(FILE *fp)
\ti2c port devaddr addr [len] read from i2c device\n
\tloadfw fw-image.bin   install firmware\n
\tmemdump addr lendump a memory range\n
-   \tmodinfo port  optics/cable information\n
+   \tmodinfo port [raw]optics/cable information\n
\treg address[=val]   read/write register\n
\treg64 address[=val] read/write 64 bit register\n
\tregdump [module] ...  dump registers\n
@@ -1673,6 +1673,41 @@ clearstats(int argc, const char *argv[])
 }
 
 static int
+modinfo_raw(int port_id)
+{
+   uint8_t offset;
+   struct t4_i2c_data i2cd;
+   int rc;
+
+   for (offset = 0; offset  96; offset += sizeof(i2cd.data)) {
+   bzero(i2cd, sizeof(i2cd));
+   i2cd.port_id = port_id;
+   i2cd.dev_addr = 0xa0;
+   i2cd.offset = offset;
+   i2cd.len = sizeof(i2cd.data);
+   rc = doit(CHELSIO_T4_GET_I2C, i2cd);
+   if (rc != 0)
+   return (rc);
+   printf(%02x:  %02x %02x %02x %02x  %02x %02x %02x %02x,
+   offset, i2cd.data[0], i2cd.data[1], i2cd.data[2],
+   i2cd.data[3], i2cd.data[4], i2cd.data[5], i2cd.data[6],
+   i2cd.data[7]);
+
+   printf(  %c%c%c%c %c%c%c%c\n,
+   isprint(i2cd.data[0]) ? i2cd.data[0] : '.',
+   isprint(i2cd.data[1]) ? i2cd.data[1] : '.',
+   isprint(i2cd.data[2]) ? i2cd.data[2] : '.',
+   isprint(i2cd.data[3]) ? i2cd.data[3] : '.',
+   isprint(i2cd.data[4]) ? i2cd.data[4] : '.',
+   isprint(i2cd.data[5]) ? i2cd.data[5] : '.',
+   isprint(i2cd.data[6]) ? i2cd.data[6] : '.',
+   isprint(i2cd.data[7]) ? i2cd.data[7] : '.');
+   }
+
+   return (0);
+}
+
+static int
 modinfo(int argc, const char *argv[])
 {
long port;
@@ -1681,17 +1716,31 @@ modinfo(int argc, const char *argv[])
int rc, i;
uint16_t temp, vcc, tx_bias, tx_power, rx_power;
 
-   if (argc != 1) {
+   if (argc  1) {
warnx(must supply a port);
return (EINVAL);
}
 
+   if (argc  2) {
+   warnx(too many arguments);
+   return (EINVAL);
+   }
+
p = str_to_number(argv[0], port, NULL);
if (*p || port  UCHAR_MAX) {
warnx(invalid port id \%s\, argv[0]);
return (EINVAL);
}
 
+   if (argc == 2) {
+   if (!strcmp(argv[1], raw))
+   return (modinfo_raw(port));
+   else {
+   warnx(second argument can only be \raw\);
+   return (EINVAL);
+   }
+   }
+
bzero(i2cd, sizeof(i2cd));
i2cd.len = 1;
i2cd.port_id = port;
___
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: r269360 - head/cddl/contrib/dtracetoolkit/Apps

2014-07-31 Thread George V. Neville-Neil
Author: gnn
Date: Thu Jul 31 23:19:01 2014
New Revision: 269360
URL: http://svnweb.freebsd.org/changeset/base/269360

Log:
  Update shellsnoop to work on FreeBSD.
  
  Contributed by: skreuzer

Modified:
  head/cddl/contrib/dtracetoolkit/Apps/shellsnoop

Modified: head/cddl/contrib/dtracetoolkit/Apps/shellsnoop
==
--- head/cddl/contrib/dtracetoolkit/Apps/shellsnoop Thu Jul 31 23:17:59 
2014(r269359)
+++ head/cddl/contrib/dtracetoolkit/Apps/shellsnoop Thu Jul 31 23:19:01 
2014(r269360)
@@ -1,4 +1,4 @@
-#!/usr/bin/sh
+#!/bin/sh
 #
 # shellsnoop - A program to print read/write details from shells,
 # such as keystrokes and command outputs.
@@ -140,18 +140,14 @@ dtrace -n '
  /*
   * Remember this PID is a shell child
   */
- syscall::exec:entry, syscall::exece:entry
+ syscall::execve:entry
  /execname == sh   || execname == ksh  || execname == csh  || 
   execname == tcsh || execname == zsh  || execname == bash/
  {
child[pid] = 1;
  
-   /* debug */
-   this-parent = (char *)curthread-t_procp-p_parent-p_user.u_comm;
-   OPT_debug == 1 ? printf(PID %d CMD %s started. (%s)\n,
-   pid, execname, stringof(this-parent)) : 1;
  }
- syscall::exec:entry, syscall::exece:entry
+ syscall::execve:entry
  /(OPT_pid == 1  PID != ppid) || (OPT_uid == 1  UID != uid)/
  {
/* forget if filtered */
@@ -256,12 +252,12 @@ dtrace -n '
  /*
   *  Cleanup
   */
- syscall::rexit:entry
+ syscall::exit:entry
  {
child[pid] = 0;
 
/* debug */
-   this-parent = (char *)curthread-t_procp-p_parent-p_user.u_comm;
+   this-parent = (char *)curthread-td_proc-p_pptr-p_comm;
OPT_debug == 1 ? printf(PID %d CMD %s exited. (%s)\n,
 pid, execname, stringof(this-parent)) : 1;
  }
___
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: r269361 - in head: lib/libstand sys/boot/libstand32

2014-07-31 Thread Marcel Moolenaar
Author: marcel
Date: Thu Jul 31 23:25:13 2014
New Revision: 269361
URL: http://svnweb.freebsd.org/changeset/base/269361

Log:
  Add pkgfs, a file system implementation for reading files out of a
  compressed tarball, aka package. The file system assumes that the
  files are layed-out in the same order as needed to allow for the
  package to be streamed. As such, it does not read an entire package
  into memory first.
  
  Some properties of the file system:
  o   Files that start with '+' are silently skipped. These are found
  in FreeBSD package files.
  o   Files smaller than or equal to 4KB will be cached in memory and
  as such allow for some flexibility in accessing files out of
  order.
  o   Files with the .tgz suffix are assumed to be (sub-)packages and
  signal the end for a directory scan.
  
  Obtained from:Juniper Networks, Inc.

Added:
  head/lib/libstand/pkgfs.c   (contents, props changed)
Modified:
  head/lib/libstand/Makefile
  head/lib/libstand/stand.h
  head/sys/boot/libstand32/Makefile

Modified: head/lib/libstand/Makefile
==
--- head/lib/libstand/Makefile  Thu Jul 31 23:19:01 2014(r269360)
+++ head/lib/libstand/Makefile  Thu Jul 31 23:25:13 2014(r269361)
@@ -161,6 +161,7 @@ SRCS+=  bootp.c rarp.c bootparam.c
 SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c
 SRCS+= dosfs.c ext2fs.c
 SRCS+= splitfs.c
+SRCS+= pkgfs.c
 .if ${MK_NAND} != no
 SRCS+= nandfs.c
 .endif

Added: head/lib/libstand/pkgfs.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libstand/pkgfs.c   Thu Jul 31 23:25:13 2014(r269361)
@@ -0,0 +1,791 @@
+/*- 
+ * Copyright (c) 2007-2014, Juniper Networks, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include stand.h
+
+#include sys/stat.h
+#include sys/stdint.h
+#include string.h
+#include zlib.h
+
+#ifdef PKGFS_DEBUG
+#defineDBG(x)  printf x
+#else
+#defineDBG(x)
+#endif
+
+static int   pkg_open(const char *, struct open_file *);
+static int   pkg_close(struct open_file *);
+static int   pkg_read(struct open_file *, void *, size_t, size_t *);
+static off_t pkg_seek(struct open_file *, off_t, int);
+static int   pkg_stat(struct open_file *, struct stat *);
+static int   pkg_readdir(struct open_file *, struct dirent *);
+
+struct fs_ops pkgfs_fsops = {
+   pkg,
+   pkg_open, 
+   pkg_close, 
+   pkg_read,
+   null_write,
+   pkg_seek,
+   pkg_stat,
+   pkg_readdir
+};
+
+#define PKG_BUFSIZE512
+#definePKG_MAXCACHESZ  4096
+
+#definePKG_FILEEXT .tgz
+
+/*
+ * Layout of POSIX 'ustar' header.
+ */
+struct ustar_hdr {
+   charut_name[100];
+   charut_mode[8];
+   charut_uid[8];
+   charut_gid[8];
+   charut_size[12];
+   charut_mtime[12];
+   charut_checksum[8];
+   charut_typeflag[1];
+   charut_linkname[100];
+   charut_magic[6];/* For POSIX: ustar\0 */
+   charut_version[2];  /* For POSIX: 00 */
+   charut_uname[32];
+   charut_gname[32];
+   charut_rdevmajor[8];
+   charut_rdevminor[8];
+   union {
+   struct {
+   charprefix[155];
+   } posix;
+   struct {
+   charatime[12];
+   charctime[12];
+   charoffset[12];
+   charlongnames[4];
+ 

svn commit: r269363 - head/tools/tools/nanobsd

2014-07-31 Thread Warner Losh
Author: imp
Date: Fri Aug  1 00:00:54 2014
New Revision: 269363
URL: http://svnweb.freebsd.org/changeset/base/269363

Log:
  NANO_OBJ shouldn't end with a '/', so remove it here. This makes the
  pathnames printed not have the dreaded // which makes it hard to cut
  and paste into an emacs find file command...
  
  MFC After: 3 days

Modified:
  head/tools/tools/nanobsd/nanobsd.sh

Modified: head/tools/tools/nanobsd/nanobsd.sh
==
--- head/tools/tools/nanobsd/nanobsd.sh Fri Aug  1 00:00:46 2014
(r269362)
+++ head/tools/tools/nanobsd/nanobsd.sh Fri Aug  1 00:00:54 2014
(r269363)
@@ -992,7 +992,7 @@ trap nano_cleanup EXIT
 ###
 # Setup and Export Internal variables
 #
-test -n ${NANO_OBJ} || NANO_OBJ=/usr/obj/nanobsd.${NANO_NAME}/
+test -n ${NANO_OBJ} || NANO_OBJ=/usr/obj/nanobsd.${NANO_NAME}
 test -n ${MAKEOBJDIRPREFIX} || MAKEOBJDIRPREFIX=${NANO_OBJ}
 test -n ${NANO_DISKIMGDIR} || NANO_DISKIMGDIR=${NANO_OBJ}
 
___
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: r269362 - head/tools/tools/nanobsd

2014-07-31 Thread Warner Losh
Author: imp
Date: Fri Aug  1 00:00:46 2014
New Revision: 269362
URL: http://svnweb.freebsd.org/changeset/base/269362

Log:
  Use rm -x only on FreeBSD 10 and newer. Many people still build from
  older hosts, which still works, so don't break that gratuitously.
  
  MFC After: 3 days

Modified:
  head/tools/tools/nanobsd/nanobsd.sh

Modified: head/tools/tools/nanobsd/nanobsd.sh
==
--- head/tools/tools/nanobsd/nanobsd.sh Thu Jul 31 23:25:13 2014
(r269361)
+++ head/tools/tools/nanobsd/nanobsd.sh Fri Aug  1 00:00:46 2014
(r269362)
@@ -178,6 +178,15 @@ SRCCONF=${SRCCONF:=/dev/null}
 #
 ###
 
+# rm doesn't know -x prior to FreeBSD 10, so cope with a variety of build
+# hosts for now.
+nano_rm ( ) {
+   case $(uname -r) in
+   7*|8*|9*) rm $* ;;
+   *) rm -x $* ;;
+   esac
+}
+
 # run in the world chroot, errors fatal
 CR()
 {
@@ -200,9 +209,9 @@ nano_cleanup ( ) (
 clean_build ( ) (
pprint 2 Clean and create object directory (${MAKEOBJDIRPREFIX})
 
-   if ! rm -xrf ${MAKEOBJDIRPREFIX}/  /dev/null 21 ; then
+   if ! nano_rm -rf ${MAKEOBJDIRPREFIX}/  /dev/null 21 ; then
chflags -R noschg ${MAKEOBJDIRPREFIX}/
-   rm -xr ${MAKEOBJDIRPREFIX}/
+   nano_rm -r ${MAKEOBJDIRPREFIX}/
fi
mkdir -p ${MAKEOBJDIRPREFIX}
printenv  ${MAKEOBJDIRPREFIX}/_.env
@@ -256,17 +265,17 @@ build_kernel ( ) (
 clean_world ( ) (
if [ ${NANO_OBJ} != ${MAKEOBJDIRPREFIX} ]; then
pprint 2 Clean and create object directory (${NANO_OBJ})
-   if ! rm -rxf ${NANO_OBJ}/  /dev/null 21 ; then
+   if ! nano_rm -rf ${NANO_OBJ}/  /dev/null 21 ; then
chflags -R noschg ${NANO_OBJ}
-   rm -xr ${NANO_OBJ}/
+   nano_rm -r ${NANO_OBJ}/
fi
mkdir -p ${NANO_OBJ} ${NANO_WORLDDIR}
printenv  ${NANO_OBJ}/_.env
else
pprint 2 Clean and create world directory (${NANO_WORLDDIR})
-   if ! rm -rxf ${NANO_WORLDDIR}/  /dev/null 21 ; then
+   if ! nano_rm -rf ${NANO_WORLDDIR}/  /dev/null 21 ; then
chflags -R noschg ${NANO_WORLDDIR}
-   rm -rxf ${NANO_WORLDDIR}/
+   nano_rm -rf ${NANO_WORLDDIR}/
fi
mkdir -p ${NANO_WORLDDIR}
fi
@@ -378,7 +387,7 @@ setup_nanobsd ( ) (
cd usr/local/etc
find . -print | cpio -dumpl ../../../etc/local
cd ..
-   rm -rf etc
+   nano_rm -rf etc
ln -s ../../etc/local etc
)
fi
@@ -400,7 +409,7 @@ setup_nanobsd ( ) (
echo mount -o ro /dev/${NANO_DRIVE}s3  conf/default/etc/remount
 
# Put /tmp on the /var ramdisk (could be symlink already)
-   test -d tmp  rmdir tmp || rm -f tmp
+   test -d tmp  rmdir tmp || nano_rm -f tmp
ln -s var/tmp tmp
 
)  ${NANO_OBJ}/_.dl 21
@@ -560,7 +569,7 @@ create_i386_diskimage ( ) (
-y ${NANO_HEADS}`
else
echo Creating md backing file...
-   rm -f ${IMG}
+   nano_rm -f ${IMG}
dd if=/dev/zero of=${IMG} seek=${NANO_MEDIASIZE} count=0
MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \
-y ${NANO_HEADS}`
@@ -785,7 +794,7 @@ cust_pkg () (
exit 2
fi
done
-   rm -rxf ${NANO_WORLDDIR}/Pkg
+   nano_rm -rf ${NANO_WORLDDIR}/Pkg
 )
 
 cust_pkgng () (
@@ -820,7 +829,7 @@ cust_pkgng () (
echo FAILED: pkg bootstrapping faied
exit 2
fi
-   rm -f ${NANO_WORLDDIR}/Pkg/pkg-*
+   nano_rm -f ${NANO_WORLDDIR}/Pkg/pkg-*
 
# Count  report how many we have to install
todo=`ls ${NANO_WORLDDIR}/Pkg | /usr/bin/wc -l`
@@ -849,7 +858,7 @@ cust_pkgng () (
exit 2
fi
done
-   rm -rxf ${NANO_WORLDDIR}/Pkg
+   nano_rm -rf ${NANO_WORLDDIR}/Pkg
 )
 
 ###
___
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: r269319 - head/sys/dev/usb/net

2014-07-31 Thread Bjoern A. Zeeb

On 31 Jul 2014, at 03:34 , Kevin Lo ke...@freebsd.org wrote:

 Author: kevlo
 Date: Thu Jul 31 03:34:25 2014
 New Revision: 269319
 URL: http://svnweb.freebsd.org/changeset/base/269319
 
 Log:
  In copyright statement correct that the author is me, not Bill Paul.

And you still hear the voices in his (now your) head?   If this is not 
intentional either /usr/share/examples/etc/bsd-style-copyright is probably what 
you are looking for.

We should really stop copying and pasting license from one file to another and 
copying and pasting network drivers around . . .


 
 Modified:
  head/sys/dev/usb/net/if_axgereg.h
 
 Modified: head/sys/dev/usb/net/if_axgereg.h
 ==
 --- head/sys/dev/usb/net/if_axgereg.h Thu Jul 31 02:07:48 2014
 (r269318)
 +++ head/sys/dev/usb/net/if_axgereg.h Thu Jul 31 03:34:25 2014
 (r269319)
 @@ -11,10 +11,10 @@
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
  *
 - * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 - * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
 + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD
  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 

— 
Bjoern A. Zeeb Come on. Learn, goddamn it., WarGames, 1983

___
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: r269364 - in head/sys/modules/cxgbe: . if_cxgbe iw_cxgbe t4_firmware t5_firmware tom

2014-07-31 Thread Navdeep Parhar
Author: np
Date: Fri Aug  1 01:30:16 2014
New Revision: 269364
URL: http://svnweb.freebsd.org/changeset/base/269364

Log:
  Improve compliance with style.Makefile(5).
  
  MFC after:2 weeks

Modified:
  head/sys/modules/cxgbe/Makefile
  head/sys/modules/cxgbe/if_cxgbe/Makefile
  head/sys/modules/cxgbe/iw_cxgbe/Makefile
  head/sys/modules/cxgbe/t4_firmware/Makefile
  head/sys/modules/cxgbe/t5_firmware/Makefile
  head/sys/modules/cxgbe/tom/Makefile

Modified: head/sys/modules/cxgbe/Makefile
==
--- head/sys/modules/cxgbe/Makefile Fri Aug  1 00:00:54 2014
(r269363)
+++ head/sys/modules/cxgbe/Makefile Fri Aug  1 01:30:16 2014
(r269364)
@@ -4,21 +4,21 @@
 
 .include src.opts.mk
 
-SUBDIR = if_cxgbe
-SUBDIR+= t4_firmware
-SUBDIR+= t5_firmware
-SUBDIR+= ${_tom}
-SUBDIR+= ${_iw_cxgbe}
+SUBDIR=if_cxgbe
+SUBDIR+=   t4_firmware
+SUBDIR+=   t5_firmware
+SUBDIR+=   ${_tom}
+SUBDIR+=   ${_iw_cxgbe}
 
 .if ${MACHINE_CPUARCH} == amd64
-_tom=  tom
+_tom=  tom
 .if ${MK_OFED} != no || defined(ALL_MODULES)
 _iw_cxgbe= iw_cxgbe
 .endif
 .endif
 
 .if ${MACHINE_CPUARCH} == i386
-_tom=  tom
+_tom=  tom
 .endif
 
 .include bsd.subdir.mk

Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile
==
--- head/sys/modules/cxgbe/if_cxgbe/MakefileFri Aug  1 00:00:54 2014
(r269363)
+++ head/sys/modules/cxgbe/if_cxgbe/MakefileFri Aug  1 01:30:16 2014
(r269364)
@@ -4,21 +4,22 @@
 
 .include src.opts.mk
 
-CXGBE = ${.CURDIR}/../../../dev/cxgbe
+CXGBE= ${.CURDIR}/../../../dev/cxgbe
 .PATH: ${CXGBE} ${CXGBE}/common
 
-KMOD = if_cxgbe
-SRCS = t4_main.c t4_sge.c t4_l2t.c t4_tracer.c t4_netmap.c
-SRCS+= t4_hw.c
-SRCS+= device_if.h bus_if.h pci_if.h
-SRCS+= opt_inet.h opt_inet6.h
-SRCS+= opt_ofed.h
-
-CFLAGS+= -I${CXGBE}
+KMOD=  if_cxgbe
+SRCS=  t4_main.c t4_sge.c t4_l2t.c t4_tracer.c t4_netmap.c
+SRCS+= t4_hw.c
+SRCS+= device_if.h bus_if.h pci_if.h
+SRCS+= opt_inet.h opt_inet6.h
+SRCS+= opt_ofed.h
 
 # Provide the timestamp of a packet in its header mbuf.
 #CFLAGS+= -DT4_PKT_TIMESTAMP
 
+CFLAGS+= -I${CXGBE}
+
+
 .if !defined(KERNBUILDDIR)
 .if ${MK_INET_SUPPORT} != no
 opt_inet.h:

Modified: head/sys/modules/cxgbe/iw_cxgbe/Makefile
==
--- head/sys/modules/cxgbe/iw_cxgbe/MakefileFri Aug  1 00:00:54 2014
(r269363)
+++ head/sys/modules/cxgbe/iw_cxgbe/MakefileFri Aug  1 01:30:16 2014
(r269364)
@@ -2,13 +2,13 @@
 
 .include src.opts.mk
 
-CXGBE = ${.CURDIR}/../../../dev/cxgbe
+CXGBE= ${.CURDIR}/../../../dev/cxgbe
 .PATH: ${CXGBE}/iw_cxgbe
 
-KMOD=   iw_cxgbe
-SRCS=   device.c cm.c provider.c mem.c cq.c qp.c resource.c ev.c id_table.c
-SRCS+=  bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h opt_ktr.h
-SRCS+=  opt_inet.h opt_ofed.h vnode_if.h
+KMOD=  iw_cxgbe
+SRCS=  device.c cm.c provider.c mem.c cq.c qp.c resource.c ev.c id_table.c
+SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h opt_ktr.h
+SRCS+= opt_inet.h opt_ofed.h vnode_if.h
 CFLAGS+= -I${CXGBE} -I${.CURDIR}/../../../ofed/include -DLINUX_TYPES_DEFINED
 
 .if !defined(KERNBUILDDIR)

Modified: head/sys/modules/cxgbe/t4_firmware/Makefile
==
--- head/sys/modules/cxgbe/t4_firmware/Makefile Fri Aug  1 00:00:54 2014
(r269363)
+++ head/sys/modules/cxgbe/t4_firmware/Makefile Fri Aug  1 01:30:16 2014
(r269364)
@@ -2,24 +2,24 @@
 # $FreeBSD$
 #
 
-T4FW = ${.CURDIR}/../../../dev/cxgbe/firmware
+T4FW=  ${.CURDIR}/../../../dev/cxgbe/firmware
 .PATH: ${T4FW}
 
-KMOD = t4fw_cfg
-FIRMWS = ${KMOD}.txt:${KMOD}:1.0.0.0
+KMOD=  t4fw_cfg
+FIRMWS=${KMOD}.txt:${KMOD}:1.0.0.0
 
 # You can have additional configuration files in the ${T4FW} directory.
 # t4fw_cfg_name.txt
 CFG_FILES != cd ${T4FW}  echo ${KMOD}_*.txt
 .for F in ${CFG_FILES}
 .if exists(${F})
-FIRMWS += ${F}:${F:C/.txt//}:1.0.0.0
+FIRMWS+=   ${F}:${F:C/.txt//}:1.0.0.0
 .endif
 .endfor
 
-T4FW_VER = 1.11.27.0
-FIRMWS += t4fw.fw:t4fw:${T4FW_VER}
-CLEANFILES += t4fw.fw
+T4FW_VER=  1.11.27.0
+FIRMWS+=   t4fw.fw:t4fw:${T4FW_VER}
+CLEANFILES+=   t4fw.fw
 
 t4fw.fw: t4fw-${T4FW_VER}.bin.uu
uudecode -o ${.TARGET} ${.ALLSRC}

Modified: head/sys/modules/cxgbe/t5_firmware/Makefile
==
--- head/sys/modules/cxgbe/t5_firmware/Makefile Fri Aug  1 00:00:54 2014
(r269363)
+++ head/sys/modules/cxgbe/t5_firmware/Makefile Fri Aug  1 01:30:16 2014
(r269364)
@@ -2,24 +2,24 @@
 # $FreeBSD$
 #
 
-T5FW = ${.CURDIR}/../../../dev/cxgbe/firmware
+T5FW=  ${.CURDIR}/../../../dev/cxgbe/firmware
 .PATH: ${T5FW}
 
-KMOD = t5fw_cfg
-FIRMWS = ${KMOD}.txt:${KMOD}:1.0.0.0
+KMOD=  t5fw_cfg
+FIRMWS=${KMOD}.txt:${KMOD}:1.0.0.0
 
 

svn commit: r269365 - head/sys/powerpc/aim

2014-07-31 Thread Alan Cox
Author: alc
Date: Fri Aug  1 01:48:41 2014
New Revision: 269365
URL: http://svnweb.freebsd.org/changeset/base/269365

Log:
  Correct a long-standing problem in moea{,64}_pvo_enter() that was revealed
  by the combination of r268591 and r269134: When we attempt to add the
  wired attribute to an existing mapping, moea{,64}_pvo_enter() do nothing.
  (They only set the wired attribute on newly created mappings.)
  
  Tested by:andreast

Modified:
  head/sys/powerpc/aim/mmu_oea.c
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea.c
==
--- head/sys/powerpc/aim/mmu_oea.c  Fri Aug  1 01:30:16 2014
(r269364)
+++ head/sys/powerpc/aim/mmu_oea.c  Fri Aug  1 01:48:41 2014
(r269365)
@@ -1951,7 +1951,21 @@ moea_pvo_enter(pmap_t pm, uma_zone_t zon
if ((pvo-pvo_pte.pte.pte_lo  PTE_RPGN) == pa 
(pvo-pvo_pte.pte.pte_lo  PTE_PP) ==
(pte_lo  PTE_PP)) {
+   /*
+* The PTE is not changing.  Instead, this may
+* be a request to change the mapping's wired
+* attribute.
+*/
mtx_unlock(moea_table_mutex);
+   if ((flags  PVO_WIRED) != 0 
+   (pvo-pvo_vaddr  PVO_WIRED) == 0) {
+   pvo-pvo_vaddr |= PVO_WIRED;
+   pm-pm_stats.wired_count++;
+   } else if ((flags  PVO_WIRED) == 0 
+   (pvo-pvo_vaddr  PVO_WIRED) != 0) {
+   pvo-pvo_vaddr = ~PVO_WIRED;
+   pm-pm_stats.wired_count--;
+   }
return (0);
}
moea_pvo_remove(pvo, -1);

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cFri Aug  1 01:30:16 2014
(r269364)
+++ head/sys/powerpc/aim/mmu_oea64.cFri Aug  1 01:48:41 2014
(r269365)
@@ -2234,6 +2234,7 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm, u
 uint64_t pte_lo, int flags)
 {
struct   pvo_entry *pvo;
+   uintptr_t pt;
uint64_t vsid;
int  first;
u_intptegidx;
@@ -2276,13 +2277,42 @@ moea64_pvo_enter(mmu_t mmu, pmap_t pm, u
if ((pvo-pvo_pte.lpte.pte_lo  LPTE_RPGN) == pa 
(pvo-pvo_pte.lpte.pte_lo  (LPTE_NOEXEC | LPTE_PP))
== (pte_lo  (LPTE_NOEXEC | LPTE_PP))) {
+   /*
+* The physical page and protection are not
+* changing.  Instead, this may be a request
+* to change the mapping's wired attribute.
+*/
+   pt = -1;
+   if ((flags  PVO_WIRED) != 0 
+   (pvo-pvo_vaddr  PVO_WIRED) == 0) {
+   pt = MOEA64_PVO_TO_PTE(mmu, pvo);
+   pvo-pvo_vaddr |= PVO_WIRED;
+   pvo-pvo_pte.lpte.pte_hi |= LPTE_WIRED;
+   pm-pm_stats.wired_count++;
+   } else if ((flags  PVO_WIRED) == 0 
+   (pvo-pvo_vaddr  PVO_WIRED) != 0) {
+   pt = MOEA64_PVO_TO_PTE(mmu, pvo);
+   pvo-pvo_vaddr = ~PVO_WIRED;
+   pvo-pvo_pte.lpte.pte_hi = ~LPTE_WIRED;
+   pm-pm_stats.wired_count--;
+   }
if (!(pvo-pvo_pte.lpte.pte_hi  LPTE_VALID)) {
+   KASSERT(pt == -1,
+   (moea64_pvo_enter: valid pt));
/* Re-insert if spilled */
i = MOEA64_PTE_INSERT(mmu, ptegidx,
pvo-pvo_pte.lpte);
if (i = 0)
PVO_PTEGIDX_SET(pvo, i);
moea64_pte_overflow--;
+   } else if (pt != -1) {
+   /*
+* The PTE's wired attribute is not a
+* hardware feature, so there is no
+

svn commit: r269366 - in head/sys/modules/cxgbe: if_cxgbe iw_cxgbe tom

2014-07-31 Thread Navdeep Parhar
Author: np
Date: Fri Aug  1 01:53:39 2014
New Revision: 269366
URL: http://svnweb.freebsd.org/changeset/base/269366

Log:
  List one file per line in the Makefiles.  This makes it easier to read
  diffs when a file is added or removed.
  
  MFC after:2 weeks

Modified:
  head/sys/modules/cxgbe/if_cxgbe/Makefile
  head/sys/modules/cxgbe/iw_cxgbe/Makefile
  head/sys/modules/cxgbe/tom/Makefile

Modified: head/sys/modules/cxgbe/if_cxgbe/Makefile
==
--- head/sys/modules/cxgbe/if_cxgbe/MakefileFri Aug  1 01:48:41 2014
(r269365)
+++ head/sys/modules/cxgbe/if_cxgbe/MakefileFri Aug  1 01:53:39 2014
(r269366)
@@ -8,18 +8,24 @@ CXGBE=${.CURDIR}/../../../dev/cxgbe
 .PATH: ${CXGBE} ${CXGBE}/common
 
 KMOD=  if_cxgbe
-SRCS=  t4_main.c t4_sge.c t4_l2t.c t4_tracer.c t4_netmap.c
-SRCS+= t4_hw.c
-SRCS+= device_if.h bus_if.h pci_if.h
-SRCS+= opt_inet.h opt_inet6.h
+SRCS=  bus_if.h
+SRCS+= device_if.h
+SRCS+= opt_inet.h
+SRCS+= opt_inet6.h
 SRCS+= opt_ofed.h
+SRCS+= pci_if.h
+SRCS+= t4_hw.c
+SRCS+= t4_l2t.c
+SRCS+= t4_main.c
+SRCS+= t4_netmap.c
+SRCS+= t4_sge.c
+SRCS+= t4_tracer.c
 
 # Provide the timestamp of a packet in its header mbuf.
 #CFLAGS+= -DT4_PKT_TIMESTAMP
 
 CFLAGS+= -I${CXGBE}
 
-
 .if !defined(KERNBUILDDIR)
 .if ${MK_INET_SUPPORT} != no
 opt_inet.h:

Modified: head/sys/modules/cxgbe/iw_cxgbe/Makefile
==
--- head/sys/modules/cxgbe/iw_cxgbe/MakefileFri Aug  1 01:48:41 2014
(r269365)
+++ head/sys/modules/cxgbe/iw_cxgbe/MakefileFri Aug  1 01:53:39 2014
(r269366)
@@ -6,9 +6,25 @@ CXGBE= ${.CURDIR}/../../../dev/cxgbe
 .PATH: ${CXGBE}/iw_cxgbe
 
 KMOD=  iw_cxgbe
-SRCS=  device.c cm.c provider.c mem.c cq.c qp.c resource.c ev.c id_table.c
-SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h opt_ktr.h
-SRCS+= opt_inet.h opt_ofed.h vnode_if.h
+SRCS=  bus_if.h
+SRCS+= cm.c
+SRCS+= cq.c
+SRCS+= device.c
+SRCS+= device_if.h
+SRCS+= ev.c
+SRCS+= id_table.c
+SRCS+= mem.c
+SRCS+= opt_inet.h
+SRCS+= opt_ktr.h
+SRCS+= opt_ofed.h
+SRCS+= opt_sched.h
+SRCS+= pci_if.h
+SRCS+= pcib_if.h
+SRCS+= provider.c
+SRCS+= qp.c
+SRCS+= resource.c
+SRCS+= vnode_if.h
+
 CFLAGS+= -I${CXGBE} -I${.CURDIR}/../../../ofed/include -DLINUX_TYPES_DEFINED
 
 .if !defined(KERNBUILDDIR)

Modified: head/sys/modules/cxgbe/tom/Makefile
==
--- head/sys/modules/cxgbe/tom/Makefile Fri Aug  1 01:48:41 2014
(r269365)
+++ head/sys/modules/cxgbe/tom/Makefile Fri Aug  1 01:53:39 2014
(r269366)
@@ -8,9 +8,17 @@ CXGBE= ${.CURDIR}/../../../dev/cxgbe
 .PATH: ${CXGBE}/tom
 
 KMOD=  t4_tom
-SRCS=  t4_tom.c t4_connect.c t4_listen.c t4_cpl_io.c t4_tom_l2t.c t4_ddp.c
-SRCS+= device_if.h bus_if.h pci_if.h
-SRCS+= opt_inet.h opt_inet6.h
+SRCS=  bus_if.h
+SRCS+= device_if.h
+SRCS+= opt_inet.h
+SRCS+= opt_inet6.h
+SRCS+= pci_if.h
+SRCS+= t4_connect.c
+SRCS+= t4_cpl_io.c
+SRCS+= t4_ddp.c
+SRCS+= t4_listen.c
+SRCS+= t4_tom.c
+SRCS+= t4_tom_l2t.c
 
 CFLAGS+= -I${CXGBE}
 
___
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: r269319 - head/sys/dev/usb/net

2014-07-31 Thread Kevin Lo
On Fri, Aug 01, 2014 at 12:37:06AM +, Bjoern A. Zeeb wrote:
 
 
 On 31 Jul 2014, at 03:34 , Kevin Lo ke...@freebsd.org wrote:
 
  Author: kevlo
  Date: Thu Jul 31 03:34:25 2014
  New Revision: 269319
  URL: http://svnweb.freebsd.org/changeset/base/269319
  
  Log:
   In copyright statement correct that the author is me, not Bill Paul.
 
 And you still hear the voices in his (now your) head?   If this is not 
 intentional either /usr/share/examples/etc/bsd-style-copyright is probably 
 what you are looking for.
 
 We should really stop copying and pasting license from one file to another 
 and copying and pasting network drivers around . . .
 

Didn't I fix it in r269322 ?

  
  Modified:
   head/sys/dev/usb/net/if_axgereg.h
  
  Modified: head/sys/dev/usb/net/if_axgereg.h
  ==
  --- head/sys/dev/usb/net/if_axgereg.h   Thu Jul 31 02:07:48 2014
  (r269318)
  +++ head/sys/dev/usb/net/if_axgereg.h   Thu Jul 31 03:34:25 2014
  (r269319)
  @@ -11,10 +11,10 @@
   *notice, this list of conditions and the following disclaimer in the
   *documentation and/or other materials provided with the distribution.
   *
  - * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
  + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
  PURPOSE
  - * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
  + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR THE VOICES IN HIS HEAD
   * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  
 
 — 
 Bjoern A. Zeeb Come on. Learn, goddamn it., WarGames, 1983

Kevin
___
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: r269367 - stable/10/sys/kern

2014-07-31 Thread Konstantin Belousov
Author: kib
Date: Fri Aug  1 04:05:13 2014
New Revision: 269367
URL: http://svnweb.freebsd.org/changeset/base/269367

Log:
  MFC r269205:
  Simplify the expression.

Modified:
  stable/10/sys/kern/kern_proc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_proc.c
==
--- stable/10/sys/kern/kern_proc.c  Fri Aug  1 01:53:39 2014
(r269366)
+++ stable/10/sys/kern/kern_proc.c  Fri Aug  1 04:05:13 2014
(r269367)
@@ -2148,7 +2148,7 @@ kern_proc_vmmap_resident(vm_map_t map, v
obj = entry-object.vm_object;
addr = entry-start;
m_adv = NULL;
-   pi = OFF_TO_IDX(entry-offset + addr - entry-start);
+   pi = OFF_TO_IDX(entry-offset);
for (; addr  entry-end; addr += IDX_TO_OFF(pi_adv), pi += pi_adv) {
if (m_adv != NULL) {
m = m_adv;
___
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: r269368 - in head/sys/powerpc: aim include

2014-07-31 Thread Alan Cox
Author: alc
Date: Fri Aug  1 04:53:35 2014
New Revision: 269368
URL: http://svnweb.freebsd.org/changeset/base/269368

Log:
  Retire PVO_EXECUTABLE.  It's neither used nor set correctly.

Modified:
  head/sys/powerpc/aim/mmu_oea.c
  head/sys/powerpc/include/pmap.h

Modified: head/sys/powerpc/aim/mmu_oea.c
==
--- head/sys/powerpc/aim/mmu_oea.c  Fri Aug  1 04:05:13 2014
(r269367)
+++ head/sys/powerpc/aim/mmu_oea.c  Fri Aug  1 04:53:35 2014
(r269368)
@@ -1184,9 +1184,6 @@ moea_enter_locked(pmap_t pmap, vm_offset
} else
pte_lo |= PTE_BR;
 
-   if (prot  VM_PROT_EXECUTE)
-   pvo_flags |= PVO_EXECUTABLE;
-
if (wired)
pvo_flags |= PVO_WIRED;
 
@@ -1742,8 +1739,6 @@ moea_protect(mmu_t mmu, pmap_t pm, vm_of
for (pvo = RB_NFIND(pvo_tree, pm-pmap_pvo, key);
pvo != NULL  PVO_VADDR(pvo)  eva; pvo = tpvo) {
tpvo = RB_NEXT(pvo_tree, pm-pmap_pvo, pvo);
-   if ((prot  VM_PROT_EXECUTE) == 0)
-   pvo-pvo_vaddr = ~PVO_EXECUTABLE;
 
/*
 * Grab the PTE pointer before we diddle with the cached PTE
@@ -1999,8 +1994,6 @@ moea_pvo_enter(pmap_t pm, uma_zone_t zon
pvo-pvo_pmap = pm;
LIST_INSERT_HEAD(moea_pvo_table[ptegidx], pvo, pvo_olink);
pvo-pvo_vaddr = ~ADDR_POFF;
-   if (flags  VM_PROT_EXECUTE)
-   pvo-pvo_vaddr |= PVO_EXECUTABLE;
if (flags  PVO_WIRED)
pvo-pvo_vaddr |= PVO_WIRED;
if (pvo_head != moea_pvo_kunmanaged)

Modified: head/sys/powerpc/include/pmap.h
==
--- head/sys/powerpc/include/pmap.h Fri Aug  1 04:05:13 2014
(r269367)
+++ head/sys/powerpc/include/pmap.h Fri Aug  1 04:53:35 2014
(r269368)
@@ -112,7 +112,6 @@ RB_PROTOTYPE(pvo_tree, pvo_entry, pvo_pl
 #definePVO_PTEGIDX_VALID   0x008UL /* slot is valid */
 #definePVO_WIRED   0x010UL /* PVO entry is wired */
 #definePVO_MANAGED 0x020UL /* PVO entry is managed 
*/
-#definePVO_EXECUTABLE  0x040UL /* PVO entry is 
executable */
 #definePVO_BOOTSTRAP   0x080UL /* PVO entry allocated 
during
   bootstrap */
 #define PVO_LARGE  0x200UL /* large page */
___
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