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

2013-07-07 Thread Andriy Gapon
on 26/06/2013 03:57 Jeff Roberson said the following:
> + { NULL, "4 Bucket", BUCKET_SIZE(4), 4096 },

Looks like BUCKET_SIZE(4) is zero, if I am not mistaken.
Is this OK / intended?

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


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

2013-07-07 Thread Andriy Gapon
on 17/06/2013 06:43 Jeff Roberson said the following:
> + void*uz_arg;/* Import/release argument. */

Would it make sense to use a more descriptive/distinct name for this member?
The one that would signify its relation to import/release as opposed to being
some other kind of argument.
Unfortunately I can not come up with anything descriptive and short at the 
moments.

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


Re: svn commit: r252672 - head/sbin/nvmecontrol

2013-07-07 Thread Bruce Evans



One minor interjection and I'll butt out of the discussion...




In another thread involving Pawel, phk campaigns against errno and asks
for error strings (even if they are only in English).  Using perror()
did this long ago for program termination, and using the err() family
does it better.  Except possibly for program suites -- translating a
single numeric error is easier for programs than translating an
unstructured string.  I actually prefer using binary representations
for programs.


Your argument would be valid if computers were parsing output and putting it in 
more meaningful forms, but it's invalid when humans need to understand why 
things fail. Many devs who consume FreeBSD don't understand the concept of man 
5 errno, and if they don't, I doubt end-users of FreeBSD (and its derivatives) 
will.


That was more than half of my argument.  perror() and err() give messages
that are readable by humans.  Extra info in exit statuses adds less than
nothing for most humans.  Some programs can parse it, but most can't.
Sysexits is thus useless for almost everything.

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


Re: svn commit: r252209 - in head: share/man/man9 sys/kern sys/sys

2013-07-07 Thread Matthew D. Fuller
On Tue, Jun 25, 2013 at 06:44:15PM + I heard the voice of
John Baldwin, and lo! it spake thus:
> Author: jhb
> Date: Tue Jun 25 18:44:15 2013
> New Revision: 252209
> URL: http://svnweb.freebsd.org/changeset/base/252209
> 
> Log:
>   Several improvements to rmlock(9).  Many of these are based on patches
>   provided by Isilon.

This breaks the kernel build with INVARIANT_SUPPORT but not
INVARIANTS:

/usr/src/sys/kern/kern_rmlock.c:714:1: error: expected identifier or '('

Presumably, because:


> +#ifndef INVARIANTS
> +#define  _rm_assert(c, what, file, line)
> +#endif

thus #define's, but then later

> +#ifdef INVARIANT_SUPPORT
> +/*
> + * Note that this does not need to use witness_assert() for read lock
> + * assertions since an exact count of read locks held by this thread
> + * is computable.
> + */
> +void
> +_rm_assert(const struct rmlock *rm, int what, const char *file, int line)

tries to make a function but the preprocessor has already munged it
up.


-- 
Matthew Fuller (MF4839)   |  fulle...@over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
   On the Internet, nobody can hear you scream.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r252956 - head/sys/fs/ext2fs

2013-07-07 Thread Pedro F. Giffuni
Author: pfg
Date: Sun Jul  7 15:51:28 2013
New Revision: 252956
URL: http://svnweb.freebsd.org/changeset/base/252956

Log:
  Implement SEEK_HOLE/SEEK_DATA for ext2fs.
  
  Merged from r236044 on UFS.
  
  MFC after:3 days

Modified:
  head/sys/fs/ext2fs/ext2_vnops.c

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==
--- head/sys/fs/ext2fs/ext2_vnops.c Sun Jul  7 15:50:01 2013
(r252955)
+++ head/sys/fs/ext2fs/ext2_vnops.c Sun Jul  7 15:51:28 2013
(r252956)
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -92,6 +93,7 @@ static vop_close_text2_close;
 static vop_create_text2_create;
 static vop_fsync_t ext2_fsync;
 static vop_getattr_t   ext2_getattr;
+static vop_ioctl_t ext2_ioctl;
 static vop_link_t  ext2_link;
 static vop_mkdir_t ext2_mkdir;
 static vop_mknod_t ext2_mknod;
@@ -122,6 +124,7 @@ struct vop_vector ext2_vnodeops = {
.vop_fsync =ext2_fsync,
.vop_getattr =  ext2_getattr,
.vop_inactive = ext2_inactive,
+   .vop_ioctl =ext2_ioctl,
.vop_link = ext2_link,
.vop_lookup =   vfs_cache_lookup,
.vop_mkdir =ext2_mkdir,
@@ -1427,6 +1430,9 @@ ext2_pathconf(struct vop_pathconf_args *
case _PC_NO_TRUNC:
*ap->a_retval = 1;
return (0);
+   case _PC_MIN_HOLE_SIZE:
+   *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize;
+   return(0);
default:
return (EINVAL);
}
@@ -1702,6 +1708,20 @@ ext2_read(struct vop_read_args *ap)
return (error);
 }
 
+static int
+ext2_ioctl(struct vop_ioctl_args *ap)
+{
+
+   switch (ap->a_command) {
+   case FIOSEEKDATA:
+   case FIOSEEKHOLE:
+   return (vn_bmap_seekhole(ap->a_vp, ap->a_command,
+   (off_t *)ap->a_data, ap->a_cred));
+   default:
+   return (ENOTTY);
+   }
+}
+
 /*
  * Vnode op for writing.
  */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r252965 - head/sys/mips/include

2013-07-07 Thread Warner Losh
Author: imp
Date: Sun Jul  7 16:12:22 2013
New Revision: 252965
URL: http://svnweb.freebsd.org/changeset/base/252965

Log:
  Remove all the NOPs after SYNC. They aren't needed.
  
  They originated in the original Octeon port. They weren't present, as
  far as I can tell, on the projects/mips branch until after this
  point. They were in the original Octeon port in code picked up from
  the vendor, who I've been able to find out trolling old email put them
  there to get around an SMP problem that most likely was fixed in other
  ways.
  
  NetBSD and Linux don't have these, except for some specific uses of
  SYNC on the alchemy parts (which we don't support, but even if we did
  it is only a specific case and would be specifically coded
  anyway). This is true of the current Linux code, as well as one old
  version I polled.
  
  I looked back at the old R12000, R8000, R6000, R4000, R4400 errata
  that I have, and could find no mention of SYNC needing NOPs for
  silicon bugs (although plenty of other cases where NOPs and other
  contortions were needed).
  
  An Google search turned up no old mailing list discussions on this on
  Linux, NetBSD or FreeBSD (except the disussion that kicked off these
  studies).
  
  I've test booted this on my Octeon Plus eval board and survived a
  buildworld. Adrian Chadd reports that this patch has no ill effects on
  the Ahteros platforms he tested it on.
  
  I conclude it is safe to just remove the NOPs. But added
  __MIPS_PLATFORM_SYNC_NOPS as a failsafe in case we find some platform
  where these are, in fact, required.
  
  Reviewed by:  adrian@

Modified:
  head/sys/mips/include/atomic.h

Modified: head/sys/mips/include/atomic.h
==
--- head/sys/mips/include/atomic.h  Sun Jul  7 16:11:13 2013
(r252964)
+++ head/sys/mips/include/atomic.h  Sun Jul  7 16:12:22 2013
(r252965)
@@ -44,20 +44,16 @@
  * do not have atomic operations defined for them, but generally shouldn't
  * need atomic operations.
  */
