Re: svn commit: r276008 - in head/sys: kern sys

2014-12-23 Thread Andriy Gapon
On 23/12/2014 09:55, Rui Paulo wrote:
> On Dec 22, 2014, at 23:03, Andriy Gapon  wrote:
>>
>> On 23/12/2014 04:39, Rui Paulo wrote:
>>> On Dec 22, 2014, at 11:17, John Baldwin  wrote:

 On Monday, December 22, 2014 1:29:38 pm Rui Paulo wrote:
> On Dec 22, 2014, at 06:40, John Baldwin  wrote:
>> Is there something specific to core dumps that makes vn_fullpath() more
>> useful to have working before a process tries to open the core?  (As
>> compared to other newly-created files)
>
> Yes: the ability to provide the full path to userland when a core dump 
> file 
 is generated.

 Can you be more specific?  Are we printing the path on the console after
 destroying the generated path?  Is it being written into a note in the core
 itself (but only having the vnode of the core file available and not the 
 generated path)?
>>>
>>> No.  I have some code that calls devctl_notify() when a core dump is 
>>> generated which is useful for running an automated debugging session.  We 
>>> use this at work and I'll see if I can upstream it.  What Konstantin fixed 
>>> was the generation of the cache entry in the corefile_open() routine.  This 
>>> lets me call vn_fullpath() after vn_close() with a high probability that it 
>>> will work whereas, in the past, it was never in the cache, so vn_fullpath() 
>>> would always fail.
>>
>> What is not entirely clear to me is why we need to recover the path from the
>> vnode if we, obviously, have the path even before we have the vnode.
> 
> Using the default setting for core files, it's based on the CWD of the 
> process.  If you're using a different kern.corefile setting, it's different.  
> You will also need to account for the %N format string (check the code for 
> indexpos).  Given that this is far from being a hot path, it's much easier to 
> just do a vn_fullpath() on the vnode than to deal with all the other details. 


Hmm, I mean that given this code:

flags = O_CREAT | FWRITE | O_NOFOLLOW;
NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td);
error = vn_open_cred(&nd, &flags, cmode, oflags, td->td_ucred, NULL);

'name' is the name, right?  Can we keep and use it?

-- 
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: r276123 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-12-23 Thread Steven Hartland
Author: smh
Date: Tue Dec 23 09:31:24 2014
New Revision: 276123
URL: https://svnweb.freebsd.org/changeset/base/276123

Log:
  Always sync the global ZFS config cache to reflect the new mosconfig
  
  This fixes out of date zpool.cache for root pools, which can cause issues
  such as confusion of zdb etc.
  
  MFC after:1 month

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.cTue Dec 
23 08:51:30 2014(r276122)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.cTue Dec 
23 09:31:24 2014(r276123)
@@ -536,8 +536,7 @@ spa_config_update(spa_t *spa, int what)
/*
 * Update the global config cache to reflect the new mosconfig.
 */
-   if (!spa->spa_is_root)
-   spa_config_sync(spa, B_FALSE, what != SPA_CONFIG_UPDATE_POOL);
+   spa_config_sync(spa, B_FALSE, what != SPA_CONFIG_UPDATE_POOL);
 
if (what == SPA_CONFIG_UPDATE_POOL)
spa_config_update(spa, SPA_CONFIG_UPDATE_VDEVS);
___
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: r276008 - in head/sys: kern sys

2014-12-23 Thread Konstantin Belousov
On Tue, Dec 23, 2014 at 10:18:43AM +0200, Andriy Gapon wrote:
> On 23/12/2014 09:55, Rui Paulo wrote:
> > On Dec 22, 2014, at 23:03, Andriy Gapon  wrote:
> >>
> >> On 23/12/2014 04:39, Rui Paulo wrote:
> >>> On Dec 22, 2014, at 11:17, John Baldwin  wrote:
> 
>  On Monday, December 22, 2014 1:29:38 pm Rui Paulo wrote:
> > On Dec 22, 2014, at 06:40, John Baldwin  wrote:
> >> Is there something specific to core dumps that makes vn_fullpath() more
> >> useful to have working before a process tries to open the core?  (As
> >> compared to other newly-created files)
> >
> > Yes: the ability to provide the full path to userland when a core dump 
> > file 
>  is generated.
> 
>  Can you be more specific?  Are we printing the path on the console after
>  destroying the generated path?  Is it being written into a note in the 
>  core
>  itself (but only having the vnode of the core file available and not the 
>  generated path)?
> >>>
> >>> No.  I have some code that calls devctl_notify() when a core dump is 
> >>> generated which is useful for running an automated debugging session.  We 
> >>> use this at work and I'll see if I can upstream it.  What Konstantin 
> >>> fixed was the generation of the cache entry in the corefile_open() 
> >>> routine.  This lets me call vn_fullpath() after vn_close() with a high 
> >>> probability that it will work whereas, in the past, it was never in the 
> >>> cache, so vn_fullpath() would always fail.
> >>
> >> What is not entirely clear to me is why we need to recover the path from 
> >> the
> >> vnode if we, obviously, have the path even before we have the vnode.
> > 
> > Using the default setting for core files, it's based on the CWD of the 
> > process.  If you're using a different kern.corefile setting, it's 
> > different.  You will also need to account for the %N format string (check 
> > the code for indexpos).  Given that this is far from being a hot path, it's 
> > much easier to just do a vn_fullpath() on the vnode than to deal with all 
> > the other details. 
> 
> 
> Hmm, I mean that given this code:
> 
> flags = O_CREAT | FWRITE | O_NOFOLLOW;
> NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td);
> error = vn_open_cred(&nd, &flags, cmode, oflags, td->td_ucred, NULL);
> 
> 'name' is the name, right?  Can we keep and use it?
No, not right. It is the name used for resolution using namei(), while
the path obtained from vn_fullpath() is passed to usermode. For 'name'
to be useful, it must be used in exactly the same lookup environment,
i.e. cwd/root dir at al should be the same.
___
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: r276096 - in head/sys: arm/conf conf fs/nfs fs/nfsclient modules modules/dtrace modules/dtrace/dtnfsclient modules/dtrace/dtraceall modules/nfs_common modules/nfsclient modules/nfsserv

2014-12-23 Thread Bjoern A. Zeeb

> On 23 Dec 2014, at 00:47 , Rick Macklem  wrote:
> 
> Author: rmacklem
> Date: Tue Dec 23 00:47:46 2014
> New Revision: 276096
> URL: https://svnweb.freebsd.org/changeset/base/276096
> 
> Log:
>  Remove the old NFS client and server from head,
>  which means that the NFSCLIENT and NFSSERVER
>  kernel options will no longer work. This commit
>  only removes the kernel components. Removal of
>  unused code in the user utilities will be done
>  later. This commit does not include an addition
>  to UPDATING, but that will be committed in a
>  few minutes.
> 
>  Discussed on: freebsd-fs
> 

Hi,

I see the following error currently on my (incremental) builds:

nfs_clbio.o: In function `ncl_asyncio':
/scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clbio.c:(.text+0x1974): undefined 
reference to `nfs_debug'
/scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clbio.c:(.text+0x19a2): undefined 
reference to `nfs_debug'
/scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clbio.c:(.text+0x19f9): undefined 
reference to `nfs_debug'
/scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clbio.c:(.text+0x1a93): undefined 
reference to `nfs_debug'
/scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clbio.c:(.text+0x1b0a): undefined 
reference to `nfs_debug'
nfs_clnfsiod.o:/scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clnfsiod.c:(.text+0x5d2):
 more undefined references to `nfs_debug' follow





> Deleted:
>  head/sys/modules/dtrace/dtnfsclient/
>  head/sys/modules/nfs_common/
>  head/sys/modules/nfsclient/
>  head/sys/modules/nfsserver/
>  head/sys/nfs/nfs_common.c
>  head/sys/nfsclient/nfs_bio.c
>  head/sys/nfsclient/nfs_kdtrace.c
>  head/sys/nfsclient/nfs_krpc.c
>  head/sys/nfsclient/nfs_nfsiod.c
>  head/sys/nfsclient/nfs_node.c
>  head/sys/nfsclient/nfs_subs.c
>  head/sys/nfsclient/nfs_vfsops.c
>  head/sys/nfsclient/nfs_vnops.c
>  head/sys/nfsserver/nfs_fha_old.c
>  head/sys/nfsserver/nfs_serv.c
>  head/sys/nfsserver/nfs_srvkrpc.c
>  head/sys/nfsserver/nfs_srvsubs.c
> Modified:
>  head/sys/arm/conf/DOCKSTAR
>  head/sys/arm/conf/DREAMPLUG-1001
>  head/sys/arm/conf/EA3250
>  head/sys/conf/NOTES
>  head/sys/conf/files
>  head/sys/conf/options
>  head/sys/fs/nfs/nfs_commonkrpc.c
>  head/sys/fs/nfsclient/nfs_clnode.c
>  head/sys/fs/nfsclient/nfs_clport.c
>  head/sys/fs/nfsclient/nfs_clvfsops.c
>  head/sys/modules/Makefile
>  head/sys/modules/dtrace/Makefile
>  head/sys/modules/dtrace/dtraceall/dtraceall.c
>  head/sys/nfs/bootp_subr.c
>  head/sys/sys/param.h

— 
Bjoern A. Zeeb  Charles Haddon Spurgeon:
"Friendship is one of the sweetest joys of life.  Many might have failed
 beneath the bitterness of their trial  had they not found a friend."

___
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: r276071 - in head/contrib/ntp: ntpd util

2014-12-23 Thread Ulrich Spörlein
On Mon, 2014-12-22 at 18:54:56 +, Xin LI wrote:
> Author: delphij
> Date: Mon Dec 22 18:54:55 2014
> New Revision: 276071
> URL: https://svnweb.freebsd.org/changeset/base/276071
> 
> Log:
>   Fix multiple ntp vulnerabilities.
>   
>   Reviewed by:roberto (earlier revision), philip
>   Security:   CVE-2014-9293, CVE-2014-9294
>   Security:   CVE-2014-9295, CVE-2014-9296
>   Security:   FreeBSD-SA-14:31.ntp
>   
>   Differential Revision: https://reviews.freebsd.org/D1343
> 

Hi

the latest Coverity run (which should include these patches, I think)
still flags two DEADCODEs in ntp_proto.c:



*** CID 1260388:  Logically dead code  (DEADCODE)
/contrib/ntp/ntpd/ntp_proto.c: 702 in receive()
696 if (!(rbufp->dstadr->flags & INT_MCASTOPEN)) {
697 if (AUTH(restrict_mask & RES_DONTTRUST,
698is_authentic))
699 fast_xmit(rbufp, MODE_SERVER, skeyid,
700 restrict_mask);
701 else if (is_authentic == AUTH_ERROR)
>>> CID 1260388:  Logically dead code  (DEADCODE)
>>> Execution cannot reach this statement "fast_xmit(rbufp, 4, 0U, res...".
702 fast_xmit(rbufp, MODE_SERVER, 0,
703 restrict_mask);
704 return; /* hooray */
705 }
706
707 /*
/contrib/ntp/ntpd/ntp_proto.c: 869 in receive()
863  * symmetric active response is sent. If authentication
864  * fails, send a crypto-NAK packet.
865  */
866 if (!AUTH(restrict_mask & RES_DONTTRUST, is_authentic))
867 {
868 if (is_authentic == AUTH_ERROR)
>>> CID 1260388:  Logically dead code  (DEADCODE)
>>> Execution cannot reach this statement "fast_xmit(rbufp, 1, 0U, res...".
869 fast_xmit(rbufp, MODE_ACTIVE, 0,
870 restrict_mask);
871 return; /* bad auth */
872 }
873 if (!AUTH(sys_authenticate | (restrict_mask &
874 RES_NOPEER), is_authentic)) {

___
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: r276127 - head/sys/cam/ctl

2014-12-23 Thread Alexander Motin
Author: mav
Date: Tue Dec 23 10:18:42 2014
New Revision: 276127
URL: https://svnweb.freebsd.org/changeset/base/276127

Log:
  Fix potential division by zero after r275920.
  
  Reported by:  Coverity Scan
  CID:  1260387
  MFC after:3 days

Modified:
  head/sys/cam/ctl/ctl_backend_ramdisk.c

Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c
==
--- head/sys/cam/ctl/ctl_backend_ramdisk.c  Tue Dec 23 10:07:23 2014
(r276126)
+++ head/sys/cam/ctl/ctl_backend_ramdisk.c  Tue Dec 23 10:18:42 2014
(r276127)
@@ -569,6 +569,8 @@ ctl_backend_ramdisk_create(struct ctl_be
be_lun->size_bytes = be_lun->size_blocks * blocksize;
 
be_lun->ctl_be_lun.maxlba = be_lun->size_blocks - 1;
+   be_lun->ctl_be_lun.atomicblock = UINT32_MAX;
+   be_lun->ctl_be_lun.opttxferlen = softc->rd_size / blocksize;
} else {
be_lun->ctl_be_lun.maxlba = 0;
blocksize = 0;
@@ -595,8 +597,6 @@ ctl_backend_ramdisk_create(struct ctl_be
be_lun->ctl_be_lun.flags = CTL_LUN_FLAG_PRIMARY;
if (unmap)
be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP;
-   be_lun->ctl_be_lun.atomicblock = UINT32_MAX;
-   be_lun->ctl_be_lun.opttxferlen = softc->rd_size / blocksize;
be_lun->ctl_be_lun.be_lun = be_lun;
 
if (params->flags & CTL_LUN_FLAG_ID_REQ) {
___
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: r276128 - in head: gnu/lib/libssp lib/libbsnmp/libbsnmp share/mk

2014-12-23 Thread Baptiste Daroussin
Author: bapt
Date: Tue Dec 23 10:43:35 2014
New Revision: 276128
URL: https://svnweb.freebsd.org/changeset/base/276128

Log:
  Fix build with recent binutils
  
  Recent binutils considered the .gnu.warning.symbol section as a fatal error 
when
  run with --fatal-warnings which makes any users of "insecure" functions from
  libc failing to build with recent binutils.
  
  Introduce a new macro: LD_FATAL_WARNINGS=no to run ld(1) with
  --no-fatal-warnings for the users of "insecure" functions
  
  Differential Revision:https://reviews.freebsd.org/D1320

Modified:
  head/gnu/lib/libssp/Makefile
  head/lib/libbsnmp/libbsnmp/Makefile
  head/share/mk/bsd.lib.mk

Modified: head/gnu/lib/libssp/Makefile
==
--- head/gnu/lib/libssp/MakefileTue Dec 23 10:18:42 2014
(r276127)
+++ head/gnu/lib/libssp/MakefileTue Dec 23 10:43:35 2014
(r276128)
@@ -15,6 +15,7 @@ SRCDIR=   ${GCCLIB}/libssp
 
 LIB=   ssp
 SHLIB_MAJOR=   0
+LD_FATAL_WARNINGS= no
 
 SRCS=  ssp.c gets-chk.c memcpy-chk.c memmove-chk.c mempcpy-chk.c \
memset-chk.c snprintf-chk.c sprintf-chk.c stpcpy-chk.c \

Modified: head/lib/libbsnmp/libbsnmp/Makefile
==
--- head/lib/libbsnmp/libbsnmp/Makefile Tue Dec 23 10:18:42 2014
(r276127)
+++ head/lib/libbsnmp/libbsnmp/Makefile Tue Dec 23 10:43:35 2014
(r276128)
@@ -9,6 +9,7 @@ CONTRIB= ${.CURDIR}/../../../contrib/bsn
 
 LIB=   bsnmp
 SHLIB_MAJOR=   6
+LD_FATAL_WARNINGS= no
 
 CFLAGS+= -I${CONTRIB} -DHAVE_ERR_H -DHAVE_GETADDRINFO -DHAVE_STRLCPY
 CFLAGS+= -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DQUADFMT='"llu"' -DQUADXFMT='"llx"'

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkTue Dec 23 10:18:42 2014(r276127)
+++ head/share/mk/bsd.lib.mkTue Dec 23 10:43:35 2014(r276128)
@@ -207,7 +207,12 @@ _LIBS+=${SHLIB_NAME}
 
 SOLINKOPTS=-shared -Wl,-x
 .if !defined(ALLOW_SHARED_TEXTREL)
-SOLINKOPTS+=   -Wl,--fatal-warnings -Wl,--warn-shared-textrel
+.if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no"
+SOLINKOPTS+=   -Wl,--no-fatal-warnings
+.else
+SOLINKOPTS+=   -Wl,--fatal-warnings
+.endif
+SOLINKOPTS+=   -Wl,--warn-shared-textrel
 .endif
 
 .if target(beforelinking)
___
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: r276008 - in head/sys: kern sys

2014-12-23 Thread Andriy Gapon
On 23/12/2014 11:46, Konstantin Belousov wrote:
> On Tue, Dec 23, 2014 at 10:18:43AM +0200, Andriy Gapon wrote:
>> Hmm, I mean that given this code:
>>
>> flags = O_CREAT | FWRITE | O_NOFOLLOW;
>> NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td);
>> error = vn_open_cred(&nd, &flags, cmode, oflags, td->td_ucred, NULL);
>>
>> 'name' is the name, right?  Can we keep and use it?
> No, not right. It is the name used for resolution using namei(), while
> the path obtained from vn_fullpath() is passed to usermode. For 'name'
> to be useful, it must be used in exactly the same lookup environment,
> i.e. cwd/root dir at al should be the same.

I see now. Thanks!

-- 
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: r276136 - head/sys/sys

2014-12-23 Thread Gleb Smirnoff
Author: glebius
Date: Tue Dec 23 12:26:35 2014
New Revision: 276136
URL: https://svnweb.freebsd.org/changeset/base/276136

Log:
  m_clrprotoflags() is designed to cleanup M_PROTO flags when mbufs cross
  protocol and facility boundaries.  However, now it cleans up only the
  first mbuf, while intent clearly means all mbufs in a possible chain.
  
  Differential Revision:https://reviews.freebsd.org/D1352
  Reviewed by:  rpaulo, gnn, adrian
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/sys/mbuf.h

Modified: head/sys/sys/mbuf.h
==
--- head/sys/sys/mbuf.h Tue Dec 23 12:13:31 2014(r276135)
+++ head/sys/sys/mbuf.h Tue Dec 23 12:26:35 2014(r276136)
@@ -757,7 +757,10 @@ static __inline void
 m_clrprotoflags(struct mbuf *m)
 {
 
-   m->m_flags &= ~M_PROTOFLAGS;
+   while (m) {
+   m->m_flags &= ~M_PROTOFLAGS;
+   m = m->m_next;
+   }
 }
 
 static __inline struct mbuf *
___
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: r276140 - in head/sys: conf fs/nfs fs/nfsclient

2014-12-23 Thread Rick Macklem
Author: rmacklem
Date: Tue Dec 23 14:24:36 2014
New Revision: 276140
URL: https://svnweb.freebsd.org/changeset/base/276140

Log:
  Fix kernel builds with "options NFS_DEBUG" that
  were broken by r276096. Also delete the two
  kernel options NFS_GATHERDELAY, NFS_WDELAYHASHSIZ
  which are no longer used.
  
  Reported by:  bz

Modified:
  head/sys/conf/NOTES
  head/sys/conf/options
  head/sys/fs/nfs/nfsport.h
  head/sys/fs/nfsclient/nfs.h
  head/sys/fs/nfsclient/nfs_clvfsops.c

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue Dec 23 12:45:29 2014(r276139)
+++ head/sys/conf/NOTES Tue Dec 23 14:24:36 2014(r276140)
@@ -1098,8 +1098,6 @@ options   NFS_MINATTRTIMO=3   # VREG attrib
 optionsNFS_MAXATTRTIMO=60
 optionsNFS_MINDIRATTRTIMO=30   # VDIR attrib cache timeout in sec
 optionsNFS_MAXDIRATTRTIMO=60
-optionsNFS_GATHERDELAY=10  # Default write gather delay (msec)
-optionsNFS_WDELAYHASHSIZ=16# and with this
 optionsNFS_DEBUG   # Enable NFS Debugging
 
 #

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Tue Dec 23 12:45:29 2014(r276139)
+++ head/sys/conf/options   Tue Dec 23 14:24:36 2014(r276140)
@@ -619,8 +619,6 @@ NFS_MINATTRTIMO opt_nfs.h
 NFS_MAXATTRTIMOopt_nfs.h
 NFS_MINDIRATTRTIMO opt_nfs.h
 NFS_MAXDIRATTRTIMO opt_nfs.h
-NFS_GATHERDELAYopt_nfs.h
-NFS_WDELAYHASHSIZ  opt_nfs.h
 NFS_DEBUG  opt_nfs.h
 
 # For the Bt848/Bt848A/Bt849/Bt878/Bt879 driver

Modified: head/sys/fs/nfs/nfsport.h
==
--- head/sys/fs/nfs/nfsport.h   Tue Dec 23 12:45:29 2014(r276139)
+++ head/sys/fs/nfs/nfsport.h   Tue Dec 23 14:24:36 2014(r276140)
@@ -930,24 +930,6 @@ void nfsd_mntinit(void);
 
 int newnfs_iosize(struct nfsmount *);
 
-#ifdef NFS_DEBUG
-
-extern int nfs_debug;
-#defineNFS_DEBUG_ASYNCIO   1 /* asynchronous i/o */
-#defineNFS_DEBUG_WG2 /* server write gathering */
-#defineNFS_DEBUG_RC4 /* server request caching */
-
-#defineNFS_DPF(cat, args)  \
-   do {\
-   if (nfs_debug & NFS_DEBUG_##cat) printf args;   \
-   } while (0)
-
-#else
-
-#defineNFS_DPF(cat, args)
-
-#endif
-
 int newnfs_vncmpf(struct vnode *, void *);
 
 #ifndef NFS_MINDIRATTRTIMO

Modified: head/sys/fs/nfsclient/nfs.h
==
--- head/sys/fs/nfsclient/nfs.h Tue Dec 23 12:45:29 2014(r276139)
+++ head/sys/fs/nfsclient/nfs.h Tue Dec 23 14:24:36 2014(r276140)
@@ -55,6 +55,24 @@
 #defineNFS_ISV34(v) \
(VFSTONFS((v)->v_mount)->nm_flag & (NFSMNT_NFSV3 | NFSMNT_NFSV4))
 
+#ifdef NFS_DEBUG
+
+extern int nfs_debug;
+#defineNFS_DEBUG_ASYNCIO   1 /* asynchronous i/o */
+#defineNFS_DEBUG_WG2 /* server write gathering */
+#defineNFS_DEBUG_RC4 /* server request caching */
+
+#defineNFS_DPF(cat, args)  \
+   do {\
+   if (nfs_debug & NFS_DEBUG_##cat) printf args;   \
+   } while (0)
+
+#else
+
+#defineNFS_DPF(cat, args)
+
+#endif
+
 /*
  * NFS iod threads can be in one of these three states once spawned.
  * NFSIOD_NOT_AVAILABLE - Cannot be assigned an I/O operation at this time.

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==
--- head/sys/fs/nfsclient/nfs_clvfsops.cTue Dec 23 12:45:29 2014
(r276139)
+++ head/sys/fs/nfsclient/nfs_clvfsops.cTue Dec 23 14:24:36 2014
(r276140)
@@ -100,6 +100,11 @@ SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_INITIAL
 static int nfs_tprintf_delay = NFS_TPRINTF_DELAY;
 SYSCTL_INT(_vfs_nfs, NFS_TPRINTF_DELAY,
 downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, "");
+#ifdef NFS_DEBUG
+int nfs_debug;
+SYSCTL_INT(_vfs_nfs, OID_AUTO, debug, CTLFLAG_RW, &nfs_debug, 0,
+"Toggle debug flag");
+#endif
 
 static int nfs_mountroot(struct mount *);
 static voidnfs_sec_name(char *, int *);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r276096 - in head/sys: arm/conf conf fs/nfs fs/nfsclient modules modules/dtrace modules/dtrace/dtnfsclient modules/dtrace/dtraceall modules/nfs_common modules/nfsclient modules/nfsserv

2014-12-23 Thread Rick Macklem
Bjoern A. Zeeb wrote:
> 
> > On 23 Dec 2014, at 00:47 , Rick Macklem 
> > wrote:
> > 
> > Author: rmacklem
> > Date: Tue Dec 23 00:47:46 2014
> > New Revision: 276096
> > URL: https://svnweb.freebsd.org/changeset/base/276096
> > 
> > Log:
> >  Remove the old NFS client and server from head,
> >  which means that the NFSCLIENT and NFSSERVER
> >  kernel options will no longer work. This commit
> >  only removes the kernel components. Removal of
> >  unused code in the user utilities will be done
> >  later. This commit does not include an addition
> >  to UPDATING, but that will be committed in a
> >  few minutes.
> > 
> >  Discussed on: freebsd-fs
> > 
> 
> Hi,
> 
> I see the following error currently on my (incremental) builds:
> 
> nfs_clbio.o: In function `ncl_asyncio':
> /scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clbio.c:(.text+0x1974):
> undefined reference to `nfs_debug'
> /scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clbio.c:(.text+0x19a2):
> undefined reference to `nfs_debug'
> /scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clbio.c:(.text+0x19f9):
> undefined reference to `nfs_debug'
> /scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clbio.c:(.text+0x1a93):
> undefined reference to `nfs_debug'
> /scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clbio.c:(.text+0x1b0a):
> undefined reference to `nfs_debug'
> nfs_clnfsiod.o:/scratch/tmp/bz/head.svn/sys/fs/nfsclient/nfs_clnfsiod.c:(.text+0x5d2):
> more undefined references to `nfs_debug' follow
> 
Oops, sorry about that.