+#ifndef __MIPS_PLATFORM_SYNC_NOPS
+#define __MIPS_PLATFORM_SYNC_NOPS ""
+#endif
 
 static __inline  void
 mips_sync(void)
 {
-   __asm __volatile (".set noreorder\n\t"
-   "sync\n\t"
-   "nop\n\t"
-   "nop\n\t"
-   "nop\n\t"
-   "nop\n\t"
-   "nop\n\t"
-   "nop\n\t"
-   "nop\n\t"
-   "nop\n\t"
+   __asm __volatile (".set noreorder\n"
+   "\tsync\n"
+   __MIPS_PLATFORM_SYNC_NOPS
".set reorder\n"
: : : "memory");
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r252856 - head

2013-07-07 Thread Warner Losh
Doesn't .MAKE break the update path?

Warner

On Jul 5, 2013, at 6:13 PM, Simon J. Gerraty wrote:

> Author: sjg
> Date: Sat Jul  6 00:13:08 2013
> New Revision: 252856
> URL: http://svnweb.freebsd.org/changeset/base/252856
> 
> Log:
>  Sprinkle some .MAKE magic
> 
> Modified:
>  head/Makefile.inc1
> 
> Modified: head/Makefile.inc1
> ==
> --- head/Makefile.inc1Sat Jul  6 00:10:52 2013(r252855)
> +++ head/Makefile.inc1Sat Jul  6 00:13:08 2013(r252856)
> @@ -1237,7 +1237,7 @@ _kerberos5_bootstrap_tools= \
> # Please document (add comment) why something is in 'bootstrap-tools'.
> # Try to bound the building of the bootstrap-tool to just the
> # FreeBSD versions that need the tool built at this stage of the build.
> -bootstrap-tools:
> +bootstrap-tools: .MAKE
> .for _tool in \
> ${_clang_tblgen} \
> ${_kerberos5_bootstrap_tools} \
> @@ -1290,7 +1290,7 @@ _gcc_tools= gnu/usr.bin/cc/cc_tools
> _rescue= rescue/rescue
> .endif
> 
> -build-tools:
> +build-tools: .MAKE
> .for _tool in \
> bin/csh \
> bin/sh \
> @@ -1352,7 +1352,7 @@ _cc=gnu/usr.bin/cc
> .endif
> .endif
> 
> -cross-tools:
> +cross-tools: .MAKE
> .for _tool in \
> ${_clang_libs} \
> ${_clang} \
> @@ -1383,12 +1383,12 @@ hierarchy hier:
> # interdependencies (__L) are built automatically by the
> # ${.CURDIR}/tools/make_libdeps.sh script.
> #
> -libraries:
> - cd ${.CURDIR}; \
> - ${MAKE} -f Makefile.inc1 _prereq_libs; \
> - ${MAKE} -f Makefile.inc1 _startup_libs; \
> - ${MAKE} -f Makefile.inc1 _prebuild_libs; \
> - ${MAKE} -f Makefile.inc1 _generic_libs;
> +libraries: .MAKE
> + cd ${.CURDIR} && \
> + ${MAKE} -f Makefile.inc1 _prereq_libs && \
> + ${MAKE} -f Makefile.inc1 _startup_libs && \
> + ${MAKE} -f Makefile.inc1 _prebuild_libs && \
> + ${MAKE} -f Makefile.inc1 _generic_libs
> 
> #
> # static libgcc.a prerequisite for shared libc
> @@ -1542,7 +1542,7 @@ lib/libradius__L: lib/libmd__L
> .endif
> 
> .for _lib in ${_prereq_libs}
> -${_lib}__PL: .PHONY
> +${_lib}__PL: .PHONY .MAKE
> .if exists(${.CURDIR}/${_lib})
>   ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
>   cd ${.CURDIR}/${_lib} && \
> @@ -1554,7 +1554,7 @@ ${_lib}__PL: .PHONY
> .endfor
> 
> .for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
> -${_lib}__L: .PHONY
> +${_lib}__L: .PHONY .MAKE
> .if exists(${.CURDIR}/${_lib})
>   ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
>   cd ${.CURDIR}/${_lib} && \
> @@ -1568,7 +1568,7 @@ ${_lib}__L: .PHONY
> # libpam is special: we need to build static PAM modules before
> # static PAM library, and dynamic PAM library before dynamic PAM
> # modules.
> -lib/libpam__L: .PHONY
> +lib/libpam__L: .PHONY .MAKE
>   ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
>   cd ${.CURDIR}/lib/libpam && \
>   ${MAKE} DIRPRFX=lib/libpam/ obj && \
> @@ -1583,7 +1583,7 @@ _generic_libs: ${_generic_libs:S/$/__L/}
> 
> .for __target in all clean cleandepend cleandir depend includes obj
> .for entry in ${SUBDIR}
> -${entry}.${__target}__D: .PHONY
> +${entry}.${__target}__D: .PHONY .MAKE
>   ${_+_}@set -e; if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
>   ${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} 
> (${__target})"; \
>   edir=${entry}.${MACHINE_ARCH}; \

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


svn commit: r252980 - in head/usr.sbin/bsdconfig: . console diskmgmt docsinstall dot mouse networking networking/share packages password security share share/media share/packages startup startup/sh...

2013-07-07 Thread Devin Teske
Author: dteske
Date: Sun Jul  7 18:21:30 2013
New Revision: 252980
URL: http://svnweb.freebsd.org/changeset/base/252980

Log:
  Be consistent with other usr.sbin programs w/respect to the copyright
  wording ("All rights reserved."); I had the casing wrong on many instances.

Modified:
  head/usr.sbin/bsdconfig/USAGE
  head/usr.sbin/bsdconfig/console/USAGE
  head/usr.sbin/bsdconfig/console/console
  head/usr.sbin/bsdconfig/console/font
  head/usr.sbin/bsdconfig/console/keymap
  head/usr.sbin/bsdconfig/console/repeat
  head/usr.sbin/bsdconfig/console/saver
  head/usr.sbin/bsdconfig/console/screenmap
  head/usr.sbin/bsdconfig/console/ttys
  head/usr.sbin/bsdconfig/diskmgmt/USAGE
  head/usr.sbin/bsdconfig/diskmgmt/diskmgmt
  head/usr.sbin/bsdconfig/docsinstall/USAGE
  head/usr.sbin/bsdconfig/docsinstall/docsinstall
  head/usr.sbin/bsdconfig/dot/USAGE
  head/usr.sbin/bsdconfig/dot/dot
  head/usr.sbin/bsdconfig/mouse/USAGE
  head/usr.sbin/bsdconfig/mouse/disable
  head/usr.sbin/bsdconfig/mouse/enable
  head/usr.sbin/bsdconfig/mouse/flags
  head/usr.sbin/bsdconfig/mouse/mouse
  head/usr.sbin/bsdconfig/mouse/port
  head/usr.sbin/bsdconfig/mouse/type
  head/usr.sbin/bsdconfig/networking/USAGE
  head/usr.sbin/bsdconfig/networking/defaultrouter
  head/usr.sbin/bsdconfig/networking/devices
  head/usr.sbin/bsdconfig/networking/hostname
  head/usr.sbin/bsdconfig/networking/nameservers
  head/usr.sbin/bsdconfig/networking/networking
  head/usr.sbin/bsdconfig/networking/share/common.subr
  head/usr.sbin/bsdconfig/networking/share/device.subr
  head/usr.sbin/bsdconfig/networking/share/hostname.subr
  head/usr.sbin/bsdconfig/networking/share/ipaddr.subr
  head/usr.sbin/bsdconfig/networking/share/media.subr
  head/usr.sbin/bsdconfig/networking/share/netmask.subr
  head/usr.sbin/bsdconfig/networking/share/resolv.subr
  head/usr.sbin/bsdconfig/networking/share/routing.subr
  head/usr.sbin/bsdconfig/networking/share/services.subr
  head/usr.sbin/bsdconfig/packages/USAGE
  head/usr.sbin/bsdconfig/packages/packages
  head/usr.sbin/bsdconfig/password/USAGE
  head/usr.sbin/bsdconfig/password/password
  head/usr.sbin/bsdconfig/security/USAGE
  head/usr.sbin/bsdconfig/security/kern_securelevel
  head/usr.sbin/bsdconfig/security/security
  head/usr.sbin/bsdconfig/share/device.subr
  head/usr.sbin/bsdconfig/share/dialog.subr
  head/usr.sbin/bsdconfig/share/media/any.subr
  head/usr.sbin/bsdconfig/share/media/cdrom.subr
  head/usr.sbin/bsdconfig/share/media/common.subr
  head/usr.sbin/bsdconfig/share/media/directory.subr
  head/usr.sbin/bsdconfig/share/media/dos.subr
  head/usr.sbin/bsdconfig/share/media/floppy.subr
  head/usr.sbin/bsdconfig/share/media/ftp.subr
  head/usr.sbin/bsdconfig/share/media/http.subr
  head/usr.sbin/bsdconfig/share/media/httpproxy.subr
  head/usr.sbin/bsdconfig/share/media/network.subr
  head/usr.sbin/bsdconfig/share/media/nfs.subr
  head/usr.sbin/bsdconfig/share/media/options.subr
  head/usr.sbin/bsdconfig/share/media/tcpip.subr
  head/usr.sbin/bsdconfig/share/media/ufs.subr
  head/usr.sbin/bsdconfig/share/media/usb.subr
  head/usr.sbin/bsdconfig/share/mustberoot.subr
  head/usr.sbin/bsdconfig/share/packages/categories.subr
  head/usr.sbin/bsdconfig/share/packages/index.subr
  head/usr.sbin/bsdconfig/share/packages/packages.subr
  head/usr.sbin/bsdconfig/share/script.subr
  head/usr.sbin/bsdconfig/share/strings.subr
  head/usr.sbin/bsdconfig/share/struct.subr
  head/usr.sbin/bsdconfig/share/variable.subr
  head/usr.sbin/bsdconfig/startup/USAGE
  head/usr.sbin/bsdconfig/startup/misc
  head/usr.sbin/bsdconfig/startup/rcadd
  head/usr.sbin/bsdconfig/startup/rcconf
  head/usr.sbin/bsdconfig/startup/rcdelete
  head/usr.sbin/bsdconfig/startup/rcvar
  head/usr.sbin/bsdconfig/startup/share/rcconf.subr
  head/usr.sbin/bsdconfig/startup/share/rcvar.subr
  head/usr.sbin/bsdconfig/startup/startup
  head/usr.sbin/bsdconfig/timezone/USAGE
  head/usr.sbin/bsdconfig/timezone/share/continents.subr
  head/usr.sbin/bsdconfig/timezone/share/countries.subr
  head/usr.sbin/bsdconfig/timezone/share/iso3166.subr
  head/usr.sbin/bsdconfig/timezone/share/menus.subr
  head/usr.sbin/bsdconfig/timezone/share/zones.subr
  head/usr.sbin/bsdconfig/timezone/timezone
  head/usr.sbin/bsdconfig/ttys/USAGE
  head/usr.sbin/bsdconfig/ttys/ttys
  head/usr.sbin/bsdconfig/usermgmt/USAGE

Modified: head/usr.sbin/bsdconfig/USAGE
==
--- head/usr.sbin/bsdconfig/USAGE   Sun Jul  7 17:45:58 2013
(r252979)
+++ head/usr.sbin/bsdconfig/USAGE   Sun Jul  7 18:21:30 2013
(r252980)
@@ -1,6 +1,6 @@
 # Copyright (c) 2012 Ron McDowell
 # Copyright (c) 2012-2013 Devin Teske
-# All Rights Reserved.
+# All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions

Modified: head/usr.sbin/bsdconfig/console/USAGE

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

2013-07-07 Thread Devin Teske
Author: dteske
Date: Sun Jul  7 18:34:36 2013
New Revision: 252982
URL: http://svnweb.freebsd.org/changeset/base/252982

Log:
  Be consistent with other usr.sbin programs w/respect to the copyright
  wording ("All rights reserved."); I had the casing wrong on many instances.

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

Modified: head/usr.sbin/bsdconfig/share/sysrc.subr
==
--- head/usr.sbin/bsdconfig/share/sysrc.subrSun Jul  7 18:31:02 2013
(r252981)
+++ head/usr.sbin/bsdconfig/share/sysrc.subrSun Jul  7 18:34:36 2013
(r252982)
@@ -1,7 +1,7 @@
 if [ ! "$_SYSRC_SUBR" ]; then _SYSRC_SUBR=1
 #
 # Copyright (c) 2006-2012 Devin Teske
-# All Rights Reserved.
+# All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r252996 - head/sys/arm/arm

2013-07-07 Thread Rui Paulo
Author: rpaulo
Date: Sun Jul  7 19:19:18 2013
New Revision: 252996
URL: http://svnweb.freebsd.org/changeset/base/252996

Log:
  Fix all the compiler warnings in elf_trampoline.c.

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

Modified: head/sys/arm/arm/elf_trampoline.c
==
--- head/sys/arm/arm/elf_trampoline.c   Sun Jul  7 19:13:34 2013
(r252995)
+++ head/sys/arm/arm/elf_trampoline.c   Sun Jul  7 19:19:18 2013
(r252996)
@@ -49,51 +49,67 @@ void _start(void);
 void __start(void);
 void __startC(void);
 
+extern unsigned int cpufunc_id(void);
+extern void armv6_idcache_wbinv_all(void);
+extern void do_call(void *, void *, void *, int);
+
 #define GZ_HEAD0xa
 
 #ifdef CPU_ARM7TDMI
 #define cpu_idcache_wbinv_all  arm7tdmi_cache_flushID
+extern void arm7tdmi_cache_flushID(void);
 #elif defined(CPU_ARM8)
 #define cpu_idcache_wbinv_all  arm8_cache_purgeID
+extern void arm8_cache_purgeID(void);
 #elif defined(CPU_ARM9)
 #define cpu_idcache_wbinv_all  arm9_idcache_wbinv_all
+extern void arm9_idcache_wbinv_all(void);
 #elif defined(CPU_FA526) || defined(CPU_FA626TE)
 #define cpu_idcache_wbinv_all  fa526_idcache_wbinv_all
+extern void fa526_idcache_wbinv_all(void);
 #elif defined(CPU_ARM9E)
 #define cpu_idcache_wbinv_all  armv5_ec_idcache_wbinv_all
+extern void armv5_ec_idcache_wbinv_all(void);
 #elif defined(CPU_ARM10)
 #define cpu_idcache_wbinv_all  arm10_idcache_wbinv_all
+extern void arm10_idcache_wbinv_all(void);
 #elif defined(CPU_ARM1136) || defined(CPU_ARM1176)
 #define cpu_idcache_wbinv_all  armv6_idcache_wbinv_all
 #elif defined(CPU_SA110) || defined(CPU_SA1110) || defined(CPU_SA1100) || \
 defined(CPU_IXP12X0)
 #define cpu_idcache_wbinv_all  sa1_cache_purgeID
+extern void sa1_cache_purgeID(void);
 #elif defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \
   defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) ||  \
   defined(CPU_XSCALE_80219)
 #define cpu_idcache_wbinv_all  xscale_cache_purgeID
+extern void xscale_cache_purgeID(void);
 #elif defined(CPU_XSCALE_81342)
 #define cpu_idcache_wbinv_all  xscalec3_cache_purgeID
+extern void xscalec3_cache_purgeID(void);
 #elif defined(CPU_MV_PJ4B)
 #if !defined(SOC_MV_ARMADAXP)
 #define cpu_idcache_wbinv_all  armv6_idcache_wbinv_all
+extern void armv6_idcache_wbinv_all(void);
 #else
 #define cpu_idcache_wbinv_all()armadaxp_idcache_wbinv_all
+extern void armadaxp_idcache_wbinv_all(void);
 #endif
 #endif /* CPU_MV_PJ4B */
 #ifdef CPU_XSCALE_81342
 #define cpu_l2cache_wbinv_all  xscalec3_l2cache_purge
+extern void xscalec3_l2cache_purge(void);
 #elif defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY)
 #define cpu_l2cache_wbinv_all  sheeva_l2cache_wbinv_all
+extern void sheeva_l2cache_wbinv_all(void);
 #elif defined(CPU_CORTEXA)
 #define cpu_idcache_wbinv_all  armv7_idcache_wbinv_all
+extern void armv7_idcache_wbinv_all(void);
 #define cpu_l2cache_wbinv_all()
 #else
 #define cpu_l2cache_wbinv_all()
 #endif
 
-static void armadaxp_idcache_wbinv_all(void);
-
 int arm_picache_size;
 int arm_picache_line_size;
 int arm_picache_ways;
@@ -434,11 +450,11 @@ static void *
 inflate_kernel(void *kernel, void *startaddr)
 {
struct inflate infl;
-   char slide[GZ_WSIZE];
+   unsigned char slide[GZ_WSIZE];
 
orig_input = kernel;
memcnt = memtot = 0;
-   i_input = (char *)kernel + GZ_HEAD;
+   i_input = (unsigned char *)kernel + GZ_HEAD;
if (((char *)kernel)[3] & 0x18) {
while (*i_input)
i_input++;
@@ -590,6 +606,8 @@ load_kernel(unsigned int kstart, unsigne
__asm __volatile(".globl func_end\n"
"func_end:");

+   /* NOTREACHED */
+   return NULL;
 }
 
 extern char func_end[];
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r252997 - head/sys/arm/arm

2013-07-07 Thread Rui Paulo
Author: rpaulo
Date: Sun Jul  7 19:22:31 2013
New Revision: 252997
URL: http://svnweb.freebsd.org/changeset/base/252997

Log:
  armadaxp_idcache_wbinv_all() is in this file.

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

Modified: head/sys/arm/arm/elf_trampoline.c
==
--- head/sys/arm/arm/elf_trampoline.c   Sun Jul  7 19:19:18 2013
(r252996)
+++ head/sys/arm/arm/elf_trampoline.c   Sun Jul  7 19:22:31 2013
(r252997)
@@ -93,7 +93,6 @@ extern void xscalec3_cache_purgeID(void)
 extern void armv6_idcache_wbinv_all(void);
 #else
 #define cpu_idcache_wbinv_all()armadaxp_idcache_wbinv_all
-extern void armadaxp_idcache_wbinv_all(void);
 #endif
 #endif /* CPU_MV_PJ4B */
 #ifdef CPU_XSCALE_81342
@@ -110,6 +109,8 @@ extern void armv7_idcache_wbinv_all(void
 #define cpu_l2cache_wbinv_all()
 #endif
 
+static void armadaxp_idcache_wbinv_all(void);
+
 int arm_picache_size;
 int arm_picache_line_size;
 int arm_picache_ways;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r252998 - head/sys/dev/mbox

2013-07-07 Thread Rui Paulo
Author: rpaulo
Date: Sun Jul  7 19:47:22 2013
New Revision: 252998
URL: http://svnweb.freebsd.org/changeset/base/252998

Log:
  Add a mailbox interface.
  
  Mailboxes are an IPC mechanism found on several ARM architectures, namely
  OMAP4, BCM2385, Sitara, etc.
  
  Reviewed by:  gonzo

Added:
  head/sys/dev/mbox/
  head/sys/dev/mbox/mbox_if.m   (contents, props changed)

Added: head/sys/dev/mbox/mbox_if.m
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/mbox/mbox_if.m Sun Jul  7 19:47:22 2013(r252998)
@@ -0,0 +1,46 @@
+#-
+# Copyright (c) 2013 Rui Paulo
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+# Mailboxes are used as an IPC mechanism that allows subsystems to 
+# communicate with each other.
+# A system can have multiple mailboxes (e.g. OMAP4) but there's usually a
+# system wide mailbox.
+#
+
+INTERFACE mbox;
+
+METHOD int read {
+   device_tdev;
+   int channel;
+   uint32_t*data;
+};
+
+METHOD int write {
+   device_tdev;
+   int channel;
+   uint32_tdata;
+};
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r252998 - head/sys/dev/mbox

2013-07-07 Thread Rui Paulo
On 7 Jul 2013, at 12:47, Rui Paulo  wrote:

> Author: rpaulo
> Date: Sun Jul  7 19:47:22 2013
> New Revision: 252998
> URL: http://svnweb.freebsd.org/changeset/base/252998
> 
> Log:
>  Add a mailbox interface.
> 
>  Mailboxes are an IPC mechanism found on several ARM architectures, namely
>  OMAP4, BCM2385, Sitara, etc.


Although currently only specific to ARM, Mailboxes can be used by multiple 
architectures and that's why I committed it to sys/dev.

--
Rui Paulo

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


svn commit: r253002 - head

2013-07-07 Thread Alfred Perlstein
Author: alfred
Date: Sun Jul  7 20:39:11 2013
New Revision: 253002
URL: http://svnweb.freebsd.org/changeset/base/253002

Log:
  Document tip on how to build all kernels quickly.

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Sun Jul  7 19:58:14 2013(r253001)
+++ head/Makefile   Sun Jul  7 20:39:11 2013(r253002)
@@ -32,6 +32,12 @@
 # targets - Print a list of supported TARGET/TARGET_ARCH pairs
 #   for world and kernel targets.
 # toolchains  - Build a toolchain for all world and kernel targets.
+# 
+# "quick" way to test all kernel builds:
+#  _jflag=`sysctl -n hw.ncpu`
+#  _jflag=$(($_jflag * 2))
+#  [ $_jflag -gt 12 ] && _jflag=12
+#  make universe -DMAKE_JUST_KERNELS JFLAG=${jflag}
 #
 # This makefile is simple by design. The FreeBSD make automatically reads
 # the /usr/share/mk/sys.mk unless the -m argument is specified on the
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253003 - head

2013-07-07 Thread Alfred Perlstein
Author: alfred
Date: Sun Jul  7 20:44:04 2013
New Revision: 253003
URL: http://svnweb.freebsd.org/changeset/base/253003

Log:
  Correct typo specifying jflags.

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/Makefile   Sun Jul  7 20:39:11 2013(r253002)
+++ head/Makefile   Sun Jul  7 20:44:04 2013(r253003)
@@ -37,7 +37,7 @@
 #  _jflag=`sysctl -n hw.ncpu`
 #  _jflag=$(($_jflag * 2))
 #  [ $_jflag -gt 12 ] && _jflag=12
-#  make universe -DMAKE_JUST_KERNELS JFLAG=${jflag}
+#  make universe -DMAKE_JUST_KERNELS JFLAG=-j${_jflag}
 #
 # This makefile is simple by design. The FreeBSD make automatically reads
 # the /usr/share/mk/sys.mk unless the -m argument is specified on the
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r253002 - head

2013-07-07 Thread Garrett Cooper
Why the magic number 12?

Sent from my iPhone

On Jul 7, 2013, at 1:39 PM, Alfred Perlstein  wrote:

> Author: alfred
> Date: Sun Jul  7 20:39:11 2013
> New Revision: 253002
> URL: http://svnweb.freebsd.org/changeset/base/253002
> 
> Log:
>  Document tip on how to build all kernels quickly.
> 
> Modified:
>  head/Makefile
> 
> Modified: head/Makefile
> ==
> --- head/MakefileSun Jul  7 19:58:14 2013(r253001)
> +++ head/MakefileSun Jul  7 20:39:11 2013(r253002)
> @@ -32,6 +32,12 @@
> # targets - Print a list of supported TARGET/TARGET_ARCH pairs
> #   for world and kernel targets.
> # toolchains  - Build a toolchain for all world and kernel targets.
> +# 
> +# "quick" way to test all kernel builds:
> +#_jflag=`sysctl -n hw.ncpu`
> +#_jflag=$(($_jflag * 2))
> +#[ $_jflag -gt 12 ] && _jflag=12
> +#make universe -DMAKE_JUST_KERNELS JFLAG=${jflag}
> #
> # This makefile is simple by design. The FreeBSD make automatically reads
> # the /usr/share/mk/sys.mk unless the -m argument is specified on the
> ___
> svn-src-head@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r253002 - head

2013-07-07 Thread Alfred Perlstein

On 7/7/13 2:01 PM, Garrett Cooper wrote:

Why the magic number 12?


Numbers higher seem to result in worse performance as reported by some 
members of my team.


-Alfred



Sent from my iPhone

On Jul 7, 2013, at 1:39 PM, Alfred Perlstein  wrote:


Author: alfred
Date: Sun Jul  7 20:39:11 2013
New Revision: 253002
URL: http://svnweb.freebsd.org/changeset/base/253002

Log:
  Document tip on how to build all kernels quickly.

Modified:
  head/Makefile

Modified: head/Makefile
==
--- head/MakefileSun Jul  7 19:58:14 2013(r253001)
+++ head/MakefileSun Jul  7 20:39:11 2013(r253002)
@@ -32,6 +32,12 @@
# targets - Print a list of supported TARGET/TARGET_ARCH pairs
#   for world and kernel targets.
# toolchains  - Build a toolchain for all world and kernel targets.
+#
+# "quick" way to test all kernel builds:
+#_jflag=`sysctl -n hw.ncpu`
+#_jflag=$(($_jflag * 2))
+#[ $_jflag -gt 12 ] && _jflag=12
+#make universe -DMAKE_JUST_KERNELS JFLAG=${jflag}
#
# This makefile is simple by design. The FreeBSD make automatically reads
# the /usr/share/mk/sys.mk unless the -m argument is specified on the
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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


svn commit: r253004 - head/contrib/tcpdump

2013-07-07 Thread Pawel Jakub Dawidek
Author: pjd
Date: Sun Jul  7 21:19:53 2013
New Revision: 253004
URL: http://svnweb.freebsd.org/changeset/base/253004

Log:
  Sandbox tcpdump(8) using Capsicum's capability mode and capabilities.
  For now, sandboxing is done only if -n option was specified and neither -z nor
  -V options were given. Because it is very common to run tcpdump(8) with the -n
  option for speed, I decided to commit sandboxing now. To also support
  sandboxing when -n option wasn't specified, we need Casper daemon and its
  services that are not available in FreeBSD yet.
  
  - Limit file descriptors of a file specified by -r option or files specified
via -V option to CAP_READ only.
  
  - If neither -r nor -V options were specified, we operate on /dev/bpf.
Limit its descriptor to CAP_READ and CAP_IOCTL plus limit allowed ioctls to
BIOCGSTATS only.
  
  - Limit file descriptor of a file specified by -w option to CAP_SEEK and
CAP_WRITE.
  
  - If either -C or -G options were specified, we open directory containing
destination file and we limit directory descriptor to CAP_CREATE, CAP_FCNTL,
CAP_FTRUNCATE, CAP_LOOKUP, CAP_SEEK and CAP_WRITE. Newly opened/created
files are limited to CAP_SEEK and CAP_WRITE only.
  
  - Enter capability mode if -n option was specified and neither -z nor -V
options were specified.
  
  Approved by:  delphij, wxs
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/tcpdump/tcpdump.c

Modified: head/contrib/tcpdump/tcpdump.c
==
--- head/contrib/tcpdump/tcpdump.c  Sun Jul  7 20:44:04 2013
(r253003)
+++ head/contrib/tcpdump/tcpdump.c  Sun Jul  7 21:19:53 2013
(r253004)
@@ -68,6 +68,13 @@ extern int SIZE_BUF;
 #include 
 #include 
 #include 
+#ifdef __FreeBSD__
+#include 
+#include 
+#include 
+#include 
+#include 
+#endif /* __FreeBSD__ */
 #ifndef WIN32
 #include 
 #include 
@@ -384,6 +391,9 @@ struct dump_info {
char*CurrentFileName;
pcap_t  *pd;
pcap_dumper_t *p;
+#ifdef __FreeBSD__
+   int dirfd;
+#endif
 };
 
 #ifdef HAVE_PCAP_SET_TSTAMP_TYPE
@@ -702,6 +712,10 @@ main(int argc, char **argv)
 #endif
int status;
FILE *VFile;
+#ifdef __FreeBSD__
+   int cansandbox;
+#endif
+
 #ifdef WIN32
if(wsockinit() != 0) return 1;
 #endif /* WIN32 */
@@ -1189,6 +1203,12 @@ main(int argc, char **argv)
pd = pcap_open_offline(RFileName, ebuf);
if (pd == NULL)
error("%s", ebuf);
+#ifdef __FreeBSD__
+   if (cap_rights_limit(fileno(pcap_file(pd)), CAP_READ) < 0 &&
+   errno != ENOSYS) {
+   error("unable to limit pcap descriptor");
+   }
+#endif
dlt = pcap_datalink(pd);
dlt_name = pcap_datalink_val_to_name(dlt);
if (dlt_name == NULL) {
@@ -1437,6 +1457,20 @@ main(int argc, char **argv)
 
if (pcap_setfilter(pd, &fcode) < 0)
error("%s", pcap_geterr(pd));
+#ifdef __FreeBSD__
+   if (RFileName == NULL && VFileName == NULL) {
+   static const unsigned long cmds[] = { BIOCGSTATS };
+
+   if (cap_rights_limit(pcap_fileno(pd),
+   CAP_IOCTL | CAP_READ) < 0 && errno != ENOSYS) {
+   error("unable to limit pcap descriptor");
+   }
+   if (cap_ioctls_limit(pcap_fileno(pd), cmds,
+   sizeof(cmds) / sizeof(cmds[0])) < 0 && errno != ENOSYS) {
+   error("unable to limit ioctls on pcap descriptor");
+   }
+   }
+#endif
if (WFileName) {
pcap_dumper_t *p;
/* Do not exceed the default PATH_MAX for files. */
@@ -1458,9 +1492,30 @@ main(int argc, char **argv)
 #endif
if (p == NULL)
error("%s", pcap_geterr(pd));
+#ifdef __FreeBSD__
+   if (cap_rights_limit(fileno(pcap_dump_file(p)),
+   CAP_SEEK | CAP_WRITE) < 0 && errno != ENOSYS) {
+   error("unable to limit dump descriptor");
+   }
+#endif
if (Cflag != 0 || Gflag != 0) {
-   callback = dump_packet_and_trunc;
+#ifdef __FreeBSD__
+   dumpinfo.WFileName = strdup(basename(WFileName));
+   dumpinfo.dirfd = open(dirname(WFileName),
+   O_DIRECTORY | O_RDONLY);
+   if (dumpinfo.dirfd < 0) {
+   error("unable to open directory %s",
+   dirname(WFileName));
+   }
+   if (cap_rights_limit(dumpinfo.dirfd, CAP_CREATE |
+   CAP_FCNTL | CAP_FTRUNCATE | CAP_LOOKUP | CAP_SEEK |
+   CAP_WRITE) < 0 && errno != ENOSYS) {
+   error("unable to limit directo

svn commit: r253005 - head/sys/arm/arm

2013-07-07 Thread Rui Paulo
Author: rpaulo
Date: Sun Jul  7 21:20:52 2013
New Revision: 253005
URL: http://svnweb.freebsd.org/changeset/base/253005

Log:
  Another warning.

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

Modified: head/sys/arm/arm/elf_trampoline.c
==
--- head/sys/arm/arm/elf_trampoline.c   Sun Jul  7 21:19:53 2013
(r253004)
+++ head/sys/arm/arm/elf_trampoline.c   Sun Jul  7 21:20:52 2013
(r253005)
@@ -51,6 +51,7 @@ void __startC(void);
 
 extern unsigned int cpufunc_id(void);
 extern void armv6_idcache_wbinv_all(void);
+extern void armv7_idcache_wbinv_all(void);
 extern void do_call(void *, void *, void *, int);
 
 #define GZ_HEAD0xa
@@ -103,7 +104,6 @@ extern void xscalec3_l2cache_purge(void)
 extern void sheeva_l2cache_wbinv_all(void);
 #elif defined(CPU_CORTEXA)
 #define cpu_idcache_wbinv_all  armv7_idcache_wbinv_all
-extern void armv7_idcache_wbinv_all(void);
 #define cpu_l2cache_wbinv_all()
 #else
 #define cpu_l2cache_wbinv_all()
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253006 - head/sys/arm/broadcom/bcm2835

2013-07-07 Thread Rui Paulo
Author: rpaulo
Date: Sun Jul  7 21:23:58 2013
New Revision: 253006
URL: http://svnweb.freebsd.org/changeset/base/253006

Log:
  Convert bcm2835_mbox to the new mbox interface.
  
  Reviewed by:  gonzo

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_fb.c
  head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
  head/sys/arm/broadcom/bcm2835/bcm2835_mbox.h
  head/sys/arm/broadcom/bcm2835/files.bcm2835

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_fb.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_fb.c  Sun Jul  7 21:20:52 2013
(r253005)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_fb.c  Sun Jul  7 21:23:58 2013
(r253006)
@@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include "mbox_if.h"
+
 #defineBCMFB_FONT_HEIGHT   16
 
 struct argb {
@@ -173,6 +175,7 @@ bcm_fb_init(void *arg)
volatile struct bcm_fb_config*  fb_config = sc->fb_config;
phandle_t node;
pcell_t cell;
+   device_t mbox;
 
node = ofw_bus_get_node(sc->dev);
 
@@ -205,8 +208,12 @@ bcm_fb_init(void *arg)
 
bus_dmamap_sync(sc->dma_tag, sc->dma_map,
BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
-   bcm_mbox_write(BCM2835_MBOX_CHAN_FB, sc->fb_config_phys);
-   bcm_mbox_read(BCM2835_MBOX_CHAN_FB, &err);
+
+   mbox = devclass_get_device(devclass_find("mbox"), 0);
+   if (mbox) {
+   MBOX_WRITE(mbox, BCM2835_MBOX_CHAN_FB, sc->fb_config_phys);
+   MBOX_READ(mbox, BCM2835_MBOX_CHAN_FB, &err);
+   }
bus_dmamap_sync(sc->dma_tag, sc->dma_map,
BUS_DMASYNC_POSTREAD);
 

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cSun Jul  7 21:20:52 
2013(r253005)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.cSun Jul  7 21:23:58 
2013(r253006)
@@ -49,8 +49,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+
 #include 
 
+#include "mbox_if.h"
+
 #defineREG_READ0x00
 #defineREG_POL 0x10
 #defineREG_SENDER  0x14
@@ -65,12 +68,12 @@ __FBSDID("$FreeBSD$");
 #defineMBOX_CHAN(msg)  ((msg) & 0xf)
 #defineMBOX_DATA(msg)  ((msg) & ~0xf)
 
-#defineMBOX_LOCK   do {\
-   mtx_lock(&bcm_mbox_sc->lock);   \
+#defineMBOX_LOCK(sc)   do {\
+   mtx_lock(&(sc)->lock);  \
 } while(0)
 
-#defineMBOX_UNLOCK do {\
-   mtx_unlock(&bcm_mbox_sc->lock); \
+#defineMBOX_UNLOCK(sc) do {\
+   mtx_unlock(&(sc)->lock);\
 } while(0)
 
 #ifdef  DEBUG
@@ -90,12 +93,10 @@ struct bcm_mbox_softc {
int msg[BCM2835_MBOX_CHANS];
 };
 
-static struct bcm_mbox_softc *bcm_mbox_sc = NULL;
-
-#definembox_read_4(reg)\
-bus_space_read_4(bcm_mbox_sc->bst, bcm_mbox_sc->bsh, reg)
-#definembox_write_4(reg, val)  \
-bus_space_write_4(bcm_mbox_sc->bst, bcm_mbox_sc->bsh, reg, val)
+#definembox_read_4(sc, reg)\
+bus_space_read_4((sc)->bst, (sc)->bsh, reg)
+#definembox_write_4(sc, reg, val)  \
+bus_space_write_4((sc)->bst, (sc)->bsh, reg, val)
 
 static void
 bcm_mbox_intr(void *arg)
@@ -105,9 +106,9 @@ bcm_mbox_intr(void *arg)
uint32_t data;
uint32_t msg;
 
-   MBOX_LOCK;
-   while (!(mbox_read_4(REG_STATUS) & STATUS_EMPTY)) {
-   msg = mbox_read_4(REG_READ);
+   MBOX_LOCK(sc);
+   while (!(mbox_read_4(sc, REG_STATUS) & STATUS_EMPTY)) {
+   msg = mbox_read_4(sc, REG_READ);
dprintf("bcm_mbox_intr: raw data %08x\n", msg);
chan = MBOX_CHAN(msg);
data = MBOX_DATA(msg);
@@ -121,7 +122,7 @@ bcm_mbox_intr(void *arg)
wakeup(&sc->msg[chan]);

}
-   MBOX_UNLOCK;
+   MBOX_UNLOCK(sc);
 }
 
 static int
@@ -143,9 +144,6 @@ bcm_mbox_attach(device_t dev)
int i;
int rid = 0;
 
-   if (bcm_mbox_sc != NULL)
-   return (EINVAL);
-
sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, 
RF_ACTIVE);
if (sc->mem_res == NULL) {
device_printf(dev, "could not allocate memory resource\n");
@@ -176,72 +174,76 @@ bcm_mbox_attach(device_t dev)
sc->msg[0] = 0;
}
 
-   bcm_mbox_sc = sc;
/* Read all pending messages */
bcm_mbox_intr(sc);
 
-   /* Should be called after bcm_mbox_sc initialization */
-   mbox_write_4(REG_CONFIG, CONFIG_DATA_IRQ);
+   mbox_write_4(sc, REG_CONFIG, CONFIG_DATA_IRQ);
 
return (0);
 }
 
-static device_method_t bcm_mbox_methods[] = {
-   DEVMETHOD(device_probe, bcm_mbox_probe),
-   DEVMETHOD(device_attach,bcm_mbox_attach),
-  

svn commit: r253007 - in head/sys: kern net80211 sys

2013-07-07 Thread Alfred Perlstein
Author: alfred
Date: Sun Jul  7 21:39:37 2013
New Revision: 253007
URL: http://svnweb.freebsd.org/changeset/base/253007

Log:
  Make kassert_printf use __printflike.
  
  Fix associated errors/warnings while I'm here.
  
  Requested by: avg

Modified:
  head/sys/kern/subr_witness.c
  head/sys/kern/vfs_bio.c
  head/sys/net80211/ieee80211_output.c
  head/sys/sys/systm.h

Modified: head/sys/kern/subr_witness.c
==
--- head/sys/kern/subr_witness.cSun Jul  7 21:23:58 2013
(r253006)
+++ head/sys/kern/subr_witness.cSun Jul  7 21:39:37 2013
(r253007)
@@ -1138,12 +1138,16 @@ witness_checkorder(struct lock_object *l
iclass = LOCK_CLASS(interlock);
lock1 = find_instance(lock_list, interlock);
if (lock1 == NULL)
-   kassert_panic("interlock (%s) %s not locked @ %s:%d",
+   kassert_panic(
+   "interlock (%s) %s not locked while locking"
+   " %s @ %s:%d",
iclass->lc_name, interlock->lo_name,
flags & LOP_EXCLUSIVE ? "exclusive" : "shared",
fixup_filename(file), line);
else if ((lock1->li_flags & LI_RECURSEMASK) != 0)
-   kassert_panic("interlock (%s) %s recursed @ %s:%d",
+   kassert_panic(
+   "interlock (%s) %s recursed while locking %s"
+   " @ %s:%d",
iclass->lc_name, interlock->lo_name,
flags & LOP_EXCLUSIVE ? "exclusive" : "shared",
fixup_filename(file), line);

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Sun Jul  7 21:23:58 2013(r253006)
+++ head/sys/kern/vfs_bio.c Sun Jul  7 21:39:37 2013(r253007)
@@ -4485,8 +4485,8 @@ bdata2bio(struct buf *bp, struct bio *bi
bip->bio_flags |= BIO_UNMAPPED;
KASSERT(round_page(bip->bio_ma_offset + bip->bio_length) /
PAGE_SIZE == bp->b_npages,
-   ("Buffer %p too short: %d %d %d", bp, bip->bio_ma_offset,
-   bip->bio_length, bip->bio_ma_n));
+   ("Buffer %p too short: %d %lld %d", bp, bip->bio_ma_offset,
+   (long long)bip->bio_length, bip->bio_ma_n));
} else {
bip->bio_data = bp->b_data;
bip->bio_ma = NULL;

Modified: head/sys/net80211/ieee80211_output.c
==
--- head/sys/net80211/ieee80211_output.cSun Jul  7 21:23:58 2013
(r253006)
+++ head/sys/net80211/ieee80211_output.cSun Jul  7 21:39:37 2013
(r253007)
@@ -1022,7 +1022,7 @@ ieee80211_mbuf_adjust(struct ieee80211va
return NULL;
}
KASSERT(needed_space <= MHLEN,
-   ("not enough room, need %u got %zu\n", needed_space, 
MHLEN));
+   ("not enough room, need %u got %d\n", needed_space, MHLEN));
/*
 * Setup new mbuf to have leading space to prepend the
 * 802.11 header and any crypto header bits that are

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hSun Jul  7 21:23:58 2013(r253006)
+++ head/sys/sys/systm.hSun Jul  7 21:39:37 2013(r253007)
@@ -74,7 +74,7 @@ extern int vm_guest;  /* Running as virt
 enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN };
 
 #if defined(WITNESS) || defined(INVARIANTS)
-void   kassert_panic(const char *fmt, ...);
+void   kassert_panic(const char *fmt, ...)  __printflike(1, 2);
 #endif
 
 #ifdef INVARIANTS  /* The option is always available */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r253002 - head

2013-07-07 Thread Andriy Gapon
on 08/07/2013 00:15 Alfred Perlstein said the following:
> On 7/7/13 2:01 PM, Garrett Cooper wrote:
>> Why the magic number 12?
> 
> Numbers higher seem to result in worse performance as reported by some members
> of my team.

Should we really commit all "notes to self" or "my team's knowledge base" to
FreeBSD source code like this?

>>
>> On Jul 7, 2013, at 1:39 PM, Alfred Perlstein  wrote:
>>
>>> Author: alfred
>>> Date: Sun Jul  7 20:39:11 2013
>>> New Revision: 253002
>>> URL: http://svnweb.freebsd.org/changeset/base/253002
>>>
>>> Log:
>>>   Document tip on how to build all kernels quickly.
>>>
>>> Modified:
>>>   head/Makefile
>>>
>>> Modified: head/Makefile
>>> ==
>>> --- head/MakefileSun Jul  7 19:58:14 2013(r253001)
>>> +++ head/MakefileSun Jul  7 20:39:11 2013(r253002)
>>> @@ -32,6 +32,12 @@
>>> # targets - Print a list of supported TARGET/TARGET_ARCH pairs
>>> #   for world and kernel targets.
>>> # toolchains  - Build a toolchain for all world and kernel targets.
>>> +#
>>> +# "quick" way to test all kernel builds:
>>> +#_jflag=`sysctl -n hw.ncpu`
>>> +#_jflag=$(($_jflag * 2))
>>> +#[ $_jflag -gt 12 ] && _jflag=12
>>> +#make universe -DMAKE_JUST_KERNELS JFLAG=${jflag}
>>> #
>>> # This makefile is simple by design. The FreeBSD make automatically reads
>>> # the /usr/share/mk/sys.mk unless the -m argument is specified on the
>>> ___
>>> svn-src-head@freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/svn-src-head
>>> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
> 


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


Re: svn commit: r253002 - head

2013-07-07 Thread Alfred Perlstein

On 7/7/13 2:40 PM, Andriy Gapon wrote:

on 08/07/2013 00:15 Alfred Perlstein said the following:

On 7/7/13 2:01 PM, Garrett Cooper wrote:

Why the magic number 12?

Numbers higher seem to result in worse performance as reported by some members
of my team.

Should we really commit all "notes to self" or "my team's knowledge base" to
FreeBSD source code like this?


I would hope so!  At least in comments, that way we can all help each other.

Otherwise each time another person comes along they are subject to 
having to discover the same things that I did.


What is the point of listing 10+ make targets if someone coming in 
doesn't know which ones to run and how to run them optimally in order to 
ensure a safe build?  Do you not agree that more of this sort of 
documentation should be in the code instead of having to ask on IRC?


For the record I checked multiple pages in developer primer and scoured 
makefiles for a while before giving up and asking on IRC.  I figured it 
would be helpful for the next clueless goon that came in and tried to 
make things better if I recorded my experience to guide them.


I hold no strong feelings towards the comments, other than they should 
be preserved in some form, or maybe even turned into a workable target 
for people that don't want or can not hold all that context in their brains.


-Alfred





On Jul 7, 2013, at 1:39 PM, Alfred Perlstein  wrote:


Author: alfred
Date: Sun Jul  7 20:39:11 2013
New Revision: 253002
URL: http://svnweb.freebsd.org/changeset/base/253002

Log:
   Document tip on how to build all kernels quickly.

Modified:
   head/Makefile

Modified: head/Makefile
==
--- head/MakefileSun Jul  7 19:58:14 2013(r253001)
+++ head/MakefileSun Jul  7 20:39:11 2013(r253002)
@@ -32,6 +32,12 @@
# targets - Print a list of supported TARGET/TARGET_ARCH pairs
#   for world and kernel targets.
# toolchains  - Build a toolchain for all world and kernel targets.
+#
+# "quick" way to test all kernel builds:
+#_jflag=`sysctl -n hw.ncpu`
+#_jflag=$(($_jflag * 2))
+#[ $_jflag -gt 12 ] && _jflag=12
+#make universe -DMAKE_JUST_KERNELS JFLAG=${jflag}
#
# This makefile is simple by design. The FreeBSD make automatically reads
# the /usr/share/mk/sys.mk unless the -m argument is specified on the
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"




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


Re: svn commit: r253002 - head

2013-07-07 Thread Andriy Gapon
on 08/07/2013 00:50 Alfred Perlstein said the following:
> On 7/7/13 2:40 PM, Andriy Gapon wrote:
>> on 08/07/2013 00:15 Alfred Perlstein said the following:
>>> On 7/7/13 2:01 PM, Garrett Cooper wrote:
 Why the magic number 12?
>>> Numbers higher seem to result in worse performance as reported by some 
>>> members
>>> of my team.
>> Should we really commit all "notes to self" or "my team's knowledge base" to
>> FreeBSD source code like this?
> 
> I would hope so!

I hope not ;)

> At least in comments, that way we can all help each other.
> 
> Otherwise each time another person comes along they are subject to having to
> discover the same things that I did.
> 
> What is the point of listing 10+ make targets if someone coming in doesn't 
> know
> which ones to run and how to run them optimally in order to ensure a safe
> build?  Do you not agree that more of this sort of documentation should be in
> the code instead of having to ask on IRC?
> 
> For the record I checked multiple pages in developer primer and scoured
> makefiles for a while before giving up and asking on IRC.  I figured it would 
> be
> helpful for the next clueless goon that came in and tried to make things 
> better
> if I recorded my experience to guide them.
> 
> I hold no strong feelings towards the comments, other than they should be
> preserved in some form, or maybe even turned into a workable target for people
> that don't want or can not hold all that context in their brains.

I am sure that the next time you need to run the same thing you'll remember
where you put the comment and you'll copy/paste from it.
I am sure that if any other developer runs into the same situation, then he 
will:
- google
- ask on irc
- ask on mailing lists
- perhaps even read build(7)

I am sure that looking through the Makefile would be one of the last things on
his mind.

So, I am all in favor of documenting things but that should be done properly.
What you did was not commenting the code (such comments usually appear near the
code and describe the code), it was putting a mini-how-to at an obscure place.

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


svn commit: r253009 - head/contrib/tzdata

2013-07-07 Thread Edwin Groothuis
Author: edwin
Date: Sun Jul  7 22:23:59 2013
New Revision: 253009
URL: http://svnweb.freebsd.org/changeset/base/253009

Log:
  MFV of tzdata2013d, 253008
  
  - Morocco:
announced that the year's Ramadan daylight-savings transitions
would be 2013-07-07 and 2013-08-10.
  
  - Israel:
As of 2013, DST starts at 02:00 on the Friday before the last
Sunday in March.  DST ends at 02:00 on the first Sunday after
October 1, unless it occurs on the second day of the Jewish Rosh
Hashana holiday, in which case DST ends a day later (i.e. at 02:00
the first Monday after October 2).  [Rosh Hashana holidays are
factored in until 2100.]

Modified:
  head/contrib/tzdata/africa
  head/contrib/tzdata/asia
  head/contrib/tzdata/australasia
  head/contrib/tzdata/europe
  head/contrib/tzdata/southamerica
  head/contrib/tzdata/zone.tab
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/africa
==
--- head/contrib/tzdata/africa  Sun Jul  7 22:18:08 2013(r253008)
+++ head/contrib/tzdata/africa  Sun Jul  7 22:23:59 2013(r253009)
@@ -852,12 +852,18 @@ Zone  Indian/Mayotte  3:00:56 -   LMT 1911 J
 # announced that year's Ramadan daylight-saving transitions would be
 # 2012-07-20 and 2012-08-20; see
 # .
-#
+
+# From Andrew Paprocki (2013-07-02):
+# Morocco announced that the year's Ramadan daylight-savings
+# transitions would be 2013-07-07 and 2013-08-10; see:
+# 
http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10
+
+# From Paul Eggert (2013-07-03):
 # To estimate what the Moroccan government will do in future years,
-# transition dates for 2013 through 2021 were determined by running
+# transition dates for 2014 through 2021 were determined by running
 # the following program under GNU Emacs 24.3:
 #
-# (let ((islamic-year 1434))
+# (let ((islamic-year 1435))
 #   (while (< islamic-year 1444)
 # (let ((a
 #   (calendar-gregorian-from-absolute
@@ -910,8 +916,8 @@ RuleMorocco 20122019-   Apr  
lastSun 2:
 Rule   Morocco 2012max -   Sep  lastSun 3:00   0   -
 Rule   Morocco 2012only-   Jul  20  3:00   0   -
 Rule   Morocco 2012only-   Aug  20  2:00   1:00S
-Rule   Morocco 2013only-   Jul   9  3:00   0   -
-Rule   Morocco 2013only-   Aug   8  2:00   1:00S
+Rule   Morocco 2013only-   Jul   7  3:00   0   -
+Rule   Morocco 2013only-   Aug  10  2:00   1:00S
 Rule   Morocco 2014only-   Jun  29  3:00   0   -
 Rule   Morocco 2014only-   Jul  29  2:00   1:00S
 Rule   Morocco 2015only-   Jun  18  3:00   0   -

Modified: head/contrib/tzdata/asia
==
--- head/contrib/tzdata/asiaSun Jul  7 22:18:08 2013(r253008)
+++ head/contrib/tzdata/asiaSun Jul  7 22:23:59 2013(r253009)
@@ -1212,39 +1212,21 @@ RuleZion2011only-   Oct  2  
2:000   S
 Rule   Zion2012only-   Mar Fri>=26 2:001:00D
 Rule   Zion2012only-   Sep 23  2:000   S
 
-# From Ephraim Silverberg (2012-10-18):
-# Yesterday, the Interior Ministry Committee, after more than a year
-# past, approved sending the proposed June 2011 changes to the Time
-# Decree Law back to the Knesset for second and third (final) votes
-# before the upcoming elections on Jan. 22, 2013.  Hence, although the
-# changes are not yet law, they are expected to be so before February 2013.
-#
-# As of 2013, DST starts at 02:00 on the Friday before the last Sunday in 
March.
-# DST ends at 02:00 on the first Sunday after October 1, unless it occurs on 
the
-# second day of the Jewish Rosh Hashana holiday, in which case DST ends a day
-# later (i.e. at 02:00 the first Monday after October 2).
-# [Rosh Hashana holidays are factored in until 2100.]
-
-# From Ephraim Silverberg (2012-11-05):
-# The Knesset passed today (in second and final readings) the amendment to the
-# Time Decree Law making the changes ... law.
+# From Ephraim Silverberg (2013-06-27):
+# On June 23, 2013, the Israeli government approved changes to the
+# Time Decree Law.  The next day, the changes passed the First Reading
+# in the Knesset.  The law is expected to pass the Second and Third
+# (final) Readings by the beginning of September 2013.
+#
+# As of 2013, DST starts at 02:00 on the Friday before the last Sunday
+# in March.  DST ends at 02:00 on the last Sunday of October.
 
 # Rule NAMEFROMTO  TYPEIN  ON  AT  SAVELETTER/S
 Rule   Zion2013max -   Mar Fri>=23 2:001:00D
-Rule   Zion   

svn commit: r253015 - head/usr.sbin/gssd

2013-07-07 Thread Rick Macklem
Author: rmacklem
Date: Mon Jul  8 00:50:57 2013
New Revision: 253015
URL: http://svnweb.freebsd.org/changeset/base/253015

Log:
  Add a new "-h" option to the gssd daemon that enables support for
  host based (kerberos service principal) initiator credentials in
  the default keytab file. This option won't actually be useful until
  the corresponding kernel changes are committed.
  
  Reviewed by:  jhb

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

Modified: head/usr.sbin/gssd/gssd.c
==
--- head/usr.sbin/gssd/gssd.c   Mon Jul  8 00:36:42 2013(r253014)
+++ head/usr.sbin/gssd/gssd.c   Mon Jul  8 00:50:57 2013(r253015)
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
 #ifndef _PATH_GSSDSOCK
 #define _PATH_GSSDSOCK "/var/run/gssd.sock"
 #endif
+#define GSSD_CREDENTIAL_CACHE_FILE "/tmp/krb5cc_gssd"
 
 struct gss_resource {
LIST_ENTRY(gss_resource) gr_link;
@@ -75,6 +76,7 @@ static char ccfile_dirlist[PATH_MAX + 1]
 static char pref_realm[1024];
 static int verbose;
 static int use_old_des;
+static int hostbased_initiator_cred;
 #ifndef WITHOUT_KERBEROS
 /* 1.2.752.43.13.14 */
 static gss_OID_desc gss_krb5_set_allowable_enctypes_x_desc =
@@ -92,8 +94,10 @@ static int find_ccache_file(const char *
 static int is_a_valid_tgt_cache(const char *, uid_t, int *, time_t *);
 static void gssd_verbose_out(const char *, ...);
 #ifndef WITHOUT_KERBEROS
+static krb5_error_code gssd_get_cc_from_keytab(const char *);
 static OM_uint32 gssd_get_user_cred(OM_uint32 *, uid_t, gss_cred_id_t *);
 #endif
+void gssd_terminate(int);
 
 extern void gssd_1(struct svc_req *rqstp, SVCXPRT *transp);
 extern int gssd_syscall(char *path);
@@ -119,11 +123,23 @@ main(int argc, char **argv)
pref_realm[0] = '\0';
debug = 0;
verbose = 0;
-   while ((ch = getopt(argc, argv, "dovs:c:r:")) != -1) {
+   while ((ch = getopt(argc, argv, "dhovs:c:r:")) != -1) {
switch (ch) {
case 'd':
debug_level++;
break;
+   case 'h':
+#ifndef WITHOUT_KERBEROS
+   /*
+* Enable use of a host based initiator credential
+* in the default keytab file.
+*/
+   hostbased_initiator_cred = 1;
+#else
+   errx(1, "This option not available when built"
+   " without MK_KERBEROS\n");
+#endif
+   break;
case 'o':
 #ifndef WITHOUT_KERBEROS
/*
@@ -182,6 +198,7 @@ main(int argc, char **argv)
signal(SIGQUIT, SIG_IGN);
signal(SIGHUP, SIG_IGN);
}
+   signal(SIGTERM, gssd_terminate);
 
memset(&sun, 0, sizeof sun);
sun.sun_family = AF_LOCAL;
@@ -377,7 +394,17 @@ gssd_init_sec_context_1_svc(init_sec_con
 #endif
 
memset(result, 0, sizeof(*result));
-   if (ccfile_dirlist[0] != '\0' && argp->cred == 0) {
+   if (hostbased_initiator_cred != 0 && argp->cred != 0 &&
+   argp->uid == 0) {
+   /*
+* These credentials are for a host based initiator name
+* in a keytab file, which should now have credentials
+* in /tmp/krb5cc_gssd, because gss_acquire_cred() did
+* the equivalent of "kinit -k".
+*/
+   snprintf(ccname, sizeof(ccname), "FILE:%s",
+   GSSD_CREDENTIAL_CACHE_FILE);
+   } else if (ccfile_dirlist[0] != '\0' && argp->cred == 0) {
/*
 * For the "-s" case and no credentials provided as an
 * argument, search the directory list for an appropriate
@@ -773,6 +800,51 @@ gssd_acquire_cred_1_svc(acquire_cred_arg
 #endif
 
memset(result, 0, sizeof(*result));
+   if (argp->desired_name) {
+   desired_name = gssd_find_resource(argp->desired_name);
+   if (!desired_name) {
+   result->major_status = GSS_S_BAD_NAME;
+   gssd_verbose_out("gssd_acquire_cred: no desired name"
+   " found\n");
+   return (TRUE);
+   }
+   }
+
+#ifndef WITHOUT_KERBEROS
+   if (hostbased_initiator_cred != 0 && argp->desired_name != 0 &&
+   argp->uid == 0 && argp->cred_usage == GSS_C_INITIATE) {
+   /* This is a host based initiator name in the keytab file. */
+   snprintf(ccname, sizeof(ccname), "FILE:%s",
+   GSSD_CREDENTIAL_CACHE_FILE);
+   setenv("KRB5CCNAME", ccname, TRUE);
+   result->major_status = gss_display_name(&result->minor_status,
+   desired_name, &namebuf, NULL);
+   gssd_verbose_out("gssd_acquire_cred: desired name for host "
+   "based initiator cred major=0x%x minor=%d\n",
+  

svn commit: r253016 - head/usr.sbin/gssd

2013-07-07 Thread Rick Macklem
Author: rmacklem
Date: Mon Jul  8 00:57:12 2013
New Revision: 253016
URL: http://svnweb.freebsd.org/changeset/base/253016

Log:
  Document the new "-h" option for the gssd daemon.
  This is a content change.
  
  Reviewed by:  jhb

Modified:
  head/usr.sbin/gssd/gssd.8

Modified: head/usr.sbin/gssd/gssd.8
==
--- head/usr.sbin/gssd/gssd.8   Mon Jul  8 00:50:57 2013(r253015)
+++ head/usr.sbin/gssd/gssd.8   Mon Jul  8 00:57:12 2013(r253016)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 23, 2013
+.Dd July 7, 2013
 .Dt GSSD 8
 .Os
 .Sh NAME
@@ -34,6 +34,7 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl d
+.Op Fl h
 .Op Fl o
 .Op Fl v
 .Op Fl s Ar dir-list
@@ -51,6 +52,15 @@ Run in debug mode.
 In this mode,
 .Nm
 will not fork when it starts.
+.It Fl h
+Enable support for host based initiator credentials.
+This permits a kerberized NFS mount to use a service principal in
+the default Kerberos5 keytab file for access.
+Such access is enabled via the
+gssname
+option for the
+.Xr mount_nfs 8
+command.
 .It Fl o
 Force use of DES and the associated old style GSS-API initialization token.
 This may be required to make kerberized NFS mounts work against some
@@ -96,6 +106,7 @@ by kernel GSS-API services.
 .Ex -std
 .Sh SEE ALSO
 .Xr gssapi 3 ,
+.Xr mount_nfs 8 ,
 .Xr syslog 3
 .Sh HISTORY
 The
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253017 - head/usr.sbin/gssd

2013-07-07 Thread Rick Macklem
Author: rmacklem
Date: Mon Jul  8 01:08:57 2013
New Revision: 253017
URL: http://svnweb.freebsd.org/changeset/base/253017

Log:
  Make sure the krb5 status variables are correctly initialized.

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

Modified: head/usr.sbin/gssd/gssd.c
==
--- head/usr.sbin/gssd/gssd.c   Mon Jul  8 00:57:12 2013(r253016)
+++ head/usr.sbin/gssd/gssd.c   Mon Jul  8 01:08:57 2013(r253017)
@@ -1196,6 +1196,7 @@ gssd_get_cc_from_keytab(const char *name
ret = krb5_init_context(&context);
if (ret != 0)
return (ret);
+   opt_ret = cc_ret = kt_ret = cred_ret = 0;
princ_ret = ret = krb5_parse_name(context, name, &principal);
if (ret == 0)
opt_ret = ret = krb5_get_init_creds_opt_alloc(context, &opt);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253018 - head/usr.sbin/gssd

2013-07-07 Thread Rick Macklem
Author: rmacklem
Date: Mon Jul  8 01:29:09 2013
New Revision: 253018
URL: http://svnweb.freebsd.org/changeset/base/253018

Log:
  Oops, initialize the krb5 ret values correctly (to anything non-zero).

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

Modified: head/usr.sbin/gssd/gssd.c
==
--- head/usr.sbin/gssd/gssd.c   Mon Jul  8 01:08:57 2013(r253017)
+++ head/usr.sbin/gssd/gssd.c   Mon Jul  8 01:29:09 2013(r253018)
@@ -1196,7 +1196,7 @@ gssd_get_cc_from_keytab(const char *name
ret = krb5_init_context(&context);
if (ret != 0)
return (ret);
-   opt_ret = cc_ret = kt_ret = cred_ret = 0;
+   opt_ret = cc_ret = kt_ret = cred_ret = 1;   /* anything non-zero */
princ_ret = ret = krb5_parse_name(context, name, &principal);
if (ret == 0)
opt_ret = ret = krb5_get_init_creds_opt_alloc(context, &opt);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r253016 - head/usr.sbin/gssd

2013-07-07 Thread Benjamin Kaduk
On Sun, Jul 7, 2013 at 8:57 PM, Rick Macklem  wrote:

> Author: rmacklem
> Date: Mon Jul  8 00:57:12 2013
> New Revision: 253016
> URL: http://svnweb.freebsd.org/changeset/base/253016
>
> Log:
>   Document the new "-h" option for the gssd daemon.
>   This is a content change.
>
>   Reviewed by:  jhb
>
> Modified:
>   head/usr.sbin/gssd/gssd.8
>
> Modified: head/usr.sbin/gssd/gssd.8
>
> ==
> --- head/usr.sbin/gssd/gssd.8   Mon Jul  8 00:50:57 2013(r253015)
> +++ head/usr.sbin/gssd/gssd.8   Mon Jul  8 00:57:12 2013(r253016)
> @@ -51,6 +52,15 @@ Run in debug mode.
>  In this mode,
>  .Nm
>  will not fork when it starts.
> +.It Fl h
> +Enable support for host based initiator credentials.


"host-based" with a hyphen is preferred in krb5 circles.


> +This permits a kerberized NFS mount to use a service principal in
> +the default Kerberos5 keytab file for access.
>

"Kerberos 5" with a space, please.


> +Such access is enabled via the
> +gssname
>

.Ar gssname

-Ben

+option for the
> +.Xr mount_nfs 8
> +command.
>  .It Fl o
>  Force use of DES and the associated old style GSS-API initialization
> token.
>  This may be required to make kerberized NFS mounts work against some
> @@ -96,6 +106,7 @@ by kernel GSS-API services.
>  .Ex -std
>  .Sh SEE ALSO
>  .Xr gssapi 3 ,
> +.Xr mount_nfs 8 ,
>  .Xr syslog 3
>  .Sh HISTORY
>  The
> ___
> svn-src-...@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
>
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r252913 - head/sys/arm/ti/am335x

2013-07-07 Thread Alexey Dokuchaev
On Sat, Jul 06, 2013 at 09:33:08PM -0700, Juli Mallett wrote:
> Thanks for this and the other commits, Oleksandr!  Much appreciated.
> Looking forward to giving it a spin on my BeagleBones Black!
> 
> [commit diff skipped]

Looking forward to never see overquoting again on FreeBSD lists!

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


svn commit: r253020 - head/usr.sbin/gssd

2013-07-07 Thread Rick Macklem
Author: rmacklem
Date: Mon Jul  8 01:47:50 2013
New Revision: 253020
URL: http://svnweb.freebsd.org/changeset/base/253020

Log:
  Fix some Kerberos related terminology.
  This is a content change.
  
  Requested by: bjk

Modified:
  head/usr.sbin/gssd/gssd.8

Modified: head/usr.sbin/gssd/gssd.8
==
--- head/usr.sbin/gssd/gssd.8   Mon Jul  8 01:46:11 2013(r253019)
+++ head/usr.sbin/gssd/gssd.8   Mon Jul  8 01:47:50 2013(r253020)
@@ -53,9 +53,9 @@ In this mode,
 .Nm
 will not fork when it starts.
 .It Fl h
-Enable support for host based initiator credentials.
+Enable support for host-based initiator credentials.
 This permits a kerberized NFS mount to use a service principal in
-the default Kerberos5 keytab file for access.
+the default Kerberos 5 keytab file for access.
 Such access is enabled via the
 gssname
 option for the
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253022 - head/sys/sys

2013-07-07 Thread Mark Johnston
Author: markj
Date: Mon Jul  8 02:03:18 2013
New Revision: 253022
URL: http://svnweb.freebsd.org/changeset/base/253022

Log:
  Also define SDT_PROBE_DEFINE0 for the !KDTRACE_HOOKS case.

Modified:
  head/sys/sys/sdt.h

Modified: head/sys/sys/sdt.h
==
--- head/sys/sys/sdt.h  Mon Jul  8 01:51:17 2013(r253021)
+++ head/sys/sys/sdt.h  Mon Jul  8 02:03:18 2013(r253022)
@@ -86,6 +86,7 @@
 #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4)
 #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type)
 
+#defineSDT_PROBE_DEFINE0(prov, mod, func, name, sname)
 #defineSDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0)
 #defineSDT_PROBE_DEFINE2(prov, mod, func, name, sname, arg0, arg1)
 #defineSDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, 
arg2)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r253002 - head

2013-07-07 Thread Alexey Dokuchaev
On Mon, Jul 08, 2013 at 01:02:39AM +0300, Andriy Gapon wrote:
> I am sure that the next time you need to run the same thing you'll remember
> where you put the comment and you'll copy/paste from it.
> I am sure that if any other developer runs into the same situation, then he
> will:
> - google
> - ask on irc
> - ask on mailing lists
> - perhaps even read build(7)
> 
> I am sure that looking through the Makefile would be one of the last things
> on his mind.

It's quite on the contrary.  First people reach for comments/documentation;
only as a last resort they will use Google or ask on MLs.  Bad documentation
is probably one of the key of Google's success. :-)

./danfe

P.S.  You gotta be kidding us, right?
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r253002 - head

2013-07-07 Thread Garrett Cooper
On Jul 7, 2013, at 2:15 PM, Alfred Perlstein  wrote:

> On 7/7/13 2:01 PM, Garrett Cooper wrote:
>> Why the magic number 12?
> 
> Numbers higher seem to result in worse performance as reported by some 
> members of my team.

The suggestion is good in spirit, but this doesn't justify the reasoning for 
this recommendation for all cases.

Please revert this change and add a doc page or notes to the dev handbook 
discussing what the empirical process and results were for determining this 
value so people can come up with their own values that work best with their 
hardware and software config. This recommendation is prone to bitrot like some 
of the recommendations in tuning(7).

Misinformation is sometimes more harmful than no information.

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


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

2013-07-07 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jul  8 04:27:03 2013
New Revision: 253023
URL: http://svnweb.freebsd.org/changeset/base/253023

Log:
  - AM335x requires updated soft-reset logic too

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

Modified: head/sys/arm/ti/ti_mmchs.c
==
--- head/sys/arm/ti/ti_mmchs.c  Mon Jul  8 02:03:18 2013(r253022)
+++ head/sys/arm/ti/ti_mmchs.c  Mon Jul  8 04:27:03 2013(r253023)
@@ -213,10 +213,13 @@ ti_mmchs_reset_controller(struct ti_mmch
sysctl = ti_mmchs_read_4(sc, MMCHS_SYSCTL);
ti_mmchs_write_4(sc, MMCHS_SYSCTL, sysctl | bit);
 
-   if ((ti_chip() == CHIP_OMAP_4) && (ti_revision() > OMAP4430_REV_ES1_0)) 
{
-   /* OMAP4 ES2 and greater has an updated reset logic.
-* Monitor a 0->1 transition first
-*/
+
+   /* 
+* AM335x and OMAP4 ES2 and greater has an updated reset logic.
+* Monitor a 0->1 transition first
+*/
+   if ((ti_chip() == CHIP_AM335X) || 
+   ((ti_chip() == CHIP_OMAP_4) && (ti_revision() > 
OMAP4430_REV_ES1_0))) {
attempts = 1;
while (!(ti_mmchs_read_4(sc, MMCHS_SYSCTL) & bit) && 
(attempts-- > 0))
continue;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253024 - head/sys/boot/fdt/dts

2013-07-07 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jul  8 04:30:12 2013
New Revision: 253024
URL: http://svnweb.freebsd.org/changeset/base/253024

Log:
  - MMC1 (internal eMMC) pins should be configured as input-pullup, except
  for reset pin

Modified:
  head/sys/boot/fdt/dts/beaglebone-black.dts

Modified: head/sys/boot/fdt/dts/beaglebone-black.dts
==
--- head/sys/boot/fdt/dts/beaglebone-black.dts  Mon Jul  8 04:27:03 2013
(r253023)
+++ head/sys/boot/fdt/dts/beaglebone-black.dts  Mon Jul  8 04:30:12 2013
(r253024)
@@ -76,17 +76,17 @@
"MMC0_DAT2", "mmc0_dat2", "input_pullup",
"MMC0_DAT3", "mmc0_dat3", "input_pullup",
/* MMC1 */
-   "GPMC_CSn1", "mmc1_clk", "input_pulldown",
-   "GPMC_CSn2", "mmc1_cmd", "input_pulldown",
-   "GPMC_CSn3", "gpio2_0", "output", /* Reset */
-   "GPMC_AD0", "mmc1_dat0", "input_pulldown",
-   "GPMC_AD1", "mmc1_dat1", "input_pulldown",
-   "GPMC_AD2", "mmc1_dat2", "input_pulldown",
-   "GPMC_AD3", "mmc1_dat3", "input_pulldown",
-   "GPMC_AD4", "mmc1_dat4", "input_pulldown",
-   "GPMC_AD5", "mmc1_dat5", "input_pulldown",
-   "GPMC_AD6", "mmc1_dat6", "input_pulldown",
-   "GPMC_AD7", "mmc1_dat7", "input_pulldown",
+   "GPMC_CSn1", "mmc1_clk", "input_pullup",
+   "GPMC_CSn2", "mmc1_cmd", "input_pullup",
+   "GPMC_CSn3", "gpio2_0", "output_pullup", /* 
Reset */
+   "GPMC_AD0", "mmc1_dat0", "input_pullup",
+   "GPMC_AD1", "mmc1_dat1", "input_pullup",
+   "GPMC_AD2", "mmc1_dat2", "input_pullup",
+   "GPMC_AD3", "mmc1_dat3", "input_pullup",
+   "GPMC_AD4", "mmc1_dat4", "input_pullup",
+   "GPMC_AD5", "mmc1_dat5", "input_pullup",
+   "GPMC_AD6", "mmc1_dat6", "input_pullup",
+   "GPMC_AD7", "mmc1_dat7", "input_pullup",
/* GPIO */
"ECAP0_IN_PWM0_OUT", "gpio0_7", 
"input_pulldown",
"GPMC_AD10", "gpio0_26", "input_pulldown",
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253025 - head/sys/arm/ti/am335x

2013-07-07 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jul  8 05:06:32 2013
New Revision: 253025
URL: http://svnweb.freebsd.org/changeset/base/253025

Log:
  Add IDs for TPS65217C and TPS65217D

Modified:
  head/sys/arm/ti/am335x/am335x_pmic.c

Modified: head/sys/arm/ti/am335x/am335x_pmic.c
==
--- head/sys/arm/ti/am335x/am335x_pmic.cMon Jul  8 04:30:12 2013
(r253024)
+++ head/sys/arm/ti/am335x/am335x_pmic.cMon Jul  8 05:06:32 2013
(r253025)
@@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$");
 
 #define TPS65217A  0x7
 #define TPS65217B  0xF
+#define TPS65217C  0xE
+#define TPS65217D  0x6
 
 /* TPS65217 Reisters */
 #define TPS65217_CHIPID_REG0x00
@@ -131,6 +133,12 @@ am335x_pmic_start(void *xdev)
case TPS65217B:
sprintf(name, "TPS65217B ver 1.%u", reg & 0xF);
break;
+   case TPS65217C:
+   sprintf(name, "TPS65217C ver 1.%u", reg & 0xF);
+   break;
+   case TPS65217D:
+   sprintf(name, "TPS65217D ver 1.%u", reg & 0xF);
+   break;
default:
sprintf(name, "Unknown PMIC");
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2013-07-07 Thread Joel Dahl
Author: joel (doc committer)
Date: Mon Jul  8 05:58:09 2013
New Revision: 253026
URL: http://svnweb.freebsd.org/changeset/base/253026

Log:
  mdoc: remove superfluous paragraph macros.

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

Modified: head/share/man/man9/SDT.9
==
--- head/share/man/man9/SDT.9   Mon Jul  8 05:06:32 2013(r253025)
+++ head/share/man/man9/SDT.9   Mon Jul  8 05:58:09 2013(r253026)
@@ -54,7 +54,6 @@
 .Fn SDT_PROBE6 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5
 .Fn SDT_PROBE7 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 arg6
 .Sh DESCRIPTION
-.Pp
 The
 .Nm
 macros allow programmers to define static trace points in kernel code.
@@ -158,7 +157,6 @@ trace points.
 They are meant to be added to executable code and can be used to instrument the
 code in which they are called.
 .Sh EXAMPLES
-.Pp
 The following probe definition will create a DTrace probe called
 .Ql icmp::unreach:pkt-receive ,
 which would hypothetically be triggered when the kernel receives an ICMP packet
@@ -216,7 +214,6 @@ framework were originally ported to Free
 This manual page was written by
 .An Mark Johnston Aq ma...@freebsd.org .
 .Sh BUGS
-.Pp
 The
 .Nm
 macros allow the module name of a probe to be specified as part of a probe
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253027 - head/sys/mips/atheros

2013-07-07 Thread Adrian Chadd
Author: adrian
Date: Mon Jul  8 06:10:29 2013
New Revision: 253027
URL: http://svnweb.freebsd.org/changeset/base/253027

Log:
  Add AR9341, AR9342, AR9344 SoC types.

Modified:
  head/sys/mips/atheros/ar71xx_setup.h

Modified: head/sys/mips/atheros/ar71xx_setup.h
==
--- head/sys/mips/atheros/ar71xx_setup.hMon Jul  8 05:58:09 2013
(r253026)
+++ head/sys/mips/atheros/ar71xx_setup.hMon Jul  8 06:10:29 2013
(r253027)
@@ -41,6 +41,9 @@ enum ar71xx_soc_type {
AR71XX_SOC_AR9132,
AR71XX_SOC_AR9330,
AR71XX_SOC_AR9331,
+   AR71XX_SOC_AR9341,
+   AR71XX_SOC_AR9342,
+   AR71XX_SOC_AR9344,
 };
 extern enum ar71xx_soc_type ar71xx_soc;   
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253028 - head/sys/mips/atheros

2013-07-07 Thread Adrian Chadd
Author: adrian
Date: Mon Jul  8 06:12:38 2013
New Revision: 253028
URL: http://svnweb.freebsd.org/changeset/base/253028

Log:
  Import the initial SoC register definitions for the AR934x MIPS74k SoC.
  
  Obtained from:Linux/OpenWRT

Added:
  head/sys/mips/atheros/ar934xreg.h   (contents, props changed)

Added: head/sys/mips/atheros/ar934xreg.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/atheros/ar934xreg.h   Mon Jul  8 06:12:38 2013
(r253028)
@@ -0,0 +1,156 @@
+/*-
+ * Copyright (c) 2013 Adrian Chadd 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef__AR934X_REG_H__
+#define__AR934X_REG_H__
+
+#defineAR934X_WMAC_BASE(AR71XX_APB_BASE + 0x0010)
+#defineAR934X_WMAC_SIZE0x2
+#defineAR934X_EHCI_BASE0x1b00
+#defineAR934X_EHCI_SIZE0x200
+#defineAR934X_SRIF_BASE(AR71XX_APB_BASE + 0x00116000)
+#defineAR934X_SRIF_SIZE0x1000
+
+#defineAR934X_DDR_REG_FLUSH_GE0(AR71XX_APB_BASE + 0x9c)
+#defineAR934X_DDR_REG_FLUSH_GE1(AR71XX_APB_BASE + 0xa0)
+#defineAR934X_DDR_REG_FLUSH_USB(AR71XX_APB_BASE + 0xa4)
+#defineAR934X_DDR_REG_FLUSH_PCIE   (AR71XX_APB_BASE + 0xa8)
+#defineAR934X_DDR_REG_FLUSH_WMAC   (AR71XX_APB_BASE + 0xac)
+
+#defineAR934X_PLL_CPU_CONFIG_REG   (AR71XX_PLL_CPU_BASE + 0x00)
+#defineAR934X_PLL_DDR_CONFIG_REG   (AR71XX_PLL_CPU_BASE + 0x04)
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_REG (AR71XX_PLL_CPU_BASE + 0x08)
+
+#defineAR934X_PLL_CPU_CONFIG_NFRAC_SHIFT   0
+#defineAR934X_PLL_CPU_CONFIG_NFRAC_MASK0x3f
+#defineAR934X_PLL_CPU_CONFIG_NINT_SHIFT6
+#defineAR934X_PLL_CPU_CONFIG_NINT_MASK 0x3f
+#defineAR934X_PLL_CPU_CONFIG_REFDIV_SHIFT  12
+#defineAR934X_PLL_CPU_CONFIG_REFDIV_MASK   0x1f
+#defineAR934X_PLL_CPU_CONFIG_OUTDIV_SHIFT  19
+#defineAR934X_PLL_CPU_CONFIG_OUTDIV_MASK   0x3
+
+#defineAR934X_PLL_DDR_CONFIG_NFRAC_SHIFT   0
+#defineAR934X_PLL_DDR_CONFIG_NFRAC_MASK0x3ff
+#defineAR934X_PLL_DDR_CONFIG_NINT_SHIFT10
+#defineAR934X_PLL_DDR_CONFIG_NINT_MASK 0x3f
+#defineAR934X_PLL_DDR_CONFIG_REFDIV_SHIFT  16
+#defineAR934X_PLL_DDR_CONFIG_REFDIV_MASK   0x1f
+#defineAR934X_PLL_DDR_CONFIG_OUTDIV_SHIFT  23
+#defineAR934X_PLL_DDR_CONFIG_OUTDIV_MASK   0x7
+
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_CPU_PLL_BYPASS  (1 << 2)
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_DDR_PLL_BYPASS  (1 << 3)
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_AHB_PLL_BYPASS  (1 << 4)
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_SHIFT  5
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_CPU_POST_DIV_MASK   0x1f
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_SHIFT  10
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_DDR_POST_DIV_MASK   0x1f
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_SHIFT  15
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_AHB_POST_DIV_MASK   0x1f
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_CPUCLK_FROM_CPUPLL  (1 << 20)
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_DDRCLK_FROM_DDRPLL  (1 << 21)
+#defineAR934X_PLL_CPU_DDR_CLK_CTRL_AHBCLK_FROM_DDRPLL  (1 << 24)
+
+#defineAR934X_RESET_REG_RESET_MODULE   (AR71XX_RST_BLOCK_BASE 
+ 0x1c)
+#defineAR934X_RESET_REG_BOOTSTRAP  (AR71XX_RST_BLOCK_BASE 
+ 0xb0)
+#def

Re: svn commit: r253002 - head

2013-07-07 Thread Garrett Cooper
On Sun, Jul 7, 2013 at 7:25 PM, Garrett Cooper  wrote:
> On Jul 7, 2013, at 2:15 PM, Alfred Perlstein  wrote:
>
>> On 7/7/13 2:01 PM, Garrett Cooper wrote:
>>> Why the magic number 12?
>>
>> Numbers higher seem to result in worse performance as reported by some 
>> members of my team.
>
> The suggestion is good in spirit, but this doesn't justify the reasoning for 
> this recommendation for all cases.
>
> Please revert this change and add a doc page or notes to the dev handbook 
> discussing what the empirical process and results were for determining this 
> value so people can come up with their own values that work best with their 
> hardware and software config. This recommendation is prone to bitrot like 
> some of the recommendations in tuning(7).
>
> Misinformation is sometimes more harmful than no information.

I spoke with Alfred over the phone and did some more careful thought
about this and I'm rescinding this request.

Alfred did a good job at documenting how JFLAG works (it was
previously undocumented). My concern over -j12 was performance
related, and after giving things more careful thought it actually
makes sense why -j12 was chosen because Westmere and newer processors
have issues with NUMA and cache locality between multiple processor
packages as we've seen non-empirically and empirically at Isilon with
FreeBSD 7 and 10 (it's a known issue that jeffr@ and jhb@ are aware
of).

I'll come up with a concise patch that does what Alfred was trying to
achieve and have Alfred review it.

Thanks (and thank you Alfred for the contribution!!!)!
-Garrett
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"