Should be fixed by r276140.

Thanks for reporting it, rick

> 
> 
> 
> 
> > Deleted:
> >  head/sys/modules/dtrace/dtnfsclient/
> >  head/sys/modules/nfs_common/
> >  head/sys/modules/nfsclient/
> >  head/sys/modules/nfsserver/
> >  head/sys/nfs/nfs_common.c
> >  head/sys/nfsclient/nfs_bio.c
> >  head/sys/nfsclient/nfs_kdtrace.c
> >  head/sys/nfsclient/nfs_krpc.c
> >  head/sys/nfsclient/nfs_nfsiod.c
> >  head/sys/nfsclient/nfs_node.c
> >  head/sys/nfsclient/nfs_subs.c
> >  head/sys/nfsclient/nfs_vfsops.c
> >  head/sys/nfsclient/nfs_vnops.c
> >  head/sys/nfsserver/nfs_fha_old.c
> >  head/sys/nfsserver/nfs_serv.c
> >  head/sys/nfsserver/nfs_srvkrpc.c
> >  head/sys/nfsserver/nfs_srvsubs.c
> > Modified:
> >  head/sys/arm/conf/DOCKSTAR
> >  head/sys/arm/conf/DREAMPLUG-1001
> >  head/sys/arm/conf/EA3250
> >  head/sys/conf/NOTES
> >  head/sys/conf/files
> >  head/sys/conf/options
> >  head/sys/fs/nfs/nfs_commonkrpc.c
> >  head/sys/fs/nfsclient/nfs_clnode.c
> >  head/sys/fs/nfsclient/nfs_clport.c
> >  head/sys/fs/nfsclient/nfs_clvfsops.c
> >  head/sys/modules/Makefile
> >  head/sys/modules/dtrace/Makefile
> >  head/sys/modules/dtrace/dtraceall/dtraceall.c
> >  head/sys/nfs/bootp_subr.c
> >  head/sys/sys/param.h
> 
> —
> Bjoern A. Zeeb  Charles Haddon
> Spurgeon:
> "Friendship is one of the sweetest joys of life.  Many might have
> failed
>  beneath the bitterness of their trial  had they not found a friend."
> 
> 
___
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: r276141 - head/sys/cam/ctl

2014-12-23 Thread Alexander Motin
Author: mav
Date: Tue Dec 23 15:18:28 2014
New Revision: 276141
URL: https://svnweb.freebsd.org/changeset/base/276141

Log:
  Hide block device VPD pages for non-block devices.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==
--- head/sys/cam/ctl/ctl.c  Tue Dec 23 14:24:36 2014(r276140)
+++ head/sys/cam/ctl/ctl.c  Tue Dec 23 15:18:28 2014(r276141)
@@ -9599,6 +9599,7 @@ ctl_inquiry_evpd_supported(struct ctl_sc
struct scsi_vpd_supported_pages *pages;
int sup_page_size;
struct ctl_lun *lun;
+   int p;
 
lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
 
@@ -9632,27 +9633,30 @@ ctl_inquiry_evpd_supported(struct ctl_sc
else
pages->device = (SID_QUAL_LU_OFFLINE << 5) | T_DIRECT;
 
-   pages->length = SCSI_EVPD_NUM_SUPPORTED_PAGES;
+   p = 0;
/* Supported VPD pages */
-   pages->page_list[0] = SVPD_SUPPORTED_PAGES;
+   pages->page_list[p++] = SVPD_SUPPORTED_PAGES;
/* Serial Number */
-   pages->page_list[1] = SVPD_UNIT_SERIAL_NUMBER;
+   pages->page_list[p++] = SVPD_UNIT_SERIAL_NUMBER;
/* Device Identification */
-   pages->page_list[2] = SVPD_DEVICE_ID;
+   pages->page_list[p++] = SVPD_DEVICE_ID;
/* Extended INQUIRY Data */
-   pages->page_list[3] = SVPD_EXTENDED_INQUIRY_DATA;
+   pages->page_list[p++] = SVPD_EXTENDED_INQUIRY_DATA;
/* Mode Page Policy */
-   pages->page_list[4] = SVPD_MODE_PAGE_POLICY;
+   pages->page_list[p++] = SVPD_MODE_PAGE_POLICY;
/* SCSI Ports */
-   pages->page_list[5] = SVPD_SCSI_PORTS;
+   pages->page_list[p++] = SVPD_SCSI_PORTS;
/* Third-party Copy */
-   pages->page_list[6] = SVPD_SCSI_TPC;
-   /* Block limits */
-   pages->page_list[7] = SVPD_BLOCK_LIMITS;
-   /* Block Device Characteristics */
-   pages->page_list[8] = SVPD_BDC;
-   /* Logical Block Provisioning */
-   pages->page_list[9] = SVPD_LBP;
+   pages->page_list[p++] = SVPD_SCSI_TPC;
+   if (lun != NULL && lun->be_lun->lun_type == T_DIRECT) {
+   /* Block limits */
+   pages->page_list[p++] = SVPD_BLOCK_LIMITS;
+   /* Block Device Characteristics */
+   pages->page_list[p++] = SVPD_BDC;
+   /* Logical Block Provisioning */
+   pages->page_list[p++] = SVPD_LBP;
+   }
+   pages->length = p;
 
ctl_set_success(ctsio);
ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
@@ -10234,13 +10238,12 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio *
 static int
 ctl_inquiry_evpd(struct ctl_scsiio *ctsio)
 {
+   struct ctl_lun *lun;
struct scsi_inquiry *cdb;
int alloc_len, retval;
 
+   lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
cdb = (struct scsi_inquiry *)ctsio->cdb;
-
-   retval = CTL_RETVAL_COMPLETE;
-
alloc_len = scsi_2btoul(cdb->length);
 
switch (cdb->page_code) {
@@ -10266,15 +10269,22 @@ ctl_inquiry_evpd(struct ctl_scsiio *ctsi
retval = ctl_inquiry_evpd_tpc(ctsio, alloc_len);
break;
case SVPD_BLOCK_LIMITS:
+   if (lun == NULL || lun->be_lun->lun_type != T_DIRECT)
+   goto err;
retval = ctl_inquiry_evpd_block_limits(ctsio, alloc_len);
break;
case SVPD_BDC:
+   if (lun == NULL || lun->be_lun->lun_type != T_DIRECT)
+   goto err;
retval = ctl_inquiry_evpd_bdc(ctsio, alloc_len);
break;
case SVPD_LBP:
+   if (lun == NULL || lun->be_lun->lun_type != T_DIRECT)
+   goto err;
retval = ctl_inquiry_evpd_lbp(ctsio, alloc_len);
break;
default:
+err:
ctl_set_invalid_field(ctsio,
  /*sks_valid*/ 1,
  /*command*/ 1,
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r276142 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 cddl/dev/dtrace/mips cddl/dev/dtrace/powerpc i386/i386 mips/mips powerpc/aim sys

2014-12-23 Thread Mark Johnston
Author: markj
Date: Tue Dec 23 15:38:19 2014
New Revision: 276142
URL: https://svnweb.freebsd.org/changeset/base/276142

Log:
  Restore the trap type argument to the DTrace trap hook, removed in r268600.
  It's redundant at the moment since it can be obtained from the trapframe
  on the architectures where DTrace is supported, but this won't be the case
  with ARM.

Modified:
  head/sys/amd64/amd64/trap.c
  head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
  head/sys/cddl/dev/dtrace/mips/dtrace_subr.c
  head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
  head/sys/i386/i386/trap.c
  head/sys/mips/mips/trap.c
  head/sys/powerpc/aim/trap.c
  head/sys/sys/dtrace_bsd.h

Modified: head/sys/amd64/amd64/trap.c
==
--- head/sys/amd64/amd64/trap.c Tue Dec 23 15:18:28 2014(r276141)
+++ head/sys/amd64/amd64/trap.c Tue Dec 23 15:38:19 2014(r276142)
@@ -614,7 +614,8 @@ trap_check(struct trapframe *frame)
 {
 
 #ifdef KDTRACE_HOOKS
-   if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame))
+   if (dtrace_trap_func != NULL &&
+   (*dtrace_trap_func)(frame, frame->tf_trapno) != 0)
return;
 #endif
trap(frame);

Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cTue Dec 23 15:18:28 
2014(r276141)
+++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.cTue Dec 23 15:38:19 
2014(r276142)
@@ -464,7 +464,7 @@ dtrace_gethrestime(void)
 
 /* Function to handle DTrace traps during probes. See amd64/amd64/trap.c. */
 int
-dtrace_trap(struct trapframe *frame)
+dtrace_trap(struct trapframe *frame, u_int type)
 {
/*
 * A trap can occur while DTrace executes a probe. Before
@@ -480,7 +480,7 @@ dtrace_trap(struct trapframe *frame)
 * There are only a couple of trap types that are expected.
 * All the rest will be handled in the usual way.
 */
-   switch (frame->tf_trapno) {
+   switch (type) {
/* General protection fault. */
case T_PROTFLT:
/* Flag an illegal operation. */

Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue Dec 23 15:18:28 2014
(r276141)
+++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue Dec 23 15:38:19 2014
(r276142)
@@ -473,7 +473,7 @@ dtrace_gethrestime(void)
 
 /* Function to handle DTrace traps during probes. See i386/i386/trap.c */
 int
-dtrace_trap(struct trapframe *frame)
+dtrace_trap(struct trapframe *frame, u_int type)
 {
/*
 * A trap can occur while DTrace executes a probe. Before
@@ -489,7 +489,7 @@ dtrace_trap(struct trapframe *frame)
 * There are only a couple of trap types that are expected.
 * All the rest will be handled in the usual way.
 */
-   switch (frame->tf_trapno) {
+   switch (type) {
/* General protection fault. */
case T_PROTFLT:
/* Flag an illegal operation. */

Modified: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Tue Dec 23 15:18:28 2014
(r276141)
+++ head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Tue Dec 23 15:38:19 2014
(r276142)
@@ -137,11 +137,8 @@ dtrace_gethrestime(void)
 
 /* Function to handle DTrace traps during probes. See amd64/amd64/trap.c */
 int
-dtrace_trap(struct trapframe *frame)
+dtrace_trap(struct trapframe *frame, u_int type)
 {
-   u_int type;
-
-   type = (trapframe->cause & MIPS_CR_EXC_CODE) >> MIPS_CR_EXC_CODE_SHIFT;
 
/*
 * A trap can occur while DTrace executes a probe. Before

Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
==
--- head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c  Tue Dec 23 15:18:28 
2014(r276141)
+++ head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c  Tue Dec 23 15:38:19 
2014(r276142)
@@ -262,8 +262,9 @@ dtrace_gethrestime(void)
 
 /* Function to handle DTrace traps during probes. See powerpc/powerpc/trap.c */
 int
-dtrace_trap(struct trapframe *frame)
+dtrace_trap(struct trapframe *frame, u_int type)
 {
+
/*
 * A trap can occur while DTrace executes a probe. Before
 * executing the probe, DTrace blocks re-scheduling and sets
@@ -278,7 +279,7 @@ dtrace_trap(struct trapframe *frame)
 * There are only a couple of trap types that are expected.
 * All the rest will be handled in 

svn commit: r276143 - head/lib/libproc

2014-12-23 Thread Mark Johnston
Author: markj
Date: Tue Dec 23 15:40:57 2014
New Revision: 276143
URL: https://svnweb.freebsd.org/changeset/base/276143

Log:
  Fix a memory leak that occured when looking up CTF info for a symbol.

Modified:
  head/lib/libproc/proc_sym.c

Modified: head/lib/libproc/proc_sym.c
==
--- head/lib/libproc/proc_sym.c Tue Dec 23 15:38:19 2014(r276142)
+++ head/lib/libproc/proc_sym.c Tue Dec 23 15:40:57 2014(r276143)
@@ -501,13 +501,16 @@ ctf_file_t *
 proc_name2ctf(struct proc_handle *p, const char *name)
 {
 #ifndef NO_CTF
+   ctf_file_t *ctf;
prmap_t *map;
int error;
 
if ((map = proc_name2map(p, name)) == NULL)
return (NULL);
 
-   return (ctf_open(map->pr_mapname, &error));
+   ctf = ctf_open(map->pr_mapname, &error);
+   free(map);
+   return (ctf);
 #else
(void)p;
(void)name;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r276145 - in head/sys/boot: arm/uboot powerpc/uboot

2014-12-23 Thread Ian Lepore
Author: ian
Date: Tue Dec 23 15:42:34 2014
New Revision: 276145
URL: https://svnweb.freebsd.org/changeset/base/276145

Log:
  Convert a couple lingering NO_FORTH conditionals to test MK_FORTH.

Modified:
  head/sys/boot/arm/uboot/Makefile
  head/sys/boot/powerpc/uboot/Makefile

Modified: head/sys/boot/arm/uboot/Makefile
==
--- head/sys/boot/arm/uboot/MakefileTue Dec 23 15:42:33 2014
(r276144)
+++ head/sys/boot/arm/uboot/MakefileTue Dec 23 15:42:34 2014
(r276145)
@@ -76,7 +76,7 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt
 LIBFDT=${.OBJDIR}/../../fdt/libfdt.a
 .endif
 
-.if !defined(NO_FORTH)
+.if ${MK_FORTH} != "no"
 # Enable BootForth
 BOOT_FORTH=yes
 CFLAGS+=   -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/arm

Modified: head/sys/boot/powerpc/uboot/Makefile
==
--- head/sys/boot/powerpc/uboot/MakefileTue Dec 23 15:42:33 2014
(r276144)
+++ head/sys/boot/powerpc/uboot/MakefileTue Dec 23 15:42:34 2014
(r276145)
@@ -66,7 +66,7 @@ LIBUBOOT_FDT= ${.OBJDIR}/../../uboot/fdt
 LIBFDT=${.OBJDIR}/../../fdt/libfdt.a
 .endif
 
-.if !defined(NO_FORTH)
+.if ${MK_FORTH} != "no"
 # Enable BootForth
 BOOT_FORTH=yes
 CFLAGS+=   -DBOOT_FORTH -I${.CURDIR}/../../ficl 
-I${.CURDIR}/../../ficl/powerpc
___
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: r276144 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2014-12-23 Thread Mark Johnston
Author: markj
Date: Tue Dec 23 15:42:33 2014
New Revision: 276144
URL: https://svnweb.freebsd.org/changeset/base/276144

Log:
  We can stop iterating once we've found the DOF section.
  
  Submitted by: Fedor Indutny 

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c   Tue Dec 23 
15:40:57 2014(r276143)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c   Tue Dec 23 
15:42:33 2014(r276144)
@@ -171,6 +171,7 @@ dtrace_dof_init(void)
if (s != NULL && strcmp(s, ".SUNW_dof") == 0) {
dofdata = elf_getdata(scn, NULL);
dof = dofdata->d_buf;
+   break;
}
}
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r276142 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 cddl/dev/dtrace/mips cddl/dev/dtrace/powerpc i386/i386 mips/mips powerpc/aim sys

2014-12-23 Thread Ian Lepore
On Tue, 2014-12-23 at 15:38 +, Mark Johnston wrote:
> Author: markj
> Date: Tue Dec 23 15:38:19 2014
> New Revision: 276142
> URL: https://svnweb.freebsd.org/changeset/base/276142
> 
> Log:
>   Restore the trap type argument to the DTrace trap hook, removed in r268600.
>   It's redundant at the moment since it can be obtained from the trapframe
>   on the architectures where DTrace is supported, but this won't be the case
>   with ARM.
> 
> Modified:
>   head/sys/amd64/amd64/trap.c
>   head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
>   head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
>   head/sys/cddl/dev/dtrace/mips/dtrace_subr.c
>   head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
>   head/sys/i386/i386/trap.c
>   head/sys/mips/mips/trap.c
>   head/sys/powerpc/aim/trap.c
>   head/sys/sys/dtrace_bsd.h
> 

Wouldn't it have been easier to just add the field to the trapframe for
arm?  iirc we have an unused padding field in the struct already just
for ABI alignment, it could go there.

-- Ian



___
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: r276146 - in head/sys/boot/amd64: boot1.efi efi

2014-12-23 Thread Ed Maste
Author: emaste
Date: Tue Dec 23 15:58:45 2014
New Revision: 276146
URL: https://svnweb.freebsd.org/changeset/base/276146

Log:
  Use explicit --output-target to set EFI file format
  
  According to objcopy(1) --target is for use where the input and output
  formats are the same ("no translation"). In practice it does detect the
  input format in any case, but be explicit that we're specifying the
  output format as we are translating from ELF to EFI PE format.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/boot/amd64/boot1.efi/Makefile
  head/sys/boot/amd64/efi/Makefile

Modified: head/sys/boot/amd64/boot1.efi/Makefile
==
--- head/sys/boot/amd64/boot1.efi/Makefile  Tue Dec 23 15:42:34 2014
(r276145)
+++ head/sys/boot/amd64/boot1.efi/Makefile  Tue Dec 23 15:58:45 2014
(r276146)
@@ -51,7 +51,7 @@ boot1.efi: loader.sym
${OBJCOPY} -j .text -j .sdata -j .data \
-j .dynamic -j .dynsym -j .rel.dyn \
-j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
-   --target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
+   --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
 
 CFLAGS+=   -I${.CURDIR}/../../common
 

Modified: head/sys/boot/amd64/efi/Makefile
==
--- head/sys/boot/amd64/efi/MakefileTue Dec 23 15:42:34 2014
(r276145)
+++ head/sys/boot/amd64/efi/MakefileTue Dec 23 15:58:45 2014
(r276146)
@@ -81,7 +81,7 @@ loader.efi: loader.sym
${OBJCOPY} -j .text -j .sdata -j .data \
-j .dynamic -j .dynsym -j .rel.dyn \
-j .rela.dyn -j .reloc -j .eh_frame -j set_Xcommand_set \
-   --target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
+   --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET}
 
 LIBEFI=${.OBJDIR}/../../efi/libefi/libefi.a
 CFLAGS+=   -I${.CURDIR}/../../common
___
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: r276147 - head/sys/boot/amd64/boot1.efi

2014-12-23 Thread Ed Maste
Author: emaste
Date: Tue Dec 23 16:00:25 2014
New Revision: 276147
URL: https://svnweb.freebsd.org/changeset/base/276147

Log:
  Update comment: only one file in the FAT file system EFI boot image
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/boot/amd64/boot1.efi/generate-fat.sh

Modified: head/sys/boot/amd64/boot1.efi/generate-fat.sh
==
--- head/sys/boot/amd64/boot1.efi/generate-fat.sh   Tue Dec 23 15:58:45 
2014(r276146)
+++ head/sys/boot/amd64/boot1.efi/generate-fat.sh   Tue Dec 23 16:00:25 
2014(r276147)
@@ -34,10 +34,10 @@ umount stub
 mdconfig -d -u $DEVICE
 rmdir stub
 
-# Locate the offsets of the two fake files
+# Locate the offset of the fake file
 BOOT1_OFFSET=$(hd $OUTPUT_FILE | grep 'Boot1 START' | cut -f 1 -d ' ')
 
-# Convert to numbers of blocks
+# Convert to number of blocks
 BOOT1_OFFSET=$(echo 0x$BOOT1_OFFSET | awk '{printf("%x\n",$1/512);}')
 
 echo '# This file autogenerated by generate-fat.sh - DO NOT EDIT' > 
Makefile.fat
___
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: r276142 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 cddl/dev/dtrace/mips cddl/dev/dtrace/powerpc i386/i386 mips/mips powerpc/aim sys

2014-12-23 Thread Mark Johnston
On Tue, Dec 23, 2014 at 08:45:57AM -0700, Ian Lepore wrote:
> On Tue, 2014-12-23 at 15:38 +, Mark Johnston wrote:
> > Author: markj
> > Date: Tue Dec 23 15:38:19 2014
> > New Revision: 276142
> > URL: https://svnweb.freebsd.org/changeset/base/276142
> > 
> > Log:
> >   Restore the trap type argument to the DTrace trap hook, removed in 
> > r268600.
> >   It's redundant at the moment since it can be obtained from the trapframe
> >   on the architectures where DTrace is supported, but this won't be the case
> >   with ARM.
> > 
> > Modified:
> >   head/sys/amd64/amd64/trap.c
> >   head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
> >   head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
> >   head/sys/cddl/dev/dtrace/mips/dtrace_subr.c
> >   head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c
> >   head/sys/i386/i386/trap.c
> >   head/sys/mips/mips/trap.c
> >   head/sys/powerpc/aim/trap.c
> >   head/sys/sys/dtrace_bsd.h
> > 
> 
> Wouldn't it have been easier to just add the field to the trapframe for
> arm?  iirc we have an unused padding field in the struct already just
> for ABI alignment, it could go there.

In this case, the extra argument will be the fault address AND'ed with
FAULT_TYPE_MASK, and the hook is only potentially called in the data abort
handler, so this extra field would be unused for other exceptions (and
unused for data aborts unless DTrace is active). Maybe that's ok, but
restoring the extra hook argument seemed like a less intrusive way to go
to me.

-Mark
___
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: r276148 - in head: . sys/net sys/netinet sys/netinet6

2014-12-23 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec 23 16:17:37 2014
New Revision: 276148
URL: https://svnweb.freebsd.org/changeset/base/276148

Log:
  Remove in_gif.h and in6_gif.h files. They only contain function
  declarations used by gif(4). Instead declare these functions in C files.
  Also make some variables static.

Deleted:
  head/sys/netinet/in_gif.h
  head/sys/netinet6/in6_gif.h
Modified:
  head/ObsoleteFiles.inc
  head/sys/net/if_gif.c
  head/sys/netinet/in_gif.c
  head/sys/netinet6/in6_gif.c

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Dec 23 16:00:25 2014(r276147)
+++ head/ObsoleteFiles.inc  Tue Dec 23 16:17:37 2014(r276148)
@@ -38,6 +38,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20141223: remove in6_gif.h and in_gif.h
+OLD_FILES+=usr/include/netinet/in_gif.h
+OLD_FILES+=usr/include/netinet6/in6_gif.h
 # 20141202: update to mandoc CVS 20141201
 OLD_FILES+=usr.bin/preconv
 OLD_FILES+=share/man/man1/preconv.1.gz

Modified: head/sys/net/if_gif.c
==
--- head/sys/net/if_gif.c   Tue Dec 23 16:00:25 2014(r276147)
+++ head/sys/net/if_gif.c   Tue Dec 23 16:17:37 2014(r276148)
@@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #ifdef INET
 #include 
-#include 
 #include 
 #endif /* INET */
 
@@ -85,7 +84,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #endif /* INET6 */
 
@@ -120,6 +118,16 @@ void   (*ng_gif_input_orphan_p)(struct ifn
 void   (*ng_gif_attach_p)(struct ifnet *ifp);
 void   (*ng_gif_detach_p)(struct ifnet *ifp);
 
+#ifdef INET
+extern int in_gif_output(struct ifnet *, struct mbuf *, int, uint8_t);
+extern int in_gif_encapcheck(const struct mbuf *, int, int, void *);
+extern int in_gif_attach(struct gif_softc *);
+#endif
+#ifdef INET6
+extern int in6_gif_output(struct ifnet *, struct mbuf *, int, uint8_t);
+extern int in6_gif_encapcheck(const struct mbuf *, int, int, void *);
+extern int in6_gif_attach(struct gif_softc *);
+#endif
 static int gif_set_tunnel(struct ifnet *, struct sockaddr *,
 struct sockaddr *);
 static voidgif_delete_tunnel(struct ifnet *);

Modified: head/sys/netinet/in_gif.c
==
--- head/sys/netinet/in_gif.c   Tue Dec 23 16:00:25 2014(r276147)
+++ head/sys/netinet/in_gif.c   Tue Dec 23 16:17:37 2014(r276148)
@@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -68,11 +67,16 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+int in_gif_output(struct ifnet *, struct mbuf *, int, uint8_t);
+int in_gif_encapcheck(const struct mbuf *, int, int, void *);
+int in_gif_attach(struct gif_softc *);
+
 static int gif_validate4(const struct ip *, struct gif_softc *,
struct ifnet *);
+static int in_gif_input(struct mbuf **, int *, int);
 
 extern  struct domain inetdomain;
-struct protosw in_gif_protosw = {
+static struct protosw in_gif_protosw = {
.pr_type =  SOCK_RAW,
.pr_domain =&inetdomain,
.pr_protocol =  0/* IPPROTO_IPV[46] */,
@@ -83,7 +87,8 @@ struct protosw in_gif_protosw = {
.pr_usrreqs =   &rip_usrreqs
 };
 
-VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL;
+#define GIF_TTL30
+static VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL;
 #defineV_ip_gif_ttlVNET(ip_gif_ttl)
 SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_VNET | CTLFLAG_RW,
&VNET_NAME(ip_gif_ttl), 0, "");
@@ -133,7 +138,7 @@ in_gif_output(struct ifnet *ifp, struct 
return (ip_output(m, NULL, NULL, 0, NULL, NULL));
 }
 
-int
+static int
 in_gif_input(struct mbuf **mp, int *offp, int proto)
 {
struct mbuf *m = *mp;

Modified: head/sys/netinet6/in6_gif.c
==
--- head/sys/netinet6/in6_gif.c Tue Dec 23 16:00:25 2014(r276147)
+++ head/sys/netinet6/in6_gif.c Tue Dec 23 16:17:37 2014(r276148)
@@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$");
 #ifdef INET6
 #include 
 #include 
-#include 
 #include 
 #endif
 #include 
@@ -74,18 +73,24 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM;
+#define GIF_HLIM   30
+static VNET_DEFINE(int, ip6_gif_hlim) = GIF_HLIM;
 #defineV_ip6_gif_hlim  VNET(ip6_gif_hlim)
 
 SYSCTL_DECL(_net_inet6_ip6);
 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_VNET | 
CTLFLAG_RW,
 &VNET_NAME(ip6_gif_hlim), 0, "");
 
+int in6_gif_output(struct ifnet *, struct mbuf *, int, uint8_t);
+int in6_gif_encapcheck(const struct mbuf *, int, int, void *);
+int in6_gif_attach(struct gif_softc *);
+
 static int gif_validate6(c

svn commit: r276150 - head/sys/dev/ath

2014-12-23 Thread Adrian Chadd
Author: adrian
Date: Tue Dec 23 18:48:45 2014
New Revision: 276150
URL: https://svnweb.freebsd.org/changeset/base/276150

Log:
  Bump the valid GPIO range for rfkill up from 8 to 16.
  
  AR5416 and later NICs have more than 8 (Well, more than 6) GPIO pins.
  So to support rfkill on these NICs we need to bump this up or the
  rfkill GPIO pin may get reset to the wrong value.
  
  Noticed by: Anthony Jenkins 

Modified:
  head/sys/dev/ath/if_ath_sysctl.c

Modified: head/sys/dev/ath/if_ath_sysctl.c
==
--- head/sys/dev/ath/if_ath_sysctl.cTue Dec 23 16:33:44 2014
(r276149)
+++ head/sys/dev/ath/if_ath_sysctl.cTue Dec 23 18:48:45 2014
(r276150)
@@ -446,7 +446,15 @@ ath_sysctl_rfsilent(SYSCTL_HANDLER_ARGS)
return error;
if (!ath_hal_setrfsilent(sc->sc_ah, rfsilent))
return EINVAL;
-   sc->sc_rfsilentpin = rfsilent & 0x1c;
+   /*
+* Earlier chips (< AR5212) have up to 8 GPIO
+* pins exposed.
+*
+* AR5416 and later chips have many more GPIO
+* pins (up to 16) so the mask is expanded to
+* four bits.
+*/
+   sc->sc_rfsilentpin = rfsilent & 0x3c;
sc->sc_rfsilentpol = (rfsilent & 0x2) != 0;
return 0;
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2014-12-23 Thread Luiz Otavio O Souza
Author: loos
Date: Tue Dec 23 19:31:56 2014
New Revision: 276151
URL: https://svnweb.freebsd.org/changeset/base/276151

Log:
  Do not return the total number of available pins but the maximum pin number
  we can cope.
  
  Previously the returned value could prevent access to some of the pins.

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

Modified: head/sys/arm/ti/ti_gpio.c
==
--- head/sys/arm/ti/ti_gpio.c   Tue Dec 23 18:48:45 2014(r276150)
+++ head/sys/arm/ti/ti_gpio.c   Tue Dec 23 19:31:56 2014(r276151)
@@ -293,19 +293,8 @@ ti_gpio_intr_clr(struct ti_gpio_softc *s
 static int
 ti_gpio_pin_max(device_t dev, int *maxpin)
 {
-   struct ti_gpio_softc *sc = device_get_softc(dev);
-   unsigned int i;
-   unsigned int banks = 0;
-
-   /* Calculate how many valid banks we have and then multiply that by 32 
to
-* give use the total number of pins.
-*/
-   for (i = 0; i < ti_max_gpio_banks(); i++) {
-   if (sc->sc_mem_res[i] != NULL)
-   banks++;
-   }
 
-   *maxpin = (banks * PINS_PER_BANK) - 1;
+   *maxpin = ti_max_gpio_banks() * PINS_PER_BANK - 1;
 
return (0);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r276152 - in head: . sys/net

2014-12-23 Thread Andrey V. Elsukov
Author: ae
Date: Tue Dec 23 20:54:59 2014
New Revision: 276152
URL: https://svnweb.freebsd.org/changeset/base/276152

Log:
  Remove if_stf.h. It contains only one function declaration used by if_stf(4).
  Also make in_stf_protosw structure static.

Deleted:
  head/sys/net/if_stf.h
Modified:
  head/ObsoleteFiles.inc
  head/sys/net/if_stf.c

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Tue Dec 23 19:31:56 2014(r276151)
+++ head/ObsoleteFiles.inc  Tue Dec 23 20:54:59 2014(r276152)
@@ -38,7 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
-# 20141223: remove in6_gif.h and in_gif.h
+# 20141223: remove in6_gif.h, in_gif.h and if_stf.h
+OLD_FILES+=usr/include/net/if_stf.h
 OLD_FILES+=usr/include/netinet/in_gif.h
 OLD_FILES+=usr/include/netinet6/in6_gif.h
 # 20141202: update to mandoc CVS 20141201

Modified: head/sys/net/if_stf.c
==
--- head/sys/net/if_stf.c   Tue Dec 23 19:31:56 2014(r276151)
+++ head/sys/net/if_stf.c   Tue Dec 23 20:54:59 2014(r276152)
@@ -99,7 +99,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
@@ -156,7 +155,8 @@ static MALLOC_DEFINE(M_STF, stfname, "6t
 static const int ip_stf_ttl = 40;
 
 extern  struct domain inetdomain;
-struct protosw in_stf_protosw = {
+static int in_stf_input(struct mbuf **, int *, int);
+static struct protosw in_stf_protosw = {
.pr_type =  SOCK_RAW,
.pr_domain =&inetdomain,
.pr_protocol =  IPPROTO_IPV6,
@@ -620,7 +620,7 @@ stf_checkaddr6(sc, in6, inifp)
return 0;
 }
 
-int
+static int
 in_stf_input(struct mbuf **mp, int *offp, int proto)
 {
struct stf_softc *sc;
___
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: r276161 - head/sys/boot/fdt/dts/arm

2014-12-23 Thread Ian Lepore
Author: ian
Date: Wed Dec 24 01:10:53 2014
New Revision: 276161
URL: https://svnweb.freebsd.org/changeset/base/276161

Log:
  Revert r276101, it didn't fix the problem and causes a compile error
  (nested comment blocks).

Modified:
  head/sys/boot/fdt/dts/arm/rpi.dts

Modified: head/sys/boot/fdt/dts/arm/rpi.dts
==
--- head/sys/boot/fdt/dts/arm/rpi.dts   Tue Dec 23 23:43:20 2014
(r276160)
+++ head/sys/boot/fdt/dts/arm/rpi.dts   Wed Dec 24 01:10:53 2014
(r276161)
@@ -35,7 +35,6 @@
 
memreserve = <0x0800 0x0800>;   /* Set by VideoCore */
 
-   /*
cpus {
#address-cells = <1>;
#size-cells = <0>;
@@ -46,7 +45,6 @@
clock-frequency = <7>;  /* 700MHz */
};
};
-   */
 
memory {
device_type = "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"


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

2014-12-23 Thread Ian Lepore
Author: ian
Date: Wed Dec 24 01:19:11 2014
New Revision: 276162
URL: https://svnweb.freebsd.org/changeset/base/276162

Log:
  Don't assume required FDT properties are present.

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

Modified: head/sys/dev/ofw/ofw_cpu.c
==
--- head/sys/dev/ofw/ofw_cpu.c  Wed Dec 24 01:10:53 2014(r276161)
+++ head/sys/dev/ofw/ofw_cpu.c  Wed Dec 24 01:19:11 2014(r276162)
@@ -171,7 +171,7 @@ ofw_cpu_probe(device_t dev)
 {
const char *type = ofw_bus_get_type(dev);
 
-   if (strcmp(type, "cpu") != 0)
+   if (type == NULL || strcmp(type, "cpu") != 0)
return (ENXIO);
 
device_set_desc(dev, "Open Firmware CPU");
@@ -182,12 +182,20 @@ static int
 ofw_cpu_attach(device_t dev)
 {
struct ofw_cpu_softc *sc;
+   phandle_t node;
uint32_t cell;
 
sc = device_get_softc(dev);
-   OF_getprop(ofw_bus_get_node(dev), "reg", &cell, sizeof(cell));
+   node = ofw_bus_get_node(dev);
+   if (OF_getencprop(node, "reg", &cell, sizeof(cell)) < 0) {
+   cell = device_get_unit(dev);
+   device_printf(dev, "missing 'reg' property, using %u\n", cell);
+   }
sc->sc_cpu_pcpu = pcpu_find(cell);
-   OF_getprop(ofw_bus_get_node(dev), "clock-frequency", &cell, 
sizeof(cell));
+   if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) < 0) {
+   device_printf(dev, "missing 'clock-frequency' property\n");
+   return (ENXIO);
+   }
sc->sc_nominal_mhz = cell / 100; /* convert to MHz */
 
bus_generic_probe(dev);
___
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: r276161 - head/sys/boot/fdt/dts/arm

2014-12-23 Thread Rui Paulo
On Dec 23, 2014, at 17:10, Ian Lepore  wrote:
> 
> Author: ian
> Date: Wed Dec 24 01:10:53 2014
> New Revision: 276161
> URL: https://svnweb.freebsd.org/changeset/base/276161
> 
> Log:
>  Revert r276101, it didn't fix the problem and causes a compile error
>  (nested comment blocks).

Ew.  I thought I had compiled it in the kernel.

--
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: r276163 - head/etc

2014-12-23 Thread Steven Hartland
Author: smh
Date: Wed Dec 24 01:50:44 2014
New Revision: 276163
URL: https://svnweb.freebsd.org/changeset/base/276163

Log:
  Allow info to display correctly in for varying tabstop settings
  
  The SAMPLE message and notes where tab seperated for some parts and hence
  displayed incorrectly unless tabstop was set to 8. Switch to spaces to it
  displays correctly independent of the tabstop setting.
  
  Sponsored by: Multiplay

Modified:
  head/etc/hosts.allow

Modified: head/etc/hosts.allow
==
--- head/etc/hosts.allowWed Dec 24 01:19:11 2014(r276162)
+++ head/etc/hosts.allowWed Dec 24 01:50:44 2014(r276163)
@@ -4,15 +4,15 @@
 #
 # NOTE: The hosts.deny file is deprecated.
 #   Place both 'allow' and 'deny' rules in the hosts.allow file.
-#  See hosts_options(5) for the format of this file.
-#  hosts_access(5) no longer fully applies.
-
-#   _  _  _
-#  | | __  __   __ _   _ __ ____ __   | |   ___  | |
-#  |  _|   \ \/ /  / _` | | '_ ` _ \  | '_ \  | |  / _ \ | |
-#  | |___   >  <  | (_| | | | | | | | | |_) | | | |  __/ |_|
-#  |_| /_/\_\  \__,_| |_| |_| |_| | .__/  |_|  \___| (_)
-# |_|
+#   See hosts_options(5) for the format of this file.
+#   hosts_access(5) no longer fully applies.
+#
+#   _  _  _
+#  | | __  __   __ _   _ __ ____ __   | |   ___  | |
+#  |  _|   \ \/ /  / _` | | '_ ` _ \  | '_ \  | |  / _ \ | |
+#  | |___   >  <  | (_| | | | | | | | | |_) | | | |  __/ |_|
+#  |_| /_/\_\  \__,_| |_| |_| |_| | .__/  |_|  \___| (_)
+# |_|
 # !!! This is an example! You will need to modify it for your specific
 # !!! requirements!
 
___
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: r276165 - head/sys/arm/include

2014-12-23 Thread Ian Lepore
Author: ian
Date: Wed Dec 24 03:02:12 2014
New Revision: 276165
URL: https://svnweb.freebsd.org/changeset/base/276165

Log:
  Define the old-school arm arch constants we still use internally based on
  the somewhat newer constants predefined by the compiler.  This will allow
  userland apps to use various machine/foo.h headers without CPUTYPE defined.

Modified:
  head/sys/arm/include/cpuconf.h

Modified: head/sys/arm/include/cpuconf.h
==
--- head/sys/arm/include/cpuconf.h  Wed Dec 24 03:00:23 2014
(r276164)
+++ head/sys/arm/include/cpuconf.h  Wed Dec 24 03:02:12 2014
(r276165)
@@ -85,20 +85,43 @@
 #endif
 
 #if !defined(ARM_ARCH_6)
-#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B)
 #define ARM_ARCH_6 1
 #else
 #define ARM_ARCH_6 0
 #endif
 #endif
 
-#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) || defined(CPU_MV_PJ4B)
+#if defined(CPU_CORTEXA) || defined(CPU_KRAIT)
 #define ARM_ARCH_7A1
 #else
 #define ARM_ARCH_7A0
 #endif
 
 #defineARM_NARCH   (ARM_ARCH_4 + ARM_ARCH_5 + ARM_ARCH_6 | 
ARM_ARCH_7A)
+
+/*
+ * Compatibility for userland builds that have no CPUTYPE defined.  Use the 
ARCH
+ * constants predefined by the compiler to define our old-school arch 
constants.
+ * This is a stopgap measure to tide us over until the conversion of all code
+ * to the newer ACLE constants defined by ARM (see acle-compat.h).
+ */
+#if ARM_NARCH == 0
+#if defined(__ARM_ARCH_4T__)
+#undef  ARM_ARCH_4
+#undef  ARM_NARCH
+#define ARM_ARCH_4 1
+#define ARM_NARCH  1
+#define CPU_ARM9 1
+#elif defined(__ARM_ARCH_6ZK__)
+#undef  ARM_ARCH_6
+#undef  ARM_NARCH
+#define ARM_ARCH_6 1
+#define ARM_NARCH  1
+#define CPU_ARM1176 1
+#endif
+#endif
+
 #if ARM_NARCH == 0 && !defined(KLD_MODULE) && defined(_KERNEL)
 #error ARM_NARCH is 0
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r276166 - head/sys/arm/include

2014-12-23 Thread Ian Lepore
Author: ian
Date: Wed Dec 24 03:09:55 2014
New Revision: 276166
URL: https://svnweb.freebsd.org/changeset/base/276166

Log:
  Revert a glitched mismerge that got caught up in the prior commit.
  The PJ4B family is still armv7, not armv6.

Modified:
  head/sys/arm/include/cpuconf.h

Modified: head/sys/arm/include/cpuconf.h
==
--- head/sys/arm/include/cpuconf.h  Wed Dec 24 03:02:12 2014
(r276165)
+++ head/sys/arm/include/cpuconf.h  Wed Dec 24 03:09:55 2014
(r276166)
@@ -85,14 +85,14 @@
 #endif
 
 #if !defined(ARM_ARCH_6)
-#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B)
+#if defined(CPU_ARM1136) || defined(CPU_ARM1176)
 #define ARM_ARCH_6 1
 #else
 #define ARM_ARCH_6 0
 #endif
 #endif
 
-#if defined(CPU_CORTEXA) || defined(CPU_KRAIT)
+#if defined(CPU_CORTEXA) || defined(CPU_KRAIT) || defined(CPU_MV_PJ4B)
 #define ARM_ARCH_7A1
 #else
 #define ARM_ARCH_7A0
___
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: r276168 - head/sys/dev/gpio

2014-12-23 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Dec 24 03:24:50 2014
New Revision: 276168
URL: https://svnweb.freebsd.org/changeset/base/276168

Log:
  Improves the GPIO API description a little bit.
  
  gpio_pin_max must return the maximum supported pin number and not the total
  number of pins on the system.
  
  PR:   157070
  Submitted by: brix

Modified:
  head/sys/dev/gpio/gpio_if.m

Modified: head/sys/dev/gpio/gpio_if.m
==
--- head/sys/dev/gpio/gpio_if.m Wed Dec 24 03:13:16 2014(r276167)
+++ head/sys/dev/gpio/gpio_if.m Wed Dec 24 03:24:50 2014(r276168)
@@ -56,11 +56,11 @@ HEADER {
 };
 
 #
-# Get total number of pins
+# Get maximum pin number
 #
 METHOD int pin_max {
device_t dev;
-   int *npins;
+   int *maxpin;
 };
 
 #
___
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: r276169 - head/sys/dev/fxp

2014-12-23 Thread Warner Losh
Author: imp
Date: Wed Dec 24 03:49:33 2014
New Revision: 276169
URL: https://svnweb.freebsd.org/changeset/base/276169

Log:
  Add Intel vendor ID to the device table to make it more uniform so
  that all the pnp info to match the device is in the fxp_ident_table.

Modified:
  head/sys/dev/fxp/if_fxp.c
  head/sys/dev/fxp/if_fxpreg.h
  head/sys/dev/fxp/if_fxpvar.h

Modified: head/sys/dev/fxp/if_fxp.c
==
--- head/sys/dev/fxp/if_fxp.c   Wed Dec 24 03:24:50 2014(r276168)
+++ head/sys/dev/fxp/if_fxp.c   Wed Dec 24 03:49:33 2014(r276169)
@@ -157,52 +157,52 @@ static const u_char fxp_cb_config_templa
  * them.
  */
 static const struct fxp_ident fxp_ident_table[] = {
-{ 0x1029,  -1, 0, "Intel 82559 PCI/CardBus Pro/100" },
-{ 0x1030,  -1, 0, "Intel 82559 Pro/100 Ethernet" },
-{ 0x1031,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 VE Ethernet" },
-{ 0x1032,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 VE Ethernet" },
-{ 0x1033,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 VM Ethernet" },
-{ 0x1034,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 VM Ethernet" },
-{ 0x1035,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 Ethernet" },
-{ 0x1036,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 Ethernet" },
-{ 0x1037,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 Ethernet" },
-{ 0x1038,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 VM Ethernet" },
-{ 0x1039,  -1, 4, "Intel 82801DB (ICH4) Pro/100 VE Ethernet" },
-{ 0x103A,  -1, 4, "Intel 82801DB (ICH4) Pro/100 Ethernet" },
-{ 0x103B,  -1, 4, "Intel 82801DB (ICH4) Pro/100 VM Ethernet" },
-{ 0x103C,  -1, 4, "Intel 82801DB (ICH4) Pro/100 Ethernet" },
-{ 0x103D,  -1, 4, "Intel 82801DB (ICH4) Pro/100 VE Ethernet" },
-{ 0x103E,  -1, 4, "Intel 82801DB (ICH4) Pro/100 VM Ethernet" },
-{ 0x1050,  -1, 5, "Intel 82801BA (D865) Pro/100 VE Ethernet" },
-{ 0x1051,  -1, 5, "Intel 82562ET (ICH5/ICH5R) Pro/100 VE Ethernet" },
-{ 0x1059,  -1, 0, "Intel 82551QM Pro/100 M Mobile Connection" },
-{ 0x1064,  -1, 6, "Intel 82562EZ (ICH6)" },
-{ 0x1065,  -1, 6, "Intel 82562ET/EZ/GT/GZ PRO/100 VE Ethernet" },
-{ 0x1068,  -1, 6, "Intel 82801FBM (ICH6-M) Pro/100 VE Ethernet" },
-{ 0x1069,  -1, 6, "Intel 82562EM/EX/GX Pro/100 Ethernet" },
-{ 0x1091,  -1, 7, "Intel 82562GX Pro/100 Ethernet" },
-{ 0x1092,  -1, 7, "Intel Pro/100 VE Network Connection" },
-{ 0x1093,  -1, 7, "Intel Pro/100 VM Network Connection" },
-{ 0x1094,  -1, 7, "Intel Pro/100 946GZ (ICH7) Network Connection" },
-{ 0x1209,  -1, 0, "Intel 82559ER Embedded 10/100 Ethernet" },
-{ 0x1229,  0x01,   0, "Intel 82557 Pro/100 Ethernet" },
-{ 0x1229,  0x02,   0, "Intel 82557 Pro/100 Ethernet" },
-{ 0x1229,  0x03,   0, "Intel 82557 Pro/100 Ethernet" },
-{ 0x1229,  0x04,   0, "Intel 82558 Pro/100 Ethernet" },
-{ 0x1229,  0x05,   0, "Intel 82558 Pro/100 Ethernet" },
-{ 0x1229,  0x06,   0, "Intel 82559 Pro/100 Ethernet" },
-{ 0x1229,  0x07,   0, "Intel 82559 Pro/100 Ethernet" },
-{ 0x1229,  0x08,   0, "Intel 82559 Pro/100 Ethernet" },
-{ 0x1229,  0x09,   0, "Intel 82559ER Pro/100 Ethernet" },
-{ 0x1229,  0x0c,   0, "Intel 82550 Pro/100 Ethernet" },
-{ 0x1229,  0x0d,   0, "Intel 82550C Pro/100 Ethernet" },
-{ 0x1229,  0x0e,   0, "Intel 82550 Pro/100 Ethernet" },
-{ 0x1229,  0x0f,   0, "Intel 82551 Pro/100 Ethernet" },
-{ 0x1229,  0x10,   0, "Intel 82551 Pro/100 Ethernet" },
-{ 0x1229,  -1, 0, "Intel 82557/8/9 Pro/100 Ethernet" },
-{ 0x2449,  -1, 2, "Intel 82801BA/CAM (ICH2/3) Pro/100 Ethernet" },
-{ 0x27dc,  -1, 7, "Intel 82801GB (ICH7) 10/100 Ethernet" },
-{ 0,   -1, 0, NULL },
+{ 0x8086, 0x1029,  -1, 0, "Intel 82559 PCI/CardBus Pro/100" },
+{ 0x8086, 0x1030,  -1, 0, "Intel 82559 Pro/100 Ethernet" },
+{ 0x8086, 0x1031,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 VE Ethernet" 
},
+{ 0x8086, 0x1032,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 VE Ethernet" 
},
+{ 0x8086, 0x1033,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 VM Ethernet" 
},
+{ 0x8086, 0x1034,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 VM Ethernet" 
},
+{ 0x8086, 0x1035,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 Ethernet" },
+{ 0x8086, 0x1036,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 Ethernet" },
+{ 0x8086, 0x1037,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 Ethernet" },
+{ 0x8086, 0x1038,  -1, 3, "Intel 82801CAM (ICH3) Pro/100 VM Ethernet" 
},
+{ 0x8086, 0x1039,  -1, 4, "Intel 82801DB (ICH4) Pro/100 VE Ethernet" },
+{ 0x8086, 0x103A,  -1, 4, "Intel 82801DB (ICH4) Pro/100 Ethernet" },
+{ 0x8086, 0x103B,  -1, 4, "Intel 82801DB (ICH4) Pro/100 VM Ethernet" },
+{ 0x8086, 0x103C,  -1, 4, "Intel 82801DB (ICH4) Pro/100 Ethernet" },
+{ 0x8086, 0x103D,  -1, 4, "Int

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

2014-12-23 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Dec 24 04:24:08 2014
New Revision: 276173
URL: https://svnweb.freebsd.org/changeset/base/276173

Log:
  Bring in the last round of updates before adding the interrupt support.
  
  Fix the following issues:
  
  - Removed revision from device softc, it isn't used anywhere else out of
device attach routine;
  
  - Move the duplicated code for verification of valid banks (and pins) to
a single function;
  
  - Use some macros to simplify the handling of some constants;
  
  - Update some stale comments.

Modified:
  head/sys/arm/ti/ti_gpio.c
  head/sys/arm/ti/ti_gpio.h

Modified: head/sys/arm/ti/ti_gpio.c
==
--- head/sys/arm/ti/ti_gpio.c   Wed Dec 24 03:53:59 2014(r276172)
+++ head/sys/arm/ti/ti_gpio.c   Wed Dec 24 04:24:08 2014(r276173)
@@ -117,6 +117,8 @@ __FBSDID("$FreeBSD$");
 #defineAM335X_INTR_PER_BANK2
 #defineAM335X_GPIO_REV 0x50600801
 #definePINS_PER_BANK   32
+#defineTI_GPIO_BANK(p) ((p) / PINS_PER_BANK)
+#defineTI_GPIO_MASK(p) (1U << ((p) % PINS_PER_BANK))
 
 static u_int
 ti_max_gpio_banks(void)
@@ -236,7 +238,7 @@ static struct resource_spec ti_gpio_irq_
 #defineTI_GPIO_ASSERT_UNLOCKED(_sc)mtx_assert(&_sc->sc_mtx, 
MA_NOTOWNED)
 
 /**
- * ti_gpio_read_4 - reads a 16-bit value from one of the PADCONFS registers
+ * ti_gpio_read_4 - reads a 32-bit value from one of the GPIO registers
  * @sc: GPIO device context
  * @bank: The bank to read from
  * @off: The offset of a register from the GPIO register address range
@@ -252,7 +254,7 @@ ti_gpio_read_4(struct ti_gpio_softc *sc,
 }
 
 /**
- * ti_gpio_write_4 - writes a 32-bit value to one of the PADCONFS registers
+ * ti_gpio_write_4 - writes a 32-bit value to one of the GPIO registers
  * @sc: GPIO device context
  * @bank: The bank to write to
  * @off: The offset of a register from the GPIO register address range
@@ -299,6 +301,19 @@ ti_gpio_pin_max(device_t dev, int *maxpi
return (0);
 }
 
+static int
+ti_gpio_valid_pin(struct ti_gpio_softc *sc, int pin)
+{
+
+   if (pin > sc->sc_maxpin ||
+   TI_GPIO_BANK(pin) >= ti_max_gpio_banks() ||
+   sc->sc_mem_res[TI_GPIO_BANK(pin)] == NULL) {
+   return (EINVAL);
+   }
+
+   return (0);
+}
+
 /**
  * ti_gpio_pin_getcaps - Gets the capabilties of a given pin
  * @dev: gpio device handle
@@ -320,11 +335,10 @@ ti_gpio_pin_max(device_t dev, int *maxpi
 static int
 ti_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps)
 {
-   struct ti_gpio_softc *sc = device_get_softc(dev);
-   uint32_t bank = (pin / PINS_PER_BANK);
+   struct ti_gpio_softc *sc;
 
-   /* Sanity check the pin number is valid */
-   if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL))
+   sc = device_get_softc(dev);
+   if (ti_gpio_valid_pin(sc, pin) != 0)
return (EINVAL);
 
*caps = (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_PULLUP |
@@ -352,11 +366,10 @@ ti_gpio_pin_getcaps(device_t dev, uint32
 static int
 ti_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags)
 {
-   struct ti_gpio_softc *sc = device_get_softc(dev);
-   uint32_t bank = (pin / PINS_PER_BANK);
+   struct ti_gpio_softc *sc;
 
-   /* Sanity check the pin number is valid */
-   if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL))
+   sc = device_get_softc(dev);
+   if (ti_gpio_valid_pin(sc, pin) != 0)
return (EINVAL);
 
/* Get the current pin state */
@@ -385,11 +398,10 @@ ti_gpio_pin_getflags(device_t dev, uint3
 static int
 ti_gpio_pin_getname(device_t dev, uint32_t pin, char *name)
 {
-   struct ti_gpio_softc *sc = device_get_softc(dev);
-   uint32_t bank = (pin / PINS_PER_BANK);
+   struct ti_gpio_softc *sc;
 
-   /* Sanity check the pin number is valid */
-   if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL))
+   sc = device_get_softc(dev);
+   if (ti_gpio_valid_pin(sc, pin) != 0)
return (EINVAL);
 
/* Set a very simple name */
@@ -421,13 +433,11 @@ ti_gpio_pin_getname(device_t dev, uint32
 static int
 ti_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags)
 {
-   struct ti_gpio_softc *sc = device_get_softc(dev);
-   uint32_t bank = (pin / PINS_PER_BANK);
-   uint32_t mask = (1UL << (pin % PINS_PER_BANK));
+   struct ti_gpio_softc *sc;
uint32_t oe;
 
-   /* Sanity check the pin number is valid */
-   if ((bank >= ti_max_gpio_banks()) || (sc->sc_mem_res[bank] == NULL))
+   sc = device_get_softc(dev);
+   if (ti_gpio_valid_pin(sc, pin) != 0)
return (EINVAL);
 
/* Set the GPIO mode and state */
@@ -438,12 +448,12 @@ ti_gpio_pin_setflags(devic

svn commit: r276174 - head/sys/dev/isci

2014-12-23 Thread Scott Long
Author: scottl
Date: Wed Dec 24 07:04:04 2014
New Revision: 276174
URL: https://svnweb.freebsd.org/changeset/base/276174

Log:
  Fix tunable and sysctl handling of the fail_on_task_timeout knob.
  
  Reviewed by:  emax
  Obtained from:Netflix, Inc.
  MFC after:3 days

Modified:
  head/sys/dev/isci/isci_controller.c
  head/sys/dev/isci/isci_sysctl.c

Modified: head/sys/dev/isci/isci_controller.c
==
--- head/sys/dev/isci/isci_controller.c Wed Dec 24 04:24:08 2014
(r276173)
+++ head/sys/dev/isci/isci_controller.c Wed Dec 24 07:04:04 2014
(r276174)
@@ -373,6 +373,8 @@ SCI_STATUS isci_controller_initialize(st
 
fail_on_timeout = 1;
TUNABLE_INT_FETCH("hw.isci.fail_on_task_timeout", &fail_on_timeout);
+   controller->fail_on_task_timeout = fail_on_timeout;
+
/* Attach to CAM using xpt_bus_register now, then immediately freeze
 *  the simq.  It will get released later when initial domain discovery
 *  is complete.

Modified: head/sys/dev/isci/isci_sysctl.c
==
--- head/sys/dev/isci/isci_sysctl.c Wed Dec 24 04:24:08 2014
(r276173)
+++ head/sys/dev/isci/isci_sysctl.c Wed Dec 24 07:04:04 2014
(r276174)
@@ -226,12 +226,13 @@ static int
 isci_sysctl_fail_on_task_timeout(SYSCTL_HANDLER_ARGS)
 {
struct isci_softc   *isci = (struct isci_softc *)arg1;
-   int32_t fail_on_timeout = 0;
+   int32_t fail_on_timeout;
int error, i;
 
+   fail_on_timeout = isci->controllers[0].fail_on_task_timeout;
error = sysctl_handle_int(oidp, &fail_on_timeout, 0, req);
 
-   if (error || fail_on_timeout == 0)
+   if (error || req->newptr == NULL)
return (error);
 
for (i = 0; i < isci->controller_count; i++)
___
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"