svn commit: r244386 - head/sys/netinet

2012-12-18 Thread Gleb Smirnoff
Author: glebius
Date: Tue Dec 18 08:09:44 2012
New Revision: 244386
URL: http://svnweb.freebsd.org/changeset/base/244386

Log:
  Clear correct flag in INET6 case.

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cTue Dec 18 07:36:45 2012
(r244385)
+++ head/sys/netinet/tcp_input.cTue Dec 18 08:09:44 2012
(r244386)
@@ -810,7 +810,7 @@ findpcb:
}
/* Remove the tag from the packet.  We don't need it anymore. */
m_tag_delete(m, fwd_tag);
-   m->m_flags &= ~M_IP_NEXTHOP;
+   m->m_flags &= ~M_IP6_NEXTHOP;
fwd_tag = NULL;
} else if (isipv6) {
inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244387 - head/sys/netinet

2012-12-18 Thread Gleb Smirnoff
Author: glebius
Date: Tue Dec 18 08:14:16 2012
New Revision: 244387
URL: http://svnweb.freebsd.org/changeset/base/244387

Log:
  Fix !INET6 build after r244365.

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cTue Dec 18 08:09:44 2012
(r244386)
+++ head/sys/netinet/tcp_input.cTue Dec 18 08:14:16 2012
(r244387)
@@ -780,8 +780,17 @@ findpcb:
/*
 * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain.
 */
-   if ((isipv6 && (m->m_flags & M_IP6_NEXTHOP)) ||
-   (!isipv6 && (m->m_flags & M_IP_NEXTHOP)))
+if (
+#ifdef INET6
+   (isipv6 && (m->m_flags & M_IP6_NEXTHOP))
+#ifdef INET
+   || (!isipv6 && (m->m_flags & M_IP_NEXTHOP))
+#endif
+#endif
+#if defined(INET) && !defined(INET6)
+   (m->m_flags & M_IP_NEXTHOP)
+#endif
+   )
fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL);
 
 #ifdef INET6
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r244387 - head/sys/netinet

2012-12-18 Thread Gleb Smirnoff
  Andrey,

On Tue, Dec 18, 2012 at 08:14:16AM +, Gleb Smirnoff wrote:
T> Author: glebius
T> Date: Tue Dec 18 08:14:16 2012
T> New Revision: 244387
T> URL: http://svnweb.freebsd.org/changeset/base/244387
T> 
T> Log:
T>   Fix !INET6 build after r244365.
T> 
T> Modified:
T>   head/sys/netinet/tcp_input.c
T> 

  At review stage of the r242079 I have noted, that more effort should
be put into mbuf flags prior to this change:

  - cleanse deprecated mbuf flags (at least M_FREELIST)
  - move 90% of mbuf flags to pkthdr flags
  - not utilize protocol specific flag, but use a global one
to mark packet as having forward tag

  Several of the fallouts from r242079 could be avoided.

  IMHO, if anyone is hacking on a new feature or optimisation and
encounters a "bad code" (tm), he/she should remove the bad code from
his/her way and not leave it to be worked on sometime later, which
usually ends up in never. This approach adds more work before the
feature/optimisation is commited, but reduces probability of problems
after commit and thus amount of urgent work after commit.

  P.S. Please do not take above ranting paragraph as personal critics
of yourself, this is just thinking out loud on how things should be
done :)

T> Modified: head/sys/netinet/tcp_input.c
T> 
==
T> --- head/sys/netinet/tcp_input.c Tue Dec 18 08:09:44 2012
(r244386)
T> +++ head/sys/netinet/tcp_input.c Tue Dec 18 08:14:16 2012
(r244387)
T> @@ -780,8 +780,17 @@ findpcb:
T>  /*
T>   * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain.
T>   */
T> -if ((isipv6 && (m->m_flags & M_IP6_NEXTHOP)) ||
T> -(!isipv6 && (m->m_flags & M_IP_NEXTHOP)))
T> +if (
T> +#ifdef INET6
T> +(isipv6 && (m->m_flags & M_IP6_NEXTHOP))
T> +#ifdef INET
T> +|| (!isipv6 && (m->m_flags & M_IP_NEXTHOP))
T> +#endif
T> +#endif
T> +#if defined(INET) && !defined(INET6)
T> +(m->m_flags & M_IP_NEXTHOP)
T> +#endif
T> +)
T>  fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL);
T>  
T>  #ifdef INET6

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


Re: svn commit: r244387 - head/sys/netinet

2012-12-18 Thread Adrian Chadd
Thanks!



Adrian


On 18 December 2012 00:14, Gleb Smirnoff  wrote:
> Author: glebius
> Date: Tue Dec 18 08:14:16 2012
> New Revision: 244387
> URL: http://svnweb.freebsd.org/changeset/base/244387
>
> Log:
>   Fix !INET6 build after r244365.
>
> Modified:
>   head/sys/netinet/tcp_input.c
>
> Modified: head/sys/netinet/tcp_input.c
> ==
> --- head/sys/netinet/tcp_input.cTue Dec 18 08:09:44 2012
> (r244386)
> +++ head/sys/netinet/tcp_input.cTue Dec 18 08:14:16 2012
> (r244387)
> @@ -780,8 +780,17 @@ findpcb:
> /*
>  * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain.
>  */
> -   if ((isipv6 && (m->m_flags & M_IP6_NEXTHOP)) ||
> -   (!isipv6 && (m->m_flags & M_IP_NEXTHOP)))
> +if (
> +#ifdef INET6
> +   (isipv6 && (m->m_flags & M_IP6_NEXTHOP))
> +#ifdef INET
> +   || (!isipv6 && (m->m_flags & M_IP_NEXTHOP))
> +#endif
> +#endif
> +#if defined(INET) && !defined(INET6)
> +   (m->m_flags & M_IP_NEXTHOP)
> +#endif
> +   )
> fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL);
>
>  #ifdef INET6
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244388 - head/sys/dev/wtap

2012-12-18 Thread Monthadar Al Jaberi
Author: monthadar
Date: Tue Dec 18 08:41:23 2012
New Revision: 244388
URL: http://svnweb.freebsd.org/changeset/base/244388

Log:
  wtap: fix clang warning.
  
  * The warning message was:
  'warning error: format string is not a string literal';
  * Changed how make_dev is called, now a string literal
for formatting is used;
  
  Approved by: adrian (mentor)

Modified:
  head/sys/dev/wtap/if_wtap.c

Modified: head/sys/dev/wtap/if_wtap.c
==
--- head/sys/dev/wtap/if_wtap.c Tue Dec 18 08:14:16 2012(r244387)
+++ head/sys/dev/wtap/if_wtap.c Tue Dec 18 08:41:23 2012(r244388)
@@ -348,7 +348,7 @@ wtap_vap_create(struct ieee80211com *ic,
/* complete setup */
ieee80211_vap_attach(vap, wtap_media_change, ieee80211_media_status);
avp->av_dev = make_dev(&wtap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
-   (const char *)ic->ic_ifp->if_xname);
+   "%s", (const char *)ic->ic_ifp->if_xname);
 
/* TODO this is a hack to force it to choose the rate we want */
ni = ieee80211_ref_node(vap->iv_bss);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244389 - head/sys/dev/wtap

2012-12-18 Thread Monthadar Al Jaberi
Author: monthadar
Date: Tue Dec 18 08:44:59 2012
New Revision: 244389
URL: http://svnweb.freebsd.org/changeset/base/244389

Log:
  wtap should check if ieee80211_vap_setup fails.
  
  * If ieee80211_vap_setup fails, we free allocated M_80211_VAP
memory and return NULL;
  
  Approved by: adrian (mentor)

Modified:
  head/sys/dev/wtap/if_wtap.c

Modified: head/sys/dev/wtap/if_wtap.c
==
--- head/sys/dev/wtap/if_wtap.c Tue Dec 18 08:41:23 2012(r244388)
+++ head/sys/dev/wtap/if_wtap.c Tue Dec 18 08:44:59 2012(r244389)
@@ -334,6 +334,10 @@ wtap_vap_create(struct ieee80211com *ic,
vap = (struct ieee80211vap *) avp;
error = ieee80211_vap_setup(ic, vap, name, unit, IEEE80211_M_MBSS,
flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
+   if (error) {
+   free((struct wtap_vap*) vap, M_80211_VAP);
+   return NULL;
+   }
 
/* override various methods */
avp->av_recv_mgmt = vap->iv_recv_mgmt;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r244389 - head/sys/dev/wtap

2012-12-18 Thread Gleb Smirnoff
  Monthadar,

On Tue, Dec 18, 2012 at 08:44:59AM +, Monthadar Al Jaberi wrote:
M> Author: monthadar
M> Date: Tue Dec 18 08:44:59 2012
M> New Revision: 244389
M> URL: http://svnweb.freebsd.org/changeset/base/244389
M> 
M> Log:
M>   wtap should check if ieee80211_vap_setup fails.
M>   
M>   * If ieee80211_vap_setup fails, we free allocated M_80211_VAP
M> memory and return NULL;
M>   
M>   Approved by: adrian (mentor)
M> 
M> Modified:
M>   head/sys/dev/wtap/if_wtap.c
M> 
M> Modified: head/sys/dev/wtap/if_wtap.c
M> 
==
M> --- head/sys/dev/wtap/if_wtap.c  Tue Dec 18 08:41:23 2012
(r244388)
M> +++ head/sys/dev/wtap/if_wtap.c  Tue Dec 18 08:44:59 2012
(r244389)
M> @@ -334,6 +334,10 @@ wtap_vap_create(struct ieee80211com *ic,
M>  vap = (struct ieee80211vap *) avp;
M>  error = ieee80211_vap_setup(ic, vap, name, unit, IEEE80211_M_MBSS,
M>  flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
M> +if (error) {
M> +free((struct wtap_vap*) vap, M_80211_VAP);
M> +return NULL;
M> +}
M>  
M>  /* override various methods */
M>  avp->av_recv_mgmt = vap->iv_recv_mgmt;

You don't need to cast first argument of free(9). And you don't need a cast
before malloc(9) as well.

If you are calling malloc(9) with M_NOWAIT, you need to check return result.

Also, more stylish would be to supply to free() the same variable that was
assigned at malloc(9) call, in this particular case it is "avp".

Patch attached.

-- 
Totus tuus, Glebius.
Index: if_wtap.c
===
--- if_wtap.c	(revision 244389)
+++ if_wtap.c	(working copy)
@@ -326,8 +326,9 @@
 
 	 DWTAP_PRINTF("%s\n", __func__);
 
-	avp = (struct wtap_vap *) malloc(sizeof(struct wtap_vap),
-	M_80211_VAP, M_NOWAIT | M_ZERO);
+	avp = malloc(sizeof(struct wtap_vap), M_80211_VAP, M_NOWAIT | M_ZERO);
+	if (avp == NULL)
+		return (NULL);
 	avp->id = sc->id;
 	avp->av_md = sc->sc_md;
 	avp->av_bcinterval = msecs_to_ticks(BEACON_INTRERVAL + 100*sc->id);
@@ -335,8 +336,8 @@
 	error = ieee80211_vap_setup(ic, vap, name, unit, IEEE80211_M_MBSS,
 	flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
 	if (error) {
-		free((struct wtap_vap*) vap, M_80211_VAP);
-		return NULL;
+		free(avp, M_80211_VAP);
+		return (NULL);
 	}
 
 	/* override various methods */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

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

2012-12-18 Thread Andre Oppermann

On 18.12.2012 06:40, Oleksandr Tymoshenko wrote:


On 2012-12-08, at 1:21 PM, Alan Cox  wrote:


On 12/08/2012 14:32, Andre Oppermann wrote:




.. skipped ..



The trouble seems to come from NSFBUFS which is (512 + maxusers * 16)
resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = 27MB.  This
seem to be pushing it with the smaller ARM kmap layout.

Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500?

ARM does have a direct map mode as well which doesn't require the
allocation
of sfbufs.  I'm not sure which other problems that approach has.




Only a few (3?) platforms use it.  It reduces the size of the user
address space, and translation between physical addresses and direct map
addresses is not computationally trivial as it is on other
architectures, e.g., amd64, ia64.  However, it does try to use large
page mappings.



Hopefully alc@ (added to cc) can answer that and also why the kmap of
27MB
manages to wrench the ARM kernel.




Arm does not define caps on either the buffer map size (param.h) or the
kmem map size (vmparam.h).  It would probably make sense to copy these
definitions from i386.



Adding caps didn't help. I did some digging and found out that although address 
range
0xc000 .. 0x is indeed valid for ARM in general actual KVA space 
varies for
each specific hardware platform. This "real" KVA is defined by 
pair and ifI use them instead of 
in init_param2 function my pandaboard successfully boots. Since former pair is 
used for defining
kernel_map boundaries I believe it should be used for auto tuning as well.


OK.  Thank you for debugging this on ARM.  I'll adjust the auto-tuning
code accordingly.

--
Andre

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


svn commit: r244390 - in stable/9/contrib/openbsm: . bin bin/audit bin/auditd bin/auditdistd bin/auditfilterd bin/auditreduce bin/praudit bsm compat config etc libauditd libbsm m4 man modules modul...

2012-12-18 Thread Robert Watson
Author: rwatson
Date: Tue Dec 18 09:32:44 2012
New Revision: 244390
URL: http://svnweb.freebsd.org/changeset/base/244390

Log:
  Merge OpenBSM 1.2-alpha3 from head to stable/9, upgrading from the previous
  OpenBSM 1.1p2:
  
  OpenBSM 1.2 alpha 3
  
  - Various minor tweaks to the auditdistd build to make it fit the FreeBSD
build environment better.
  - AUE_WAIT6 merged from FreeBSD 9.
  
  OpenBSM 1.2 alpha 2
  
  - auditdistd, a distributed audit trail management daemon, has now been
merged.  This allows trail files to be securely and reliably synced from
audited hosts to an audit server, and employs TLS encryption.  Where
available, it uses Capsicum to sandbox the service.  This work was
contributed by Pawel Jakub Dawidek under sponsorship from the FreeBSD
Foundation.
  
  OpenBSM 1.2 alpha 1
  
  - Add Capsicum-related error numbers for FreeBSD: ENOTCAPABLE, ECAPMODE.
  - Add Capsicum, process descriptor audit events for FreeBSD.
  - Allow 0% minspace.
  - Fixes from the clang static analyser.
  - Fix expiration of trail files when the host parameter is used.
  - Various typo fixes.
  - Support for Solaris privilege and privilege set tokens.
  - Documentation for getachost(), improvements for getacfilesz().
  - Fix a directory descriptor leak that happened when audit trail partitions
filled.
  - Support for more Linux distributions with a partial contemporary endian.h.
  - Improved escaping of XML-encapsulated BSM.
  - A variety of minor documentation, style, and functional.
  
  A separate commit will merge build changes to enable auditdistd, etc.
  
  Obtained from:TrustedBSD Project
  Sponsored by: The FreeBSD Foundation (auditdistd)

Added:
  stable/9/contrib/openbsm/bin/auditdistd/
 - copied from r244360, head/contrib/openbsm/bin/auditdistd/
  stable/9/contrib/openbsm/compat/closefrom.h
 - copied unchanged from r244360, head/contrib/openbsm/compat/closefrom.h
  stable/9/contrib/openbsm/compat/compat.h
 - copied unchanged from r244360, head/contrib/openbsm/compat/compat.h
  stable/9/contrib/openbsm/compat/endian_enc.h
 - copied unchanged from r244360, head/contrib/openbsm/compat/endian_enc.h
  stable/9/contrib/openbsm/compat/flopen.h
 - copied unchanged from r244360, head/contrib/openbsm/compat/flopen.h
  stable/9/contrib/openbsm/compat/pidfile.h
 - copied unchanged from r244360, head/contrib/openbsm/compat/pidfile.h
  stable/9/contrib/openbsm/compat/vis.h
 - copied unchanged from r244360, head/contrib/openbsm/compat/vis.h
  stable/9/contrib/openbsm/config/ylwrap
 - copied unchanged from r244360, head/contrib/openbsm/config/ylwrap
  stable/9/contrib/openbsm/m4/
 - copied from r244360, head/contrib/openbsm/m4/
Modified:
  stable/9/contrib/openbsm/CREDITS
  stable/9/contrib/openbsm/INSTALL
  stable/9/contrib/openbsm/LICENSE
  stable/9/contrib/openbsm/Makefile.am
  stable/9/contrib/openbsm/Makefile.in
  stable/9/contrib/openbsm/NEWS
  stable/9/contrib/openbsm/README
  stable/9/contrib/openbsm/TODO
  stable/9/contrib/openbsm/VERSION
  stable/9/contrib/openbsm/aclocal.m4
  stable/9/contrib/openbsm/autogen.sh
  stable/9/contrib/openbsm/bin/Makefile.am
  stable/9/contrib/openbsm/bin/Makefile.in
  stable/9/contrib/openbsm/bin/audit/Makefile.am
  stable/9/contrib/openbsm/bin/audit/Makefile.in
  stable/9/contrib/openbsm/bin/audit/audit.8
  stable/9/contrib/openbsm/bin/auditd/Makefile.am
  stable/9/contrib/openbsm/bin/auditd/Makefile.in
  stable/9/contrib/openbsm/bin/auditd/auditd.8
  stable/9/contrib/openbsm/bin/auditd/auditd.c
  stable/9/contrib/openbsm/bin/auditfilterd/Makefile.am
  stable/9/contrib/openbsm/bin/auditfilterd/Makefile.in
  stable/9/contrib/openbsm/bin/auditreduce/Makefile.am
  stable/9/contrib/openbsm/bin/auditreduce/Makefile.in
  stable/9/contrib/openbsm/bin/auditreduce/auditreduce.1
  stable/9/contrib/openbsm/bin/praudit/Makefile.am
  stable/9/contrib/openbsm/bin/praudit/Makefile.in
  stable/9/contrib/openbsm/bin/praudit/praudit.1
  stable/9/contrib/openbsm/bin/praudit/praudit.c
  stable/9/contrib/openbsm/bsm/Makefile.am
  stable/9/contrib/openbsm/bsm/Makefile.in
  stable/9/contrib/openbsm/bsm/auditd_lib.h
  stable/9/contrib/openbsm/bsm/libbsm.h
  stable/9/contrib/openbsm/compat/endian.h
  stable/9/contrib/openbsm/config/config.h
  stable/9/contrib/openbsm/config/config.h.in
  stable/9/contrib/openbsm/config/ltmain.sh
  stable/9/contrib/openbsm/configure
  stable/9/contrib/openbsm/configure.ac
  stable/9/contrib/openbsm/etc/audit_control
  stable/9/contrib/openbsm/etc/audit_event
  stable/9/contrib/openbsm/libauditd/Makefile.am
  stable/9/contrib/openbsm/libauditd/Makefile.in
  stable/9/contrib/openbsm/libauditd/auditd_lib.c
  stable/9/contrib/openbsm/libbsm/Makefile.am
  stable/9/contrib/openbsm/libbsm/Makefile.in
  stable/9/contrib/openbsm/libbsm/au_control.3
  stable/9/contrib/openbsm/libbsm/au_fcntl_cmd.3
  stable/9/contrib/openbsm/libbsm/au_io.3
  stable/9/contrib/openbsm/libbsm/audit_submit.3
  stable/9/contrib/o

Re: svn commit: r244383 - head/etc

2012-12-18 Thread Robert Watson


On Tue, 18 Dec 2012, Andrey Zonov wrote:


Author: zont
Date: Tue Dec 18 07:27:50 2012
New Revision: 244383
URL: http://svnweb.freebsd.org/changeset/base/244383

Log:
 - Set memorylocked limit to 64Kb for default login class.
   This prevents unprivileged users to lock too much memory.
 - Set memorylocked limit to 64Mb for daemon login class.
   Some daemons such as amd(8) and watchdogd(8) calls mlockall(2) on
   startup, they are run from init(8) which uses daemon login class.
 - Set memorylocked limit to unlimited for root login class.

 Suggested by:  avg
 Approved by:   kib (mentor)
 MFC after: 1 week


I think you should not MFC this one quickly -- let's wait for it to shake out 
in the -CURRENT userbase for a few months to see what breaks.  I wouldn't be 
surprised if a fair number of applications (both publicly available, and local 
at various FreeBSD-using shops) are implicitly depending on their not being 
limits to memorylocked by default.  After an upgrade, they might find that 
their applications simply stop working for potentially hard-to-debug reasons.


Or we might find no one notices -- but deferring an MFC will help give us a 
better sense of which outcome is more likely.


Robert



Modified:
 head/etc/login.conf

Modified: head/etc/login.conf
==
--- head/etc/login.conf Tue Dec 18 07:26:55 2012(r244382)
+++ head/etc/login.conf Tue Dec 18 07:27:50 2012(r244383)
@@ -32,7 +32,7 @@ default:\
:cputime=unlimited:\
:datasize=unlimited:\
:stacksize=unlimited:\
-   :memorylocked=unlimited:\
+   :memorylocked=64K:\
:memoryuse=unlimited:\
:filesize=unlimited:\
:coredumpsize=unlimited:\
@@ -59,6 +59,7 @@ xuser:\
staff:\
:tc=default:
daemon:\
+   :memorylocked=64M:\
:tc=default:
news:\
:tc=default:
@@ -72,6 +73,7 @@ dialer:\
#   in preference to 'default'.
root:\
:ignorenologin:\
+   :memorylocked=unlimited:\
:tc=default:

#


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


Re: svn commit: r244383 - head/etc

2012-12-18 Thread Robert Watson


On Tue, 18 Dec 2012, Robert Watson wrote:


Log:
 - Set memorylocked limit to 64Kb for default login class.
   This prevents unprivileged users to lock too much memory.
 - Set memorylocked limit to 64Mb for daemon login class.
   Some daemons such as amd(8) and watchdogd(8) calls mlockall(2) on
   startup, they are run from init(8) which uses daemon login class.
 - Set memorylocked limit to unlimited for root login class.

 Suggested by:  avg
 Approved by:   kib (mentor)
 MFC after: 1 week


I think you should not MFC this one quickly -- let's wait for it to shake out 
in the -CURRENT userbase for a few months to see what breaks.  I wouldn't be 
surprised if a fair number of applications (both publicly available, and 
local at various FreeBSD-using shops) are implicitly depending on their not 
being limits to memorylocked by default.  After an upgrade, they might find 
that their applications simply stop working for potentially hard-to-debug 
reasons.


Or we might find no one notices -- but deferring an MFC will help give us a 
better sense of which outcome is more likely.


... or maybe this doesn't matter before your later sysctl commit?

Robert



Robert



Modified:
 head/etc/login.conf

Modified: head/etc/login.conf
==
--- head/etc/login.conf Tue Dec 18 07:26:55 2012(r244382)
+++ head/etc/login.conf Tue Dec 18 07:27:50 2012(r244383)
@@ -32,7 +32,7 @@ default:\
:cputime=unlimited:\
:datasize=unlimited:\
:stacksize=unlimited:\
-   :memorylocked=unlimited:\
+   :memorylocked=64K:\
:memoryuse=unlimited:\
:filesize=unlimited:\
:coredumpsize=unlimited:\
@@ -59,6 +59,7 @@ xuser:\
staff:\
:tc=default:
daemon:\
+   :memorylocked=64M:\
:tc=default:
news:\
:tc=default:
@@ -72,6 +73,7 @@ dialer:\
#   in preference to 'default'.
root:\
:ignorenologin:\
+   :memorylocked=unlimited:\
:tc=default:

#




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


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

2012-12-18 Thread Alan Cox
On 12/17/2012 23:40, Oleksandr Tymoshenko wrote:
> On 2012-12-08, at 1:21 PM, Alan Cox  wrote:
>
>> On 12/08/2012 14:32, Andre Oppermann wrote:
> .. skipped ..
>
>>> The trouble seems to come from NSFBUFS which is (512 + maxusers * 16)
>>> resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = 27MB.  This
>>> seem to be pushing it with the smaller ARM kmap layout.
>>>
>>> Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500?
>>>
>>> ARM does have a direct map mode as well which doesn't require the
>>> allocation
>>> of sfbufs.  I'm not sure which other problems that approach has.
>>>
>>
>> Only a few (3?) platforms use it.  It reduces the size of the user
>> address space, and translation between physical addresses and direct map
>> addresses is not computationally trivial as it is on other
>> architectures, e.g., amd64, ia64.  However, it does try to use large
>> page mappings.
>>
>>
>>> Hopefully alc@ (added to cc) can answer that and also why the kmap of
>>> 27MB
>>> manages to wrench the ARM kernel.
>>>
>>
>> Arm does not define caps on either the buffer map size (param.h) or the
>> kmem map size (vmparam.h).  It would probably make sense to copy these
>> definitions from i386.
>
> Adding caps didn't help. I did some digging and found out that although 
> address range
> 0xc000 .. 0x is indeed valid for ARM in general actual KVA space 
> varies for
> each specific hardware platform. This "real" KVA is defined by 
> 
> pair and ifI use them instead of  VM_MAX_KERNEL_ADDRESS>
> in init_param2 function my pandaboard successfully boots. Since former pair 
> is used for defining 
> kernel_map boundaries I believe it should be used for auto tuning as well. 


That makes sense.  However, "virtual_avail" isn't the start of the
kernel address space.  The kernel map always starts at
VM_MIN_KERNEL_ADDRESS.  (See kmem_init().)  "virtual_avail" represents
the next unallocated virtual address in the kernel address space at an
early point in initialization.  "virtual_avail" and "virtual_end" aren't
used after that, or outside the VM system.  Please use
vm_map_min(kernel_map) and vm_map_max(kernel_map) instead.

That said, I would still add caps on the buffer map and kmem map size. 
As memory sizes on arm systems grow, you'll eventually need them, just
like we did on i386.

Alan

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


svn commit: r244391 - in stable/9/sys: bsm security/audit

2012-12-18 Thread Robert Watson
Author: rwatson
Date: Tue Dec 18 10:23:58 2012
New Revision: 244391
URL: http://svnweb.freebsd.org/changeset/base/244391

Log:
  Merge r243751 from head to stable/9:
  
Merge OpenBSM 1.2-alpha2 changes from contrib/openbsm to
src/sys/{bsm,security/audit}.  There are a few tweaks to help with the
FreeBSD build environment that will be merged back to OpenBSM.  No
significant functional changes appear on the kernel side.
  
Obtained from:  TrustedBSD Project
Sponsored by:   The FreeBSD Foundation (auditdistd)

Modified:
  stable/9/sys/bsm/audit_errno.h
  stable/9/sys/bsm/audit_internal.h
  stable/9/sys/bsm/audit_record.h
  stable/9/sys/security/audit/audit_bsm_errno.c
  stable/9/sys/security/audit/audit_bsm_token.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/bsm/audit_errno.h
==
--- stable/9/sys/bsm/audit_errno.h  Tue Dec 18 09:32:44 2012
(r244390)
+++ stable/9/sys/bsm/audit_errno.h  Tue Dec 18 10:23:58 2012
(r244391)
@@ -26,7 +26,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE. 
  *
- * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#5
+ * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_errno.h#7
  * $FreeBSD$
  */
 

Modified: stable/9/sys/bsm/audit_internal.h
==
--- stable/9/sys/bsm/audit_internal.h   Tue Dec 18 09:32:44 2012
(r244390)
+++ stable/9/sys/bsm/audit_internal.h   Tue Dec 18 10:23:58 2012
(r244391)
@@ -15,7 +15,7 @@
  * 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.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
  * its contributors may be used to endorse or promote products derived
  * from this software without specific prior written permission.
  *
@@ -30,7 +30,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#5
+ * P4: //depot/projects/trustedbsd/openbsm/sys/bsm/audit_internal.h#6
  * $FreeBSD$
  */
 

Modified: stable/9/sys/bsm/audit_record.h
==
--- stable/9/sys/bsm/audit_record.h Tue Dec 18 09:32:44 2012
(r244390)
+++ stable/9/sys/bsm/audit_record.h Tue Dec 18 10:23:58 2012
(r244391)
@@ -234,6 +234,7 @@ token_t *au_to_ipc_perm(struct ipc_perm 
 token_t*au_to_iport(uint16_t iport);
 token_t*au_to_opaque(const char *data, uint16_t bytes);
 token_t*au_to_path(const char *path);
+token_t*au_to_privset(char *privtypestr, char *privstr);
 token_t*au_to_process(au_id_t auid, uid_t euid, gid_t egid, uid_t ruid,
gid_t rgid, pid_t pid, au_asid_t sid, au_tid_t *tid);
 token_t*au_to_process32(au_id_t auid, uid_t euid, gid_t egid, uid_t 
ruid,
@@ -279,6 +280,7 @@ token_t *au_to_exec_env(char **envp);
 token_t*au_to_text(const char *text);
 token_t*au_to_kevent(struct kevent *kev);
 token_t*au_to_trailer(int rec_size);
+token_t*au_to_upriv(char sorf, char *priv);
 token_t*au_to_zonename(const char *zonename);
 
 /*

Modified: stable/9/sys/security/audit/audit_bsm_errno.c
==
--- stable/9/sys/security/audit/audit_bsm_errno.c   Tue Dec 18 09:32:44 
2012(r244390)
+++ stable/9/sys/security/audit/audit_bsm_errno.c   Tue Dec 18 10:23:58 
2012(r244391)
@@ -26,7 +26,7 @@
  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE. 
  *
- * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#18
+ * P4: //depot/projects/trustedbsd/openbsm/libbsm/bsm_errno.c#22
  */
 
 #include 
@@ -494,7 +494,7 @@ static const struct bsm_errno bsm_errnos
 #ifdef EPROCUNAVAIL
EPROCUNAVAIL,
 #else
-   ERRNO_NO_LOCAL_MAPPING
+   ERRNO_NO_LOCAL_MAPPING,
 #endif
ES("Bad procedure for program") },
{ BSM_ERRNO_EFTYPE,
@@ -666,7 +666,7 @@ static const struct bsm_errno bsm_errnos
 #endif
ES("Required key not available") },
{ BSM_ERRNO_EKEYEXPIRED,
-#ifdef EKEEXPIRED
+#ifdef EKEYEXPIRED
EKEYEXPIRED,
 #else
ERRNO_NO_LOCAL_MAPPING,
@@ -680,7 +680,7 @@ static const struct bsm_errno bsm_errnos
 #endif
ES("Key has been revoked") },
{ BSM_ERRNO_EKEYREJECTED,
-#ifdef EKEREJECTED
+#ifdef EKEYREJECTED
EKEYREJECTED,
 #else
ERRNO_NO_LOCA

svn commit: r244392 - stable/9

2012-12-18 Thread Robert Watson
Author: rwatson
Date: Tue Dec 18 10:29:28 2012
New Revision: 244392
URL: http://svnweb.freebsd.org/changeset/base/244392

Log:
  Merge r243798 from head to stable/9:
  
Add auditdistd to the pre-install required uid check list.

Modified:
  stable/9/Makefile.inc1   (contents, props changed)
Directory Properties:
  stable/9/   (props changed)

Modified: stable/9/Makefile.inc1
==
--- stable/9/Makefile.inc1  Tue Dec 18 10:23:58 2012(r244391)
+++ stable/9/Makefile.inc1  Tue Dec 18 10:29:28 2012(r244392)
@@ -600,7 +600,7 @@ installcheck_DESTDIR:
 #
 # Check for missing UIDs/GIDs.
 #
-CHECK_UIDS=
+CHECK_UIDS=auditdistd
 CHECK_GIDS=audit
 .if ${MK_SENDMAIL} != "no"
 CHECK_UIDS+=   smmsp
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244393 - stable/9

2012-12-18 Thread Robert Watson
Author: rwatson
Date: Tue Dec 18 10:34:18 2012
New Revision: 244393
URL: http://svnweb.freebsd.org/changeset/base/244393

Log:
  Merge r243800 from head to stable/9:
  
Specifically point at the Handbook instructions for world updates in
UPDATING by URL.
  
As there has been some confusion over the need to run "mergemaster -p",
part of our standard upgrade procedure, following the recent addition of
an "auditdistd" user, add a note about it to UPDATING explicitly.

Modified:
  stable/9/UPDATING   (contents, props changed)
Directory Properties:
  stable/9/   (props changed)

Modified: stable/9/UPDATING
==
--- stable/9/UPDATING   Tue Dec 18 10:29:28 2012(r244392)
+++ stable/9/UPDATING   Tue Dec 18 10:34:18 2012(r244393)
@@ -4,11 +4,18 @@ This file is maintained and copyrighted 
 See end of file for further details.  For commonly done items, please see the
 COMMON ITEMS: section later in the file.  These instructions assume that you
 basically know what you are doing.  If not, then please consult the FreeBSD
-handbook.
+handbook:
+
+http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
 
 Items affecting the ports and packages system can be found in
 /usr/ports/UPDATING.  Please read that file before running portupgrade.
 
+20121218:
+   With the addition of auditdistd(8), a new auditdistd user is now
+   depended on during installworld.  "mergemaster -p" can be used to add
+   the user prior to installworld, as documented in the handbook.
+
 20121205:
9.1-RELEASE.
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r244389 - head/sys/dev/wtap

2012-12-18 Thread Monthadar Al Jaberi
On Tue, Dec 18, 2012 at 9:53 AM, Gleb Smirnoff  wrote:
>   Monthadar,
>
> On Tue, Dec 18, 2012 at 08:44:59AM +, Monthadar Al Jaberi wrote:
> M> Author: monthadar
> M> Date: Tue Dec 18 08:44:59 2012
> M> New Revision: 244389
> M> URL: http://svnweb.freebsd.org/changeset/base/244389
> M>
> M> Log:
> M>   wtap should check if ieee80211_vap_setup fails.
> M>
> M>   * If ieee80211_vap_setup fails, we free allocated M_80211_VAP
> M> memory and return NULL;
> M>
> M>   Approved by: adrian (mentor)
> M>
> M> Modified:
> M>   head/sys/dev/wtap/if_wtap.c
> M>
> M> Modified: head/sys/dev/wtap/if_wtap.c
> M> 
> ==
> M> --- head/sys/dev/wtap/if_wtap.c  Tue Dec 18 08:41:23 2012
> (r244388)
> M> +++ head/sys/dev/wtap/if_wtap.c  Tue Dec 18 08:44:59 2012
> (r244389)
> M> @@ -334,6 +334,10 @@ wtap_vap_create(struct ieee80211com *ic,
> M>  vap = (struct ieee80211vap *) avp;
> M>  error = ieee80211_vap_setup(ic, vap, name, unit, IEEE80211_M_MBSS,
> M>  flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
> M> +if (error) {
> M> +free((struct wtap_vap*) vap, M_80211_VAP);
> M> +return NULL;
> M> +}
> M>
> M>  /* override various methods */
> M>  avp->av_recv_mgmt = vap->iv_recv_mgmt;
>
> You don't need to cast first argument of free(9). And you don't need a cast
> before malloc(9) as well.
>
> If you are calling malloc(9) with M_NOWAIT, you need to check return result.
>
> Also, more stylish would be to supply to free() the same variable that was
> assigned at malloc(9) call, in this particular case it is "avp".
>
> Patch attached.

Thank you for the patch, I can commit it for you, if you havn't done it yet?

br,

>
> --
> Totus tuus, Glebius.



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


Re: svn commit: r244112 - head/sys/kern

2012-12-18 Thread Andre Oppermann

On 17.12.2012 23:12, Andriy Gapon wrote:

on 18/12/2012 00:02 Adrian Chadd said the following:

Why are they there, if we just ship production releases with
INVARIANTS disabled?


Because there is an axis orthogonal to asserting correctness - performance.


Indeed.  There are, or will be, a couple of very intrusive and expensive
mbuf and socket buffer integrity checks under KASSERT/INVARIANTS that are
not appropriate and performance reducing for productions kernels.  The
same goes for UMA memory fuzzing.  I've always used and placed KASSERTs
with this assumption.

I do have some sympathy for a certain run-time KASSERT() check that will
print a backtrace but won't panic.  However it is a distinct class from
what we have now and needs to be explicitly placed by the programmer to
make sense with the logic around it.

--
Andre

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


Re: svn commit: r244387 - head/sys/netinet

2012-12-18 Thread Andre Oppermann

On 18.12.2012 09:24, Gleb Smirnoff wrote:

   Andrey,

On Tue, Dec 18, 2012 at 08:14:16AM +, Gleb Smirnoff wrote:
T> Author: glebius
T> Date: Tue Dec 18 08:14:16 2012
T> New Revision: 244387
T> URL: http://svnweb.freebsd.org/changeset/base/244387
T>
T> Log:
T>   Fix !INET6 build after r244365.
T>
T> Modified:
T>   head/sys/netinet/tcp_input.c
T>

   At review stage of the r242079 I have noted, that more effort should
be put into mbuf flags prior to this change:

   - cleanse deprecated mbuf flags (at least M_FREELIST)
   - move 90% of mbuf flags to pkthdr flags


Please do not commit these two steps immediately to HEAD.  Ask for
review first.


   - not utilize protocol specific flag, but use a global one
 to mark packet as having forward tag


Nope, please don't.  It's protocol specific and should stay there.

--
Andre


   Several of the fallouts from r242079 could be avoided.

   IMHO, if anyone is hacking on a new feature or optimisation and
encounters a "bad code" (tm), he/she should remove the bad code from
his/her way and not leave it to be worked on sometime later, which
usually ends up in never. This approach adds more work before the
feature/optimisation is commited, but reduces probability of problems
after commit and thus amount of urgent work after commit.

   P.S. Please do not take above ranting paragraph as personal critics
of yourself, this is just thinking out loud on how things should be
done :)

T> Modified: head/sys/netinet/tcp_input.c
T> 
==
T> --- head/sys/netinet/tcp_input.c  Tue Dec 18 08:09:44 2012(r244386)
T> +++ head/sys/netinet/tcp_input.c  Tue Dec 18 08:14:16 2012(r244387)
T> @@ -780,8 +780,17 @@ findpcb:
T>   /*
T>* Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain.
T>*/
T> - if ((isipv6 && (m->m_flags & M_IP6_NEXTHOP)) ||
T> - (!isipv6 && (m->m_flags & M_IP_NEXTHOP)))
T> +if (
T> +#ifdef INET6
T> + (isipv6 && (m->m_flags & M_IP6_NEXTHOP))
T> +#ifdef INET
T> + || (!isipv6 && (m->m_flags & M_IP_NEXTHOP))
T> +#endif
T> +#endif
T> +#if defined(INET) && !defined(INET6)
T> + (m->m_flags & M_IP_NEXTHOP)
T> +#endif
T> + )
T>   fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL);
T>
T>  #ifdef INET6



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


Re: svn commit: r244389 - head/sys/dev/wtap

2012-12-18 Thread Gleb Smirnoff
On Tue, Dec 18, 2012 at 12:30:53PM +0100, Monthadar Al Jaberi wrote:
M> On Tue, Dec 18, 2012 at 9:53 AM, Gleb Smirnoff  wrote:
M> >   Monthadar,
M> >
M> > On Tue, Dec 18, 2012 at 08:44:59AM +, Monthadar Al Jaberi wrote:
M> > M> Author: monthadar
M> > M> Date: Tue Dec 18 08:44:59 2012
M> > M> New Revision: 244389
M> > M> URL: http://svnweb.freebsd.org/changeset/base/244389
M> > M>
M> > M> Log:
M> > M>   wtap should check if ieee80211_vap_setup fails.
M> > M>
M> > M>   * If ieee80211_vap_setup fails, we free allocated M_80211_VAP
M> > M> memory and return NULL;
M> > M>
M> > M>   Approved by: adrian (mentor)
M> > M>
M> > M> Modified:
M> > M>   head/sys/dev/wtap/if_wtap.c
M> > M>
M> > M> Modified: head/sys/dev/wtap/if_wtap.c
M> > M> 
==
M> > M> --- head/sys/dev/wtap/if_wtap.c  Tue Dec 18 08:41:23 2012
(r244388)
M> > M> +++ head/sys/dev/wtap/if_wtap.c  Tue Dec 18 08:44:59 2012
(r244389)
M> > M> @@ -334,6 +334,10 @@ wtap_vap_create(struct ieee80211com *ic,
M> > M>  vap = (struct ieee80211vap *) avp;
M> > M>  error = ieee80211_vap_setup(ic, vap, name, unit, IEEE80211_M_MBSS,
M> > M>  flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
M> > M> +if (error) {
M> > M> +free((struct wtap_vap*) vap, M_80211_VAP);
M> > M> +return NULL;
M> > M> +}
M> > M>
M> > M>  /* override various methods */
M> > M>  avp->av_recv_mgmt = vap->iv_recv_mgmt;
M> >
M> > You don't need to cast first argument of free(9). And you don't need a cast
M> > before malloc(9) as well.
M> >
M> > If you are calling malloc(9) with M_NOWAIT, you need to check return 
result.
M> >
M> > Also, more stylish would be to supply to free() the same variable that was
M> > assigned at malloc(9) call, in this particular case it is "avp".
M> >
M> > Patch attached.
M> 
M> Thank you for the patch, I can commit it for you, if you havn't done it yet?

Please commit, I'm not confident with wtap.

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


svn commit: r244397 - stable/9/contrib/openbsm/bin/auditdistd

2012-12-18 Thread Robert Watson
Author: rwatson
Date: Tue Dec 18 14:31:55 2012
New Revision: 244397
URL: http://svnweb.freebsd.org/changeset/base/244397

Log:
  Apply minor local adjustment to OpenBSM's parse.y due to differences in Yacc
  between 10-CURRENT and 9-STABLE; this will allow the soon-to-be-connected
  auditdistd to build on 9.x.
  
  Pointer from: bapt

Modified:
  stable/9/contrib/openbsm/bin/auditdistd/parse.y

Modified: stable/9/contrib/openbsm/bin/auditdistd/parse.y
==
--- stable/9/contrib/openbsm/bin/auditdistd/parse.y Tue Dec 18 12:28:00 
2012(r244396)
+++ stable/9/contrib/openbsm/bin/auditdistd/parse.y Tue Dec 18 14:31:55 
2012(r244397)
@@ -56,6 +56,7 @@ extern int lineno;
 
 extern FILE *yyin;
 extern char *yytext;
+extern int yyparse(void);
 
 static struct adist_config *lconfig;
 static struct adist_host *curhost;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244398 - in stable/9: etc/defaults etc/mtree etc/rc.d share/man/man4 usr.sbin usr.sbin/auditdistd

2012-12-18 Thread Robert Watson
Author: rwatson
Date: Tue Dec 18 14:32:53 2012
New Revision: 244398
URL: http://svnweb.freebsd.org/changeset/base/244398

Log:
  Merge r244181 from head to stable/9:
  
Fix the location of auditdistd configuration file.
  
Reported by:Johan Hendriks 
  
  Merge remaining unmerged portions of r243752 from head to stable/9; parts
  adding the new 'auditdistd' user were previously merged in r243947:
  
Merge a number of changes required to hook up OpenBSM 1.2-alpha2's
auditdistd (distributed audit daemon) to the build:
  
- Manual cross references
- Makefile for auditdistd
- rc.d script, rc.conf entrie
- New group and user for auditdistd; associated aliases, etc.
  
The audit trail distribution daemon provides reliable,
cryptographically protected (and sandboxed) delivery of audit tails
from live clients to audit server hosts in order to both allow
centralised analysis, and improve resilience in the event of client
compromises: clients are not permitted to change trail contents
after submission.
  
Submitted by:   pjd
Sponsored by:   The FreeBSD Foundation (auditdistd)
  
  Obtained from:TrustedBSD Project

Added:
  stable/9/etc/rc.d/auditdistd
 - copied, changed from r243752, head/etc/rc.d/auditdistd
  stable/9/usr.sbin/auditdistd/
 - copied from r243752, head/usr.sbin/auditdistd/
Modified:
  stable/9/etc/defaults/rc.conf
  stable/9/etc/mtree/BSD.var.dist
  stable/9/etc/rc.d/Makefile
  stable/9/share/man/man4/audit.4
  stable/9/usr.sbin/Makefile
Directory Properties:
  stable/9/etc/   (props changed)
  stable/9/share/man/man4/   (props changed)
  stable/9/usr.sbin/   (props changed)

Modified: stable/9/etc/defaults/rc.conf
==
--- stable/9/etc/defaults/rc.conf   Tue Dec 18 14:31:55 2012
(r244397)
+++ stable/9/etc/defaults/rc.conf   Tue Dec 18 14:32:53 2012
(r244398)
@@ -587,6 +587,9 @@ sendmail_rebuild_aliases="NO"   # Run newa
 auditd_enable="NO" # Run the audit daemon.
 auditd_program="/usr/sbin/auditd"  # Path to the audit daemon.
 auditd_flags=""# Which options to pass to the audit daemon.
+auditdistd_enable="NO" # Run the audit daemon.
+auditdistd_program="/usr/sbin/auditdistd"  # Path to the auditdistd daemon.
+auditdistd_flags=""# Which options to pass to the auditdistd daemon.
 cron_enable="YES"  # Run the periodic job daemon.
 cron_program="/usr/sbin/cron"  # Which cron executable to run (if enabled).
 cron_dst="YES" # Handle DST transitions intelligently (YES/NO)

Modified: stable/9/etc/mtree/BSD.var.dist
==
--- stable/9/etc/mtree/BSD.var.dist Tue Dec 18 14:31:55 2012
(r244397)
+++ stable/9/etc/mtree/BSD.var.dist Tue Dec 18 14:32:53 2012
(r244398)
@@ -19,6 +19,10 @@
 /set gname=audit
 audit
 ..
+distuname=auditdistd gname=audit mode=0770
+..
+remote  uname=auditdistd gname=wheel mode=0700
+..
 /set gname=wheel
 backups
 ..

Modified: stable/9/etc/rc.d/Makefile
==
--- stable/9/etc/rc.d/Makefile  Tue Dec 18 14:31:55 2012(r244397)
+++ stable/9/etc/rc.d/Makefile  Tue Dec 18 14:32:53 2012(r244398)
@@ -4,7 +4,7 @@
 
 FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
abi accounting addswap adjkerntz amd \
-   apm apmd archdep atm1 atm2 atm3 auditd \
+   apm apmd archdep atm1 atm2 atm3 auditd auditdistd \
bgfsck bluetooth bootparams bridge bsnmpd bthidd \
ccd cleanvar cleartmp cron \
ddb defaultroute devd devfs dhclient \

Copied and modified: stable/9/etc/rc.d/auditdistd (from r243752, 
head/etc/rc.d/auditdistd)
==
--- head/etc/rc.d/auditdistdSat Dec  1 15:11:46 2012(r243752, copy 
source)
+++ stable/9/etc/rc.d/auditdistdTue Dec 18 14:32:53 2012
(r244398)
@@ -14,7 +14,7 @@ name="auditdistd"
 rcvar="${name}_enable"
 pidfile="/var/run/${name}.pid"
 command="/usr/sbin/${name}"
-required_files="/etc/${name}.conf"
+required_files="/etc/security/${name}.conf"
 extra_commands="reload"
 
 load_rc_config $name

Modified: stable/9/share/man/man4/audit.4
==
--- stable/9/share/man/man4/audit.4 Tue Dec 18 14:31:55 2012
(r244397)
+++ stable/9/share/man/man4/audit.4 Tue Dec 18 14:32:53 2012
(r244398)
@@ -96,7 +96,8 @@ to track users and events in a fine-grai
 .Xr audit_warn 5 ,
 .Xr rc.conf 5 ,
 .Xr audit 8 ,
-.Xr auditd 8
+.Xr auditd 8 ,
+.Xr auditdistd 8
 .Sh HISTORY
 The
 .Tn OpenBSM

Modified: stable/9/usr.sbin/Makefile
=

Re: svn commit: r244385 - head/sys/kern

2012-12-18 Thread Ivan Voras
On 18 December 2012 08:36, Andrey Zonov  wrote:
> Author: zont
> Date: Tue Dec 18 07:36:45 2012
> New Revision: 244385
> URL: http://svnweb.freebsd.org/changeset/base/244385
>
> Log:
>   - Add sysctl to allow unprivileged users to call mlock(2)-family system
> calls and turn it on.
>   - Do not allow to call them inside jail. [1]

There's a sysctl branch security.jail.param.allow. which might be
useful here to add for jails.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244399 - head/sys/dev/wtap

2012-12-18 Thread Monthadar Al Jaberi
Author: monthadar
Date: Tue Dec 18 16:11:13 2012
New Revision: 244399
URL: http://svnweb.freebsd.org/changeset/base/244399

Log:
  wtap fix malloc/free.
  
  * Remove malloc/free pointer cast;
  * Check return value from malloc;
  
  Submitted by: glebius
  Approved by: adrian (mentor)

Modified:
  head/sys/dev/wtap/if_wtap.c

Modified: head/sys/dev/wtap/if_wtap.c
==
--- head/sys/dev/wtap/if_wtap.c Tue Dec 18 14:32:53 2012(r244398)
+++ head/sys/dev/wtap/if_wtap.c Tue Dec 18 16:11:13 2012(r244399)
@@ -326,8 +326,9 @@ wtap_vap_create(struct ieee80211com *ic,
 
 DWTAP_PRINTF("%s\n", __func__);
 
-   avp = (struct wtap_vap *) malloc(sizeof(struct wtap_vap),
-   M_80211_VAP, M_NOWAIT | M_ZERO);
+   avp = malloc(sizeof(struct wtap_vap), M_80211_VAP, M_NOWAIT | M_ZERO);
+   if (avp == NULL)
+   return (NULL);
avp->id = sc->id;
avp->av_md = sc->sc_md;
avp->av_bcinterval = msecs_to_ticks(BEACON_INTRERVAL + 100*sc->id);
@@ -335,8 +336,8 @@ wtap_vap_create(struct ieee80211com *ic,
error = ieee80211_vap_setup(ic, vap, name, unit, IEEE80211_M_MBSS,
flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
if (error) {
-   free((struct wtap_vap*) vap, M_80211_VAP);
-   return NULL;
+   free(avp, M_80211_VAP);
+   return (NULL);
}
 
/* override various methods */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244400 - head/sys/dev/wtap

2012-12-18 Thread Monthadar Al Jaberi
Author: monthadar
Date: Tue Dec 18 16:15:20 2012
New Revision: 244400
URL: http://svnweb.freebsd.org/changeset/base/244400

Log:
  wtap should not set the IEEE80211_F_DATAPAD flag;
  
  Approved by: adrian (mentor)

Modified:
  head/sys/dev/wtap/if_wtap.c

Modified: head/sys/dev/wtap/if_wtap.c
==
--- head/sys/dev/wtap/if_wtap.c Tue Dec 18 16:11:13 2012(r244399)
+++ head/sys/dev/wtap/if_wtap.c Tue Dec 18 16:15:20 2012(r244400)
@@ -808,11 +808,7 @@ wtap_attach(struct wtap_softc *sc, const
ic->ic_regdomain.location = 1; /* Indoors */
ic->ic_regdomain.isocc[0] = 'S';
ic->ic_regdomain.isocc[1] = 'E';
-   /*
-* Indicate we need the 802.11 header padded to a
-* 32-bit boundary for 4-address and QoS frames.
-*/
-   ic->ic_flags |= IEEE80211_F_DATAPAD;
+
ic->ic_nchans = 1;
ic->ic_channels[0].ic_flags = IEEE80211_CHAN_B;
ic->ic_channels[0].ic_freq = 2412;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r244389 - head/sys/dev/wtap

2012-12-18 Thread Monthadar Al Jaberi
On Tue, Dec 18, 2012 at 2:13 PM, Gleb Smirnoff  wrote:
> On Tue, Dec 18, 2012 at 12:30:53PM +0100, Monthadar Al Jaberi wrote:
> M> On Tue, Dec 18, 2012 at 9:53 AM, Gleb Smirnoff  wrote:
> M> >   Monthadar,
> M> >
> M> > On Tue, Dec 18, 2012 at 08:44:59AM +, Monthadar Al Jaberi wrote:
> M> > M> Author: monthadar
> M> > M> Date: Tue Dec 18 08:44:59 2012
> M> > M> New Revision: 244389
> M> > M> URL: http://svnweb.freebsd.org/changeset/base/244389
> M> > M>
> M> > M> Log:
> M> > M>   wtap should check if ieee80211_vap_setup fails.
> M> > M>
> M> > M>   * If ieee80211_vap_setup fails, we free allocated M_80211_VAP
> M> > M> memory and return NULL;
> M> > M>
> M> > M>   Approved by: adrian (mentor)
> M> > M>
> M> > M> Modified:
> M> > M>   head/sys/dev/wtap/if_wtap.c
> M> > M>
> M> > M> Modified: head/sys/dev/wtap/if_wtap.c
> M> > M> 
> ==
> M> > M> --- head/sys/dev/wtap/if_wtap.c  Tue Dec 18 08:41:23 2012
> (r244388)
> M> > M> +++ head/sys/dev/wtap/if_wtap.c  Tue Dec 18 08:44:59 2012
> (r244389)
> M> > M> @@ -334,6 +334,10 @@ wtap_vap_create(struct ieee80211com *ic,
> M> > M>  vap = (struct ieee80211vap *) avp;
> M> > M>  error = ieee80211_vap_setup(ic, vap, name, unit, 
> IEEE80211_M_MBSS,
> M> > M>  flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
> M> > M> +if (error) {
> M> > M> +free((struct wtap_vap*) vap, M_80211_VAP);
> M> > M> +return NULL;
> M> > M> +}
> M> > M>
> M> > M>  /* override various methods */
> M> > M>  avp->av_recv_mgmt = vap->iv_recv_mgmt;
> M> >
> M> > You don't need to cast first argument of free(9). And you don't need a 
> cast
> M> > before malloc(9) as well.
> M> >
> M> > If you are calling malloc(9) with M_NOWAIT, you need to check return 
> result.
> M> >
> M> > Also, more stylish would be to supply to free() the same variable that 
> was
> M> > assigned at malloc(9) call, in this particular case it is "avp".
> M> >
> M> > Patch attached.
> M>
> M> Thank you for the patch, I can commit it for you, if you havn't done it 
> yet?
>
> Please commit, I'm not confident with wtap.

Done, thank you!

>
> --
> Totus tuus, Glebius.



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


svn commit: r244401 - in head: contrib/libc-vis include lib/libc/gen

2012-12-18 Thread Brooks Davis
Author: brooks
Date: Tue Dec 18 16:37:24 2012
New Revision: 244401
URL: http://svnweb.freebsd.org/changeset/base/244401

Log:
  Replace our implementation of the vis(3) and unvis(3) APIs with
  NetBSD's.  This output size limited versions of vis and unvis functions
  as well as a set of vis variants that allow arbitrary characters to be
  specified for encoding.
  
  Finally, MIME Quoted-Printable encoding as described in RFC 2045 is
  supported.

Added:
  head/contrib/libc-vis/
 - copied from r244235, vendor/NetBSD/libc-vis/dist/
  head/lib/libc/gen/unvis-compat.c   (contents, props changed)
Deleted:
  head/include/vis.h
  head/lib/libc/gen/unvis.3
  head/lib/libc/gen/unvis.c
  head/lib/libc/gen/vis.3
  head/lib/libc/gen/vis.c
Modified:
  head/contrib/libc-vis/unvis.3
  head/contrib/libc-vis/unvis.c
  head/contrib/libc-vis/vis.3
  head/contrib/libc-vis/vis.c
  head/contrib/libc-vis/vis.h
  head/include/Makefile
  head/lib/libc/gen/Makefile.inc
  head/lib/libc/gen/Symbol.map

Modified: head/contrib/libc-vis/unvis.3
==
--- vendor/NetBSD/libc-vis/dist/unvis.3 Fri Dec 14 23:13:06 2012
(r244235)
+++ head/contrib/libc-vis/unvis.3   Tue Dec 18 16:37:24 2012
(r244401)
@@ -1,4 +1,5 @@
 .\"$NetBSD: unvis.3,v 1.23 2011/03/17 14:06:29 wiz Exp $
+.\"$FreeBSD$
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"The Regents of the University of California.  All rights reserved.
@@ -241,4 +242,6 @@ The
 and
 .Fn strnunvisx
 functions appeared in
-.Nx 6.0 .
+.Nx 6.0
+and
+.Fx 10.0 .

Modified: head/contrib/libc-vis/unvis.c
==
--- vendor/NetBSD/libc-vis/dist/unvis.c Fri Dec 14 23:13:06 2012
(r244235)
+++ head/contrib/libc-vis/unvis.c   Tue Dec 18 16:37:24 2012
(r244401)
@@ -37,6 +37,7 @@ static char sccsid[] = "@(#)unvis.c   8.1 
 __RCSID("$NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
+__FBSDID("$FreeBSD$");
 
 #include "namespace.h"
 #include 
@@ -48,6 +49,14 @@ __RCSID("$NetBSD: unvis.c,v 1.40 2012/12
 #include 
 #include 
 
+#define_DIAGASSERT(x)  assert(x)
+
+/*
+ * Return the number of elements in a statically-allocated array,
+ * __x.
+ */
+#define__arraycount(__x)   (sizeof(__x) / sizeof(__x[0]))
+
 #ifdef __weak_alias
 __weak_alias(strnunvisx,_strnunvisx)
 #endif

Modified: head/contrib/libc-vis/vis.3
==
--- vendor/NetBSD/libc-vis/dist/vis.3   Fri Dec 14 23:13:06 2012
(r244235)
+++ head/contrib/libc-vis/vis.3 Tue Dec 18 16:37:24 2012(r244401)
@@ -1,4 +1,5 @@
 .\"$NetBSD: vis.3,v 1.29 2012/12/14 22:55:59 christos Exp $
+.\"$FreeBSD$
 .\"
 .\" Copyright (c) 1989, 1991, 1993
 .\"The Regents of the University of California.  All rights reserved.
@@ -438,7 +439,9 @@ The
 and
 .Fn strsvisx
 functions appeared in
-.Nx 1.5 .
+.Nx 1.5
+and
+.Fx 10.0 .
 The buffer size limited versions of the functions
 .Po Fn nvis ,
 .Fn strnvis ,
@@ -448,4 +451,6 @@ The buffer size limited versions of the 
 and
 .Fn strsnvisx Pc
 appeared in
-.Nx 6.0 .
+.Nx 6.0
+and
+.Fx 10.0 .

Modified: head/contrib/libc-vis/vis.c
==
--- vendor/NetBSD/libc-vis/dist/vis.c   Fri Dec 14 23:13:06 2012
(r244235)
+++ head/contrib/libc-vis/vis.c Tue Dec 18 16:37:24 2012(r244401)
@@ -59,6 +59,7 @@
 #if defined(LIBC_SCCS) && !defined(lint)
 __RCSID("$NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
+__FBSDID("$FreeBSD$");
 
 #include "namespace.h"
 #include 
@@ -68,6 +69,8 @@ __RCSID("$NetBSD: vis.c,v 1.45 2012/12/1
 #include 
 #include 
 
+#define_DIAGASSERT(x)  assert(x)
+
 #ifdef __weak_alias
 __weak_alias(strvisx,_strvisx)
 #endif

Modified: head/contrib/libc-vis/vis.h
==
--- vendor/NetBSD/libc-vis/dist/vis.h   Fri Dec 14 23:13:06 2012
(r244235)
+++ head/contrib/libc-vis/vis.h Tue Dec 18 16:37:24 2012(r244401)
@@ -1,4 +1,5 @@
 /* $NetBSD: vis.h,v 1.20 2012/12/14 21:36:59 christos Exp $*/
+/* $FreeBSD$   */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -58,11 +59,11 @@
 #defineVIS_NOSLASH 0x0040  /* inhibit printing '\' */
 #defineVIS_HTTP18080x0080  /* http-style escape % hex hex */
 #defineVIS_HTTPSTYLE   0x0080  /* http-style escape % hex hex */
-#defineVIS_MIMESTYLE   0x0100  /* mime-style escape = HEX HEX */
-#defineVIS_HTTP18660x0200  /* http-style &#num; or &string; */
-#defineVIS_NOESCAPE0x0400  /* don't decode `\' */
-#define_VIS_END0x0800  /* for unvis */
-#defineVIS_GLOB0x1000  /* encode glob(3) magic characters */
+#define  

svn commit: r244403 - svnadmin/conf

2012-12-18 Thread Ed Maste
Author: emaste
Date: Tue Dec 18 18:04:29 2012
New Revision: 244403
URL: http://svnweb.freebsd.org/changeset/base/244403

Log:
  Welcome Mark Johnston (markj@) as a new src committer.  I will be his
  mentor, with Ryan Stone as co-mentor.
  
  Approved by: core

Modified:
  svnadmin/conf/access
  svnadmin/conf/mentors

Modified: svnadmin/conf/access
==
--- svnadmin/conf/accessTue Dec 18 17:13:16 2012(r244402)
+++ svnadmin/conf/accessTue Dec 18 18:04:29 2012(r244403)
@@ -156,6 +156,7 @@ luigi
 luoqi
 marcel
 marius
+markj
 markm
 markus
 matteo

Modified: svnadmin/conf/mentors
==
--- svnadmin/conf/mentors   Tue Dec 18 17:13:16 2012(r244402)
+++ svnadmin/conf/mentors   Tue Dec 18 18:04:29 2012(r244403)
@@ -25,6 +25,7 @@ jlh   kib
 jonathan   rwatson
 jwdrmacklem
 kargl  das
+markj  emaste  Co-mentor: rstone
 miwi   rwatson
 monthadar  adrian
 nork   imp
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244404 - head/sys/kern

2012-12-18 Thread Mateusz Guzik
Author: mjg
Date: Tue Dec 18 18:34:36 2012
New Revision: 244404
URL: http://svnweb.freebsd.org/changeset/base/244404

Log:
  prison_racct_detach can be called for not fully initialized jail, so make it 
check that the jail has racct before doing anything
  
  PR:   kern/174436
  Reviewed by:  trasz
  MFC after:3 days

Modified:
  head/sys/kern/kern_jail.c

Modified: head/sys/kern/kern_jail.c
==
--- head/sys/kern/kern_jail.c   Tue Dec 18 18:04:29 2012(r244403)
+++ head/sys/kern/kern_jail.c   Tue Dec 18 18:34:36 2012(r244404)
@@ -4518,6 +4518,8 @@ prison_racct_detach(struct prison *pr)
 
sx_assert(&allprison_lock, SA_UNLOCKED);
 
+   if (pr->pr_prison_racct == NULL)
+   return;
prison_racct_free(pr->pr_prison_racct);
pr->pr_prison_racct = NULL;
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244405 - head/sys/dev/atkbdc

2012-12-18 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Tue Dec 18 20:02:53 2012
New Revision: 244405
URL: http://svnweb.freebsd.org/changeset/base/244405

Log:
  psm: Support detection of Synaptics touchpad v7.5 and above
  
  Starting with firmware v7.5, the "Read TouchPad Modes" ($01) and "Read
  Capabilities" ($02) commands changed: previously constant bytes now
  carry variable information.
  
  We now compare those bytes to expected constants only for firmware prior
  to v7.5.
  
  Tested by:Zeus Panchenko 
  MFC after:1 week

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==
--- head/sys/dev/atkbdc/psm.c   Tue Dec 18 18:34:36 2012(r244404)
+++ head/sys/dev/atkbdc/psm.c   Tue Dec 18 20:02:53 2012(r244405)
@@ -239,6 +239,10 @@ typedef struct synapticspacket {
 #define SYNAPTICS_QUEUE_CURSOR(x)  \
(x + SYNAPTICS_PACKETQUEUE) % SYNAPTICS_PACKETQUEUE
 
+#defineSYNAPTICS_VERSION_GE(synhw, major, minor)   
\
+((synhw).infoMajor > (major) ||\
+ ((synhw).infoMajor == (major) && (synhw).infoMinor >= (minor)))
+
 typedef struct synapticsaction {
synapticspacket_t   queue[SYNAPTICS_PACKETQUEUE];
int queue_len;
@@ -867,7 +871,9 @@ doopen(struct psm_softc *sc, int command
if (sc->hw.model == MOUSE_MODEL_SYNAPTICS) {
mouse_ext_command(sc->kbdc, 1);
get_mouse_status(sc->kbdc, stat, 0, 3);
-   if (stat[1] == 0x47 && stat[2] == 0x40) {
+   if ((SYNAPTICS_VERSION_GE(sc->synhw, 7, 5) ||
+stat[1] == 0x47) &&
+   stat[2] == 0x40) {
/* Set the mode byte -- request wmode where
 * available */
if (sc->synhw.capExtended)
@@ -4383,7 +4389,7 @@ enable_synaptics(KBDC kbdc, struct psm_s
return (FALSE);
if (get_mouse_status(kbdc, status, 0, 3) != 3)
return (FALSE);
-   if (status[1] != 0x47) {
+   if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != 0x47) {
printf("  Failed to read extended capability bits\n");
return (FALSE);
}
@@ -4439,7 +4445,7 @@ enable_synaptics(KBDC kbdc, struct psm_s
return (FALSE);
if (get_mouse_status(kbdc, status, 0, 3) != 3)
return (FALSE);
-   if (status[1] != 0x47) {
+   if (!SYNAPTICS_VERSION_GE(synhw, 7, 5) && status[1] != 0x47) {
printf("  Failed to read mode byte\n");
return (FALSE);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r244320 - head/sbin/savecore

2012-12-18 Thread John Baldwin
On Sunday, December 16, 2012 6:06:12 pm Pawel Jakub Dawidek wrote:
> Author: pjd
> Date: Sun Dec 16 23:06:12 2012
> New Revision: 244320
> URL: http://svnweb.freebsd.org/changeset/base/244320
> 
> Log:
>   Implement -m option to savecore(8) that allows to limit number of kernel
>   dumps stored. Once the limit is reached it restarts from 0.

Why restart at zero?  The old behavior is that if you rm'd /var/crash/vmcore.0 
then new dumps would just get increasing numbers.  That seems fine (just 
delete the "oldest" core dumps if you are out of room).  I guess the 
restarting lets you be lazy and avoid finding the "oldest" dump via a glob, 
but:

The real feature request was not a limit on the number of core dumps IIRC, but 
a way to specify a minimum amount of free space in the partition and to delete 
tne oldest dump if the new dump would put the partition over the limit.  To do 
this you have to be able to find the "oldest" dump, so if you solve this you 
no longer have to rely on rotating names (and no longer need a 'last' link).

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


Re: svn commit: r244112 - head/sys/kern

2012-12-18 Thread John Baldwin
On Sunday, December 16, 2012 10:05:48 pm Adrian Chadd wrote:
> On 16 December 2012 15:32, Navdeep Parhar  wrote:
> 
> 
> >> The status quo _does not change_ by default.
> >
> > So now we have a knob that could be used to change the behaviour of all
> > the KASSERTs in the system; one that hints that it may be possible to
> > continue even if an assertion in the FreeBSD kernel doesn't hold good
> > (this is the part that bothers me).  I know all the KASSERTs I've looked
> > at or written are genuine assertions -- the code simply wouldn't be able
> > to cope if they were violated.  You'd get NULL dereferences, or worse,
> > access protected structures without corresponding locks held, etc.
> 
> In that case, those failures should be handled gracefully, or they
> should immediately panic the kernel.
> 
> Claiming that a KASSERT() is optional at this point is basically us as
> a project saying "We know that if the kernel gets to this point and it
> fails this check, everything is busted after this." Ie, "Hey, if you
> disable KASSERT(), your data is potentially toast."
> 
> Yet we ship with KASSERT() disabled. Silent data corruption, race
> conditions, etc. Not everything leads to a NULL pointer dereference.
> 
> Again, we ship with KASSERT disabled in GENERIC on shipping production
> releases. The concerns you have with KASSERT printing out when
> Alfred's modification is enabled -does not change the fact that the
> kernel does _EXACTLY THIS_ kind of "oh well, I'll keep going"
> behaviour in a GENERIC, production, release kernel-.

It seems to me that if you are willing to pay the cost of extra sanity checks, 
you should gain the extra protection against data corruption.  We have made 
the design decision to trade the extra data protection for increased 
performance in GENERIC since we feel the cases of data corruption should be 
rare.  In HEAD we have altered the tradeoff since code in HEAD has had less 
testing and is thus assumed to be more risky.  In your case you seem to be 
trading performance for reduced data protection.  Can you at least appreciate 
that argument?

Also, to Alfred's point that "we have spare CPU lying around".  Performance
is not only measured in throughput, it can also be measured in latency.

One other note: have you noticed that there is not a similar "whine but don't 
core" option for the userland assert()?  OTOH, there are such things in glib 
and the core KDE libraries.  Try firing up a gnome or KDE application in a 
terminal window.  You will be greeted by an endless stream of various debug 
messages.  The noise is so great that I haven't bothered to report any of them 
as bugs.  OTOH, I do open bugs if a KDE app cores.  It would not surprise me 
to find that enabling KASSERTS but having them only log doesn't actually help 
with anything as the extra logging could prove so noisy that no one bothers 
reporting them (and/or you end up with spurious noise due to secondary 
failures similar to the noise one can get with compiler warnings).

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


svn commit: r244406 - in head: share/man/man4 sys/dev/arcmsr

2012-12-18 Thread Xin LI
Author: delphij
Date: Tue Dec 18 20:47:23 2012
New Revision: 244406
URL: http://svnweb.freebsd.org/changeset/base/244406

Log:
  Update arcmsr(4) to vendor version 1.20.00.26, this adds
  support for their new RAID adapter ARC-1214.
  
  Many thanks to Areca for continuing to support FreeBSD.
  
  Submitted by: 黃清隆 Ching-Lung Huang 
  MFC after:2 weeks

Modified:
  head/share/man/man4/arcmsr.4
  head/sys/dev/arcmsr/arcmsr.c
  head/sys/dev/arcmsr/arcmsr.h

Modified: head/share/man/man4/arcmsr.4
==
--- head/share/man/man4/arcmsr.4Tue Dec 18 20:02:53 2012
(r244405)
+++ head/share/man/man4/arcmsr.4Tue Dec 18 20:47:23 2012
(r244406)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 3, 2012
+.Dd December 18, 2012
 .Dt ARCMSR 4
 .Os
 .Sh NAME
@@ -100,6 +100,8 @@ ARC-1212
 .It
 ARC-1213
 .It
+ARC-1214
+.It
 ARC-1220
 .It
 ARC-1222

Modified: head/sys/dev/arcmsr/arcmsr.c
==
--- head/sys/dev/arcmsr/arcmsr.cTue Dec 18 20:02:53 2012
(r244405)
+++ head/sys/dev/arcmsr/arcmsr.cTue Dec 18 20:47:23 2012
(r244406)
@@ -10,8 +10,7 @@
 
**
 
 **
-** Copyright (c) 2004-2010 ARECA Co. Ltd.
-**Erich Chen, Taipei Taiwan All rights reserved.
+** Copyright (C) 2002 - 2010, Areca Technology Corporation All rights reserved.
 **
 ** Redistribution and use in source and binary forms, with or without
 ** modification, are permitted provided that the following conditions
@@ -74,6 +73,7 @@
 ** 1.20.00.23   01/30/2012  Ching Huang  Fixed Request 
requeued and Retrying command
 ** 1.20.00.24   06/11/2012  Ching Huang  Fixed return sense 
data condition
 ** 1.20.00.25   08/17/2012  Ching Huang  Fixed hotplug device 
no function on type A adapter
+** 1.20.00.26   12/14/2012  Ching Huang  Added support ARC1214
 
**
 */
 
@@ -129,24 +129,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#define ARCMSR_LOCK_INIT(l, s) mtx_init(l, s, NULL, MTX_DEF)
-#define ARCMSR_LOCK_DESTROY(l) mtx_destroy(l)
-#define ARCMSR_LOCK_ACQUIRE(l) mtx_lock(l)
-#define ARCMSR_LOCK_RELEASE(l) mtx_unlock(l)
-#define ARCMSR_LOCK_TRY(l) mtx_trylock(l)
-#define arcmsr_htole32(x)  htole32(x)
-typedef struct mtx arcmsr_lock_t;
 #else
 #include 
 #include 
 #include 
-#define ARCMSR_LOCK_INIT(l, s) simple_lock_init(l)
-#define ARCMSR_LOCK_DESTROY(l)
-#define ARCMSR_LOCK_ACQUIRE(l) simple_lock(l)
-#define ARCMSR_LOCK_RELEASE(l) simple_unlock(l)
-#define ARCMSR_LOCK_TRY(l) simple_lock_try(l)
-#define arcmsr_htole32(x)  (x)
-typedef struct simplelock  arcmsr_lock_t;
 #endif
 
 #if !defined(CAM_NEW_TRAN_CODE) && __FreeBSD_version >= 700025
@@ -159,23 +145,15 @@ __FBSDID("$FreeBSD$");
 #define arcmsr_callout_init(a) callout_init(a);
 #endif
 
-#define ARCMSR_DRIVER_VERSION  "Driver Version 1.20.00.25 
2012-08-17"
+#define ARCMSR_DRIVER_VERSION  "Driver Version 1.20.00.26 2012-12-14"
 #include 
-#defineSRB_SIZE
((sizeof(struct CommandControlBlock)+0x1f) & 0xffe0)
-#define ARCMSR_SRBS_POOL_SIZE   (SRB_SIZE * ARCMSR_MAX_FREESRB_NUM)
-/*
-**
-**
-*/
-#define CHIP_REG_READ32(s, b, r)   bus_space_read_4(acb->btag[b], 
acb->bhandle[b], offsetof(struct s, r))
-#define CHIP_REG_WRITE32(s, b, r, d)   bus_space_write_4(acb->btag[b], 
acb->bhandle[b], offsetof(struct s, r), d)
 /*
 **
 **
 */
 static void arcmsr_free_srb(struct CommandControlBlock *srb);
-static struct CommandControlBlock * arcmsr_get_freesrb(struct 
AdapterControlBlock *acb);
-static u_int8_t arcmsr_seek_cmd2abort(union ccb * abortccb);
+static struct CommandControlBlock *arcmsr_get_freesrb(struct 
AdapterControlBlock *acb);
+static u_int8_t arcmsr_seek_cmd2abort(union ccb *abortccb);
 static int arcmsr_probe(device_t dev);
 static int arcmsr_attach(device_t dev);
 static int arcmsr_detach(device_t dev);
@@ -190,18 +168,20 @@ static void arcmsr_stop_adapter_bgrb(str
 static void arcmsr_start_adapter_bgrb(struct AdapterControlBlock *acb);
 static void arcmsr_iop_init(struct AdapterControlBlock *acb);
 static void arcmsr_flush_adapter_ca

svn commit: r244407 - in head: tools/regression/usr.bin/printf usr.bin/printf

2012-12-18 Thread Eitan Adler
Author: eadler
Date: Tue Dec 18 21:02:38 2012
New Revision: 244407
URL: http://svnweb.freebsd.org/changeset/base/244407

Log:
  POSIX requires that non-existent or null arguments be treated as if a
  zero argument were supplied.
  
  Add a regression test to catch this case as well.
  
  PR:   bin/174521
  Submitted by: Daniel Shahaf  (pr)
  Submitted by: Mark Johnston  (initial patch)
  Reviewed by:  jilles
  Approved by:  cperciva (implicit)
  MFC after:3 weeks

Added:
  head/tools/regression/usr.bin/printf/regress.zero.out   (contents, props 
changed)
Modified:
  head/tools/regression/usr.bin/printf/regress.sh
  head/usr.bin/printf/printf.c

Modified: head/tools/regression/usr.bin/printf/regress.sh
==
--- head/tools/regression/usr.bin/printf/regress.sh Tue Dec 18 20:47:23 
2012(r244406)
+++ head/tools/regression/usr.bin/printf/regress.sh Tue Dec 18 21:02:38 
2012(r244407)
@@ -2,7 +2,7 @@
 
 REGRESSION_START($1)
 
-echo '1..11'
+echo '1..12'
 
 REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"')
 REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 
123')
@@ -15,5 +15,6 @@ REGRESSION_TEST(`m3', `printf "%%%s\n" a
 REGRESSION_TEST(`m4', `printf "%d,%f,%c,%s\n"')
 REGRESSION_TEST(`m5', `printf -- "-d\n"')
 REGRESSION_TEST(`s', `printf "%.3s,%-5s\n" abcd abc')
+REGRESSION_TEST('zero', `printf "%u%u\n" 15')
 
 REGRESSION_END()

Added: head/tools/regression/usr.bin/printf/regress.zero.out
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/regression/usr.bin/printf/regress.zero.out   Tue Dec 18 
21:02:38 2012(r244407)
@@ -0,0 +1 @@
+150

Modified: head/usr.bin/printf/printf.c
==
--- head/usr.bin/printf/printf.cTue Dec 18 20:47:23 2012
(r244406)
+++ head/usr.bin/printf/printf.cTue Dec 18 21:02:38 2012
(r244407)
@@ -473,7 +473,7 @@ getnum(intmax_t *ip, uintmax_t *uip, int
int rval;
 
if (!*gargv) {
-   *ip = 0;
+   *ip = *uip = 0;
return (0);
}
if (**gargv == '"' || **gargv == '\'') {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r244112 - head/sys/kern

2012-12-18 Thread John Baldwin
On Monday, December 17, 2012 4:21:43 pm Alfred Perlstein wrote:
> On 12/17/12 11:39 AM, John Baldwin wrote:
> > On Saturday, December 15, 2012 1:04:17 am Bruce Evans wrote:
> >> On Fri, 14 Dec 2012, Alfred Perlstein wrote:
> >>
> >>> On 12/14/12 4:12 PM, Robert Watson wrote:
>  On Fri, 14 Dec 2012, John Baldwin wrote:
> 
> > On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote:
> >> On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: A> 
> >> The
> >> problem again is that not all the KASSERTS are inviolable, if you A> 
> >> want
> >> to do a project to split them, then please do, it would really be A>
> >> helpful, as for now, they are a mis-mash of death/warnings and there 
> >> are
> >> A> at least three vendors who approve of this as well as 3 long term A>
> >> committers that approved my change (not including Adrian).
> >>
> >> Can you show examples of not inviolable KASSERTs?
> > There are none.  They are all assertions for a reason.  However, in my
> >> Not even one whose existence is a bug? :-)
> > They should just not exist at all then. :)  All the more reason for them to
> > panic early and often so developers will be prompted to remove them.
> >
> This is hard to explain to a customer.
> 
> customer: "So we ran your debug image and got you a panic, here is the 
> information.  So can you tell us what is the problem?"
> alfred: "well that is due to XXX other thing that is broken, thanks for 
> helping us resolve that unrelated problem!"
> customer: "i hate you"
> alfred: "get in line."

Are your customers running HEAD?  Assertions in a stable branch have been
through testing and generally aren't bogus, so dying on incorrect assertions
(meaning the assertion tripped for non-buggy code) should not be the common
case.  Thus, that shouldn't really be the basis for an argument on this.

I can also come up with arbitrary strawmen:

customer: "help!  we lost a bunch of data!"
jhb: "oh, well, I can see why: the box reported this critical error while
  your data was still there, but it went ahead and corrupted it all
  anyway even though it knew about the error because I thought you wanted
  longer uptimes"
jhb: "don't worry, I have a patch to fix the error"
customer: "don't bother, we are switching to X"

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


svn commit: r244408 - head/share/mk

2012-12-18 Thread Ed Maste
Author: emaste
Date: Tue Dec 18 21:13:03 2012
New Revision: 244408
URL: http://svnweb.freebsd.org/changeset/base/244408

Log:
  No reason to install debug data with the schg flag

Modified:
  head/share/mk/bsd.lib.mk

Modified: head/share/mk/bsd.lib.mk
==
--- head/share/mk/bsd.lib.mkTue Dec 18 21:02:38 2012(r244407)
+++ head/share/mk/bsd.lib.mkTue Dec 18 21:13:03 2012(r244408)
@@ -282,7 +282,7 @@ _libinstall:
${SHLIB_NAME} ${DESTDIR}${SHLIBDIR}
 .if defined(DEBUG_FLAGS)
${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
-   ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \
+   ${_INSTALLFLAGS} \
${SHLIB_NAME}.symbols ${DESTDIR}${SHLIBDIR}
 .endif
 .if defined(SHLIB_LINK)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244409 - head/tools/regression/usr.bin/printf

2012-12-18 Thread Eitan Adler
Author: eadler
Date: Tue Dec 18 21:42:45 2012
New Revision: 244409
URL: http://svnweb.freebsd.org/changeset/base/244409

Log:
  Add an additional regression tests for other cases to ensure these do not get 
fixed by accident.

Modified:
  head/tools/regression/usr.bin/printf/regress.sh

Modified: head/tools/regression/usr.bin/printf/regress.sh
==
--- head/tools/regression/usr.bin/printf/regress.sh Tue Dec 18 21:13:03 
2012(r244408)
+++ head/tools/regression/usr.bin/printf/regress.sh Tue Dec 18 21:42:45 
2012(r244409)
@@ -16,5 +16,8 @@ REGRESSION_TEST(`m4', `printf "%d,%f,%c,
 REGRESSION_TEST(`m5', `printf -- "-d\n"')
 REGRESSION_TEST(`s', `printf "%.3s,%-5s\n" abcd abc')
 REGRESSION_TEST('zero', `printf "%u%u\n" 15')
+REGRESSION_TEST('zero', `printf "%d%d\n" 15')
+REGRESSION_TEST('zero', `printf "%d%u\n" 15')
+REGRESSION_TEST('zero', `printf "%u%d\n" 15')
 
 REGRESSION_END()
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244410 - head/sys/dev/nvme

2012-12-18 Thread Jim Harris
Author: jimharris
Date: Tue Dec 18 21:50:48 2012
New Revision: 244410
URL: http://svnweb.freebsd.org/changeset/base/244410

Log:
  Do not use taskqueue to defer completion work when using INTx.  INTx now
  matches MSI-X behavior.
  
  Sponsored by: Intel

Modified:
  head/sys/dev/nvme/nvme.c
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_private.h

Modified: head/sys/dev/nvme/nvme.c
==
--- head/sys/dev/nvme/nvme.cTue Dec 18 21:42:45 2012(r244409)
+++ head/sys/dev/nvme/nvme.cTue Dec 18 21:50:48 2012(r244410)
@@ -298,11 +298,6 @@ nvme_detach (device_t dev)
struct nvme_namespace   *ns;
int i;
 
-   if (ctrlr->taskqueue) {
-   taskqueue_drain(ctrlr->taskqueue, &ctrlr->task);
-   taskqueue_free(ctrlr->taskqueue);
-   }
-
for (i = 0; i < NVME_MAX_NAMESPACES; i++) {
ns = &ctrlr->ns[i];
if (ns->cdev)

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==
--- head/sys/dev/nvme/nvme_ctrlr.c  Tue Dec 18 21:42:45 2012
(r244409)
+++ head/sys/dev/nvme/nvme_ctrlr.c  Tue Dec 18 21:50:48 2012
(r244410)
@@ -619,10 +619,12 @@ err:
 }
 
 static void
-nvme_ctrlr_intx_task(void *arg, int pending)
+nvme_ctrlr_intx_handler(void *arg)
 {
struct nvme_controller *ctrlr = arg;
 
+   nvme_mmio_write_4(ctrlr, intms, 1);
+
nvme_qpair_process_completions(&ctrlr->adminq);
 
if (ctrlr->ioq[0].cpl)
@@ -631,15 +633,6 @@ nvme_ctrlr_intx_task(void *arg, int pend
nvme_mmio_write_4(ctrlr, intmc, 1);
 }
 
-static void
-nvme_ctrlr_intx_handler(void *arg)
-{
-   struct nvme_controller *ctrlr = arg;
-
-   nvme_mmio_write_4(ctrlr, intms, 1);
-   taskqueue_enqueue_fast(ctrlr->taskqueue, &ctrlr->task);
-}
-
 static int
 nvme_ctrlr_configure_intx(struct nvme_controller *ctrlr)
 {
@@ -665,12 +658,6 @@ nvme_ctrlr_configure_intx(struct nvme_co
return (ENOMEM);
}
 
-   TASK_INIT(&ctrlr->task, 0, nvme_ctrlr_intx_task, ctrlr);
-   ctrlr->taskqueue = taskqueue_create_fast("nvme_taskq", M_NOWAIT,
-   taskqueue_thread_enqueue, &ctrlr->taskqueue);
-   taskqueue_start_threads(&ctrlr->taskqueue, 1, PI_NET,
-   "%s intx taskq", device_get_nameunit(ctrlr->dev));
-
return (0);
 }
 

Modified: head/sys/dev/nvme/nvme_private.h
==
--- head/sys/dev/nvme/nvme_private.hTue Dec 18 21:42:45 2012
(r244409)
+++ head/sys/dev/nvme/nvme_private.hTue Dec 18 21:50:48 2012
(r244410)
@@ -36,7 +36,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
@@ -222,8 +221,6 @@ struct nvme_controller {
int rid;
struct resource *res;
void*tag;
-   struct task task;
-   struct taskqueue*taskqueue;
 
bus_dma_tag_t   hw_desc_tag;
bus_dmamap_thw_desc_map;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244411 - head/sys/dev/nvme

2012-12-18 Thread Jim Harris
Author: jimharris
Date: Tue Dec 18 22:10:40 2012
New Revision: 244411
URL: http://svnweb.freebsd.org/changeset/base/244411

Log:
  Simplify module definition by adding nvme_modevent to DRIVER_MODULE()
  definition.
  
  Submitted by:   Carl Delsey 

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

Modified: head/sys/dev/nvme/nvme.c
==
--- head/sys/dev/nvme/nvme.cTue Dec 18 21:50:48 2012(r244410)
+++ head/sys/dev/nvme/nvme.cTue Dec 18 22:10:40 2012(r244411)
@@ -53,6 +53,7 @@ MALLOC_DEFINE(M_NVME, "nvme", "nvme(4) m
 static intnvme_probe(device_t);
 static intnvme_attach(device_t);
 static intnvme_detach(device_t);
+static intnvme_modevent(module_t mod, int type, void *arg);
 
 static devclass_t nvme_devclass;
 
@@ -70,7 +71,7 @@ static driver_t nvme_pci_driver = {
sizeof(struct nvme_controller),
 };
 
-DRIVER_MODULE(nvme, pci, nvme_pci_driver, nvme_devclass, 0, 0);
+DRIVER_MODULE(nvme, pci, nvme_pci_driver, nvme_devclass, nvme_modevent, 0);
 MODULE_VERSION(nvme, 1);
 
 static struct _pcsid
@@ -196,14 +197,6 @@ nvme_modevent(module_t mod, int type, vo
return (0);
 }
 
-moduledata_t nvme_mod = {
-   "nvme",
-   (modeventhand_t)nvme_modevent,
-   0
-};
-
-DECLARE_MODULE(nvme, nvme_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
-
 void
 nvme_dump_command(struct nvme_command *cmd)
 {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2012-12-18 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Dec 18 22:18:54 2012
New Revision: 244412
URL: http://svnweb.freebsd.org/changeset/base/244412

Log:
  Add sysctls for changing GPIO pins function
  
  Submitted by: Luiz Otavio O Souza

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_gpio.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2835_gpio.cTue Dec 18 22:10:40 
2012(r244411)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_gpio.cTue Dec 18 22:18:54 
2012(r244412)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -66,6 +67,11 @@ __FBSDID("$FreeBSD$");
 #defineBCM_GPIO_DEFAULT_CAPS   (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | 
\
 GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN)
 
+struct bcm_gpio_sysctl {
+   struct bcm_gpio_softc   *sc;
+   uint32_tpin;
+};
+
 struct bcm_gpio_softc {
device_tsc_dev;
struct mtx  sc_mtx;
@@ -78,6 +84,7 @@ struct bcm_gpio_softc {
int sc_ro_npins;
int sc_ro_pins[BCM_GPIO_PINS];
struct gpio_pin sc_gpio_pins[BCM_GPIO_PINS];
+   struct bcm_gpio_sysctl  sc_sysctl[BCM_GPIO_PINS];
 };
 
 enum bcm_gpio_fsel {
@@ -99,6 +106,7 @@ enum bcm_gpio_pud {
 
 #defineBCM_GPIO_LOCK(_sc)  mtx_lock(&_sc->sc_mtx)
 #defineBCM_GPIO_UNLOCK(_sc)mtx_unlock(&_sc->sc_mtx)
+#defineBCM_GPIO_LOCK_ASSERT(_sc)   mtx_assert(&_sc->sc_mtx, 
MA_OWNED)
 
 #defineBCM_GPIO_GPFSEL(_bank)  0x00 + _bank * 4
 #defineBCM_GPIO_GPSET(_bank)   0x1c + _bank * 4
@@ -126,53 +134,89 @@ bcm_gpio_pin_is_ro(struct bcm_gpio_softc
 static uint32_t
 bcm_gpio_get_function(struct bcm_gpio_softc *sc, uint32_t pin)
 {
-   uint32_t bank, data, offset;
+   uint32_t bank, func, offset;
 
/* Five banks, 10 pins per bank, 3 bits per pin. */
bank = pin / 10;
offset = (pin - bank * 10) * 3;
 
BCM_GPIO_LOCK(sc);
-   data = (BCM_GPIO_READ(sc, BCM_GPIO_GPFSEL(bank)) >> offset) & 7;
+   func = (BCM_GPIO_READ(sc, BCM_GPIO_GPFSEL(bank)) >> offset) & 7;
BCM_GPIO_UNLOCK(sc);
 
-#ifdef DEBUG
-   device_printf(sc->sc_dev, "pin %d function: ", pin);
-   switch (data) {
+   return (func);
+}
+
+static void
+bcm_gpio_func_str(uint32_t nfunc, char *buf, int bufsize)
+{
+
+   switch (nfunc) {
case BCM_GPIO_INPUT:
-   printf("input\n");
+   strncpy(buf, "input", bufsize);
break;
case BCM_GPIO_OUTPUT:
-   printf("output\n");
+   strncpy(buf, "output", bufsize);
break;
case BCM_GPIO_ALT0:
-   printf("alt0\n");
+   strncpy(buf, "alt0", bufsize);
break;
case BCM_GPIO_ALT1:
-   printf("alt1\n");
+   strncpy(buf, "alt1", bufsize);
break;
case BCM_GPIO_ALT2:
-   printf("alt2\n");
+   strncpy(buf, "alt2", bufsize);
break;
case BCM_GPIO_ALT3:
-   printf("alt3\n");
+   strncpy(buf, "alt3", bufsize);
break;
case BCM_GPIO_ALT4:
-   printf("alt4\n");
+   strncpy(buf, "alt4", bufsize);
break;
case BCM_GPIO_ALT5:
-   printf("alt5\n");
+   strncpy(buf, "alt5", bufsize);
break;
+   default:
+   strncpy(buf, "invalid", bufsize);
}
-#endif
+}
+
+static int
+bcm_gpio_str_func(char *func, uint32_t *nfunc)
+{
+
+   if (strcasecmp(func, "input") == 0)
+   *nfunc = BCM_GPIO_INPUT;
+   else if (strcasecmp(func, "output") == 0)
+   *nfunc = BCM_GPIO_OUTPUT;
+   else if (strcasecmp(func, "alt0") == 0)
+   *nfunc = BCM_GPIO_ALT0;
+   else if (strcasecmp(func, "alt1") == 0)
+   *nfunc = BCM_GPIO_ALT1;
+   else if (strcasecmp(func, "alt2") == 0)
+   *nfunc = BCM_GPIO_ALT2;
+   else if (strcasecmp(func, "alt3") == 0)
+   *nfunc = BCM_GPIO_ALT3;
+   else if (strcasecmp(func, "alt4") == 0)
+   *nfunc = BCM_GPIO_ALT4;
+   else if (strcasecmp(func, "alt5") == 0)
+   *nfunc = BCM_GPIO_ALT5;
+   else
+   return (-1);
 
-   switch (data) {
+   return (0);
+}
+
+static uint32_t
+bcm_gpio_func_flag(uint32_t nfunc)
+{
+
+   switch (nfunc) {
case BCM_GPIO_INPUT:
return (GPIO_PIN_INPUT);
case BCM_GPIO_OUTPUT:
return (GPIO_PIN_OUTPUT);
}
-
return (0);
 }
 
@@ -181,16 +225,17 @@ bcm_gpio_set_function(struct bcm_gpio_so
 {
uint32_t bank, data, offset;
 
+   /* Must be called with lock held. */
+   BCM_GPIO_LOCK_ASSERT(sc);

Re: svn commit: r244112 - head/sys/kern

2012-12-18 Thread Alfred Perlstein

On 12/18/12 12:37 PM, John Baldwin wrote:

On Monday, December 17, 2012 4:21:43 pm Alfred Perlstein wrote:

On 12/17/12 11:39 AM, John Baldwin wrote:

On Saturday, December 15, 2012 1:04:17 am Bruce Evans wrote:

On Fri, 14 Dec 2012, Alfred Perlstein wrote:


On 12/14/12 4:12 PM, Robert Watson wrote:

On Fri, 14 Dec 2012, John Baldwin wrote:


On Thursday, December 13, 2012 4:02:15 am Gleb Smirnoff wrote:

On Wed, Dec 12, 2012 at 04:53:48PM -0800, Alfred Perlstein wrote: A> The
problem again is that not all the KASSERTS are inviolable, if you A> want
to do a project to split them, then please do, it would really be A>
helpful, as for now, they are a mis-mash of death/warnings and there are
A> at least three vendors who approve of this as well as 3 long term A>
committers that approved my change (not including Adrian).

Can you show examples of not inviolable KASSERTs?

There are none.  They are all assertions for a reason.  However, in my

Not even one whose existence is a bug? :-)

They should just not exist at all then. :)  All the more reason for them to
panic early and often so developers will be prompted to remove them.


This is hard to explain to a customer.

customer: "So we ran your debug image and got you a panic, here is the
information.  So can you tell us what is the problem?"
alfred: "well that is due to XXX other thing that is broken, thanks for
helping us resolve that unrelated problem!"
customer: "i hate you"
alfred: "get in line."

Are your customers running HEAD?  Assertions in a stable branch have been
through testing and generally aren't bogus, so dying on incorrect assertions
(meaning the assertion tripped for non-buggy code) should not be the common
case.  Thus, that shouldn't really be the basis for an argument on this.

I can also come up with arbitrary strawmen:

customer: "help!  we lost a bunch of data!"
jhb: "oh, well, I can see why: the box reported this critical error while
   your data was still there, but it went ahead and corrupted it all
   anyway even though it knew about the error because I thought you wanted
   longer uptimes"
jhb: "don't worry, I have a patch to fix the error"
customer: "don't bother, we are switching to X"



Yes, that happens when they run -stable.

-Alfred

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


svn commit: r244413 - head/sys/dev/nvme

2012-12-18 Thread Jim Harris
Author: jimharris
Date: Tue Dec 18 23:27:18 2012
New Revision: 244413
URL: http://svnweb.freebsd.org/changeset/base/244413

Log:
  Map BAR 4/5, because NVMe spec says devices may place the MSI-X table
  behind BAR 4/5, rather than in BAR 0/1 with the control/doorbell registers.
  
  Sponsored by: Intel

Modified:
  head/sys/dev/nvme/nvme.c
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_private.h

Modified: head/sys/dev/nvme/nvme.c
==
--- head/sys/dev/nvme/nvme.cTue Dec 18 22:18:54 2012(r244412)
+++ head/sys/dev/nvme/nvme.cTue Dec 18 23:27:18 2012(r244413)
@@ -313,6 +313,11 @@ nvme_detach (device_t dev)
ctrlr->resource_id, ctrlr->resource);
}
 
+   if (ctrlr->bar4_resource != NULL) {
+   bus_release_resource(dev, SYS_RES_MEMORY,
+   ctrlr->bar4_resource_id, ctrlr->bar4_resource);
+   }
+
 #ifdef CHATHAM2
if (ctrlr->chatham_resource != NULL) {
bus_release_resource(dev, SYS_RES_MEMORY,

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==
--- head/sys/dev/nvme/nvme_ctrlr.c  Tue Dec 18 22:18:54 2012
(r244412)
+++ head/sys/dev/nvme/nvme_ctrlr.c  Tue Dec 18 23:27:18 2012
(r244413)
@@ -78,6 +78,17 @@ nvme_ctrlr_allocate_bar(struct nvme_cont
ctrlr->bus_handle = rman_get_bushandle(ctrlr->resource);
ctrlr->regs = (struct nvme_registers *)ctrlr->bus_handle;
 
+   /*
+* The NVMe spec allows for the MSI-X table to be placed behind
+*  BAR 4/5, separate from the control/doorbell registers.  Always
+*  try to map this bar, because it must be mapped prior to calling
+*  pci_alloc_msix().  If the table isn't behind BAR 4/5,
+*  bus_alloc_resource() will just return NULL which is OK.
+*/
+   ctrlr->bar4_resource_id = PCIR_BAR(4);
+   ctrlr->bar4_resource = bus_alloc_resource(ctrlr->dev, SYS_RES_MEMORY,
+   &ctrlr->bar4_resource_id, 0, ~0, 1, RF_ACTIVE);
+
return (0);
 }
 

Modified: head/sys/dev/nvme/nvme_private.h
==
--- head/sys/dev/nvme/nvme_private.hTue Dec 18 22:18:54 2012
(r244412)
+++ head/sys/dev/nvme/nvme_private.hTue Dec 18 23:27:18 2012
(r244413)
@@ -199,6 +199,14 @@ struct nvme_controller {
int resource_id;
struct resource *resource;
 
+   /*
+* The NVMe spec allows for the MSI-X table to be placed in BAR 4/5,
+*  separate from the control registers which are in BAR 0/1.  These
+*  members track the mapping of BAR 4/5 for that reason.
+*/
+   int bar4_resource_id;
+   struct resource *bar4_resource;
+
 #ifdef CHATHAM2
bus_space_tag_t chatham_bus_tag;
bus_space_handle_t  chatham_bus_handle;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r244112 - head/sys/kern

2012-12-18 Thread Andriy Gapon
on 19/12/2012 00:31 Alfred Perlstein said the following:
> Yes, that happens when they run -stable.

Does it?
Do you have a solution? [*]

[*] - which doesn't involve "it runs so slow I am switching to Y".

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


Re: svn commit: r244112 - head/sys/kern

2012-12-18 Thread Alfred Perlstein

On 12/18/12 2:41 PM, Andriy Gapon wrote:

on 19/12/2012 00:31 Alfred Perlstein said the following:

Yes, that happens when they run -stable.

Does it?
Do you have a solution? [*]

[*] - which doesn't involve "it runs so slow I am switching to Y".



I already suggested that we copy from KTR so that KASSERTS can be 
selectively used in the system.


Another option is probably some dtrace magic where we hot patch the code 
with direct jumps rather than conditional ones if possible.


I'm sure there are plenty of solutions for your problem.

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


svn commit: r244414 - in head/sys/arm: arm include

2012-12-18 Thread Olivier Houchard
Author: cognet
Date: Wed Dec 19 00:24:31 2012
New Revision: 244414
URL: http://svnweb.freebsd.org/changeset/base/244414

Log:
  Properly implement pmap_[get|set]_memattr
  
  Submitted by: Ian Lepore 

Modified:
  head/sys/arm/arm/pmap-v6.c
  head/sys/arm/arm/pmap.c
  head/sys/arm/include/pmap.h
  head/sys/arm/include/vm.h

Modified: head/sys/arm/arm/pmap-v6.c
==
--- head/sys/arm/arm/pmap-v6.c  Tue Dec 18 23:27:18 2012(r244413)
+++ head/sys/arm/arm/pmap-v6.c  Wed Dec 19 00:24:31 2012(r244414)
@@ -1131,6 +1131,7 @@ pmap_page_init(vm_page_t m)
 {
 
TAILQ_INIT(&m->md.pv_list);
+   m->md.pv_memattr = VM_MEMATTR_DEFAULT;
 }
 
 /*
@@ -2662,7 +2663,8 @@ do_l2b_alloc:
if (!(prot & VM_PROT_EXECUTE) && m)
npte |= L2_XN;
 
-   npte |= pte_l2_s_cache_mode;
+   if (!(m->md.pv_memattr & VM_MEMATTR_UNCACHEABLE))
+   npte |= pte_l2_s_cache_mode;
 
if (m && m == opg) {
/*
@@ -3817,3 +3819,22 @@ pmap_dmap_iscurrent(pmap_t pmap)
return(pmap_is_current(pmap));
 }
 
+void
+pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
+{
+   /* 
+* Remember the memattr in a field that gets used to set the appropriate
+* bits in the PTEs as mappings are established.
+*/
+   m->md.pv_memattr = ma;
+
+   /*
+* It appears that this function can only be called before any mappings
+* for the page are established on ARM.  If this ever changes, this code
+* will need to walk the pv_list and make each of the existing mappings
+* uncacheable, being careful to sync caches and PTEs (and maybe
+* invalidate TLB?) for any current mapping it modifies.
+*/
+   if (m->md.pv_kva != 0 || TAILQ_FIRST(&m->md.pv_list) != NULL)
+   panic("Can't change memattr on page with existing mappings");
+}

Modified: head/sys/arm/arm/pmap.c
==
--- head/sys/arm/arm/pmap.c Tue Dec 18 23:27:18 2012(r244413)
+++ head/sys/arm/arm/pmap.c Wed Dec 19 00:24:31 2012(r244414)
@@ -1366,7 +1366,8 @@ pmap_fix_cache(struct vm_page *pg, pmap_
(pv->pv_flags & PVF_NC)) {
 
pv->pv_flags &= ~PVF_NC;
-   pmap_set_cache_entry(pv, pm, va, 1);
+   if (!(pg->md.pv_memattr & VM_MEMATTR_UNCACHEABLE))
+   pmap_set_cache_entry(pv, pm, va, 1);
continue;
}
/* user is no longer sharable and writable */
@@ -1375,7 +1376,8 @@ pmap_fix_cache(struct vm_page *pg, pmap_
!pmwc && (pv->pv_flags & PVF_NC)) {
 
pv->pv_flags &= ~(PVF_NC | PVF_MWC);
-   pmap_set_cache_entry(pv, pm, va, 1);
+   if (!(pg->md.pv_memattr & VM_MEMATTR_UNCACHEABLE))
+   pmap_set_cache_entry(pv, pm, va, 1);
}
}
 
@@ -1426,15 +1428,16 @@ pmap_clearbit(struct vm_page *pg, u_int 
 
if (!(oflags & maskbits)) {
if ((maskbits & PVF_WRITE) && (pv->pv_flags & PVF_NC)) {
-   /* It is safe to re-enable cacheing here. */
-   PMAP_LOCK(pm);
-   l2b = pmap_get_l2_bucket(pm, va);
-   ptep = &l2b->l2b_kva[l2pte_index(va)];
-   *ptep |= pte_l2_s_cache_mode;
-   PTE_SYNC(ptep);
-   PMAP_UNLOCK(pm);
+   if (!(pg->md.pv_memattr & 
+   VM_MEMATTR_UNCACHEABLE)) {
+   PMAP_LOCK(pm);
+   l2b = pmap_get_l2_bucket(pm, va);
+   ptep = &l2b->l2b_kva[l2pte_index(va)];
+   *ptep |= pte_l2_s_cache_mode;
+   PTE_SYNC(ptep);
+   PMAP_UNLOCK(pm);
+   }
pv->pv_flags &= ~(PVF_NC | PVF_MWC);
-   
}
continue;
}
@@ -1463,7 +1466,9 @@ pmap_clearbit(struct vm_page *pg, u_int 
 * permission.
 */
if (maskbits & PVF_WRITE) {
-   npte |= pte_l2_s_cache_mode;
+   if (!(pg->md.pv_memattr & 
+   VM_MEMATTR_UNCACHEABLE))
+   npte |= pte_l2_s_cache_mode;
pv->pv_flags &=

svn commit: r244415 - head/share/misc

2012-12-18 Thread Mark Johnston
Author: markj
Date: Wed Dec 19 04:18:21 2012
New Revision: 244415
URL: http://svnweb.freebsd.org/changeset/base/244415

Log:
  Add myself as a new src committer.
  
  Approved by:  emaste (co-mentor)

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Wed Dec 19 00:24:31 2012
(r244414)
+++ head/share/misc/committers-src.dot  Wed Dec 19 04:18:21 2012
(r244415)
@@ -194,6 +194,7 @@ le [label="Lukas Ertl\n...@freebsd.org\n2
 lstewart [label="Lawrence Stewart\nlstew...@freebsd.org\n2008/10/06"]
 marcel [label="Marcel Moolenaar\nmar...@freebsd.org\n1999/07/03"]
 marius [label="Marius Strobl\nmar...@freebsd.org\n2004/04/17"]
+markj [label="Mark Johnston\nma...@freebsd.org\n2012/12/18"]
 markm [label="Mark Murray\nma...@freebsd.org\n199?/??/??"]
 markus [label="Markus Brueffer\nmar...@freebsd.org\n2006/06/01"]
 matteo [label="Matteo Riondato\nmat...@freebsd.org\n2006/01/18"]
@@ -378,6 +379,7 @@ eivind -> rwatson
 
 emaste -> rstone
 emaste -> dteske
+emaste -> markj
 
 emax -> markus
 
@@ -573,6 +575,8 @@ rrs -> brucec
 rrs -> jchandra
 rrs -> tuexen
 
+rstone -> markj
+
 ru -> ceri
 ru -> cjc
 ru -> eik
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r244416 - stable/9/sys/kern

2012-12-18 Thread Konstantin Belousov
Author: kib
Date: Wed Dec 19 04:24:11 2012
New Revision: 244416
URL: http://svnweb.freebsd.org/changeset/base/244416

Log:
  MFC r243901:
  Fixes to ensure the integrity of the callwheel tailqs.
  
  MFC r243912 (by attilio):
  Rearrange comments, use cached callout flags when callout could have
  been already destroyed.

Modified:
  stable/9/sys/kern/kern_timeout.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/kern_timeout.c
==
--- stable/9/sys/kern/kern_timeout.cWed Dec 19 04:18:21 2012
(r244415)
+++ stable/9/sys/kern/kern_timeout.cWed Dec 19 04:24:11 2012
(r244416)
@@ -441,15 +441,13 @@ static void
 callout_cc_del(struct callout *c, struct callout_cpu *cc)
 {
 
-   if (cc->cc_next == c)
-   cc->cc_next = TAILQ_NEXT(c, c_links.tqe);
-   if (c->c_flags & CALLOUT_LOCAL_ALLOC) {
-   c->c_func = NULL;
-   SLIST_INSERT_HEAD(&cc->cc_callfree, c, c_links.sle);
-   }
+   if ((c->c_flags & CALLOUT_LOCAL_ALLOC) == 0)
+   return;
+   c->c_func = NULL;
+   SLIST_INSERT_HEAD(&cc->cc_callfree, c, c_links.sle);
 }
 
-static struct callout *
+static void
 softclock_call_cc(struct callout *c, struct callout_cpu *cc, int *mpcalls,
 int *lockcalls, int *gcalls)
 {
@@ -471,7 +469,9 @@ softclock_call_cc(struct callout *c, str
static timeout_t *lastfunc;
 #endif
 
-   cc->cc_next = TAILQ_NEXT(c, c_links.tqe);
+   KASSERT((c->c_flags & (CALLOUT_PENDING | CALLOUT_ACTIVE)) ==
+   (CALLOUT_PENDING | CALLOUT_ACTIVE),
+   ("softclock_call_cc: pend|act %p %x", c, c->c_flags));
class = (c->c_lock != NULL) ? LOCK_CLASS(c->c_lock) : NULL;
sharedlock = (c->c_flags & CALLOUT_SHAREDLOCK) ? 0 : 1;
c_lock = c->c_lock;
@@ -539,20 +539,7 @@ softclock_call_cc(struct callout *c, str
class->lc_unlock(c_lock);
 skip:
CC_LOCK(cc);
-   /*
-* If the current callout is locally allocated (from
-* timeout(9)) then put it on the freelist.
-*
-* Note: we need to check the cached copy of c_flags because
-* if it was not local, then it's not safe to deref the
-* callout pointer.
-*/
-   if (c_flags & CALLOUT_LOCAL_ALLOC) {
-   KASSERT(c->c_flags == CALLOUT_LOCAL_ALLOC,
-   ("corrupted callout"));
-   c->c_func = NULL;
-   SLIST_INSERT_HEAD(&cc->cc_callfree, c, c_links.sle);
-   }
+   KASSERT(cc->cc_curr == c, ("mishandled cc_curr"));
cc->cc_curr = NULL;
if (cc->cc_waiting) {
/*
@@ -561,13 +548,22 @@ skip:
 * If the callout was scheduled for
 * migration just cancel it.
 */
-   if (cc_cme_migrating(cc))
+   if (cc_cme_migrating(cc)) {
cc_cme_cleanup(cc);
+
+   /*
+* It should be assert here that the callout is not
+* destroyed but that is not easy.
+*/
+   c->c_flags &= ~CALLOUT_DFRMIGRATION;
+   }
cc->cc_waiting = 0;
CC_UNLOCK(cc);
wakeup(&cc->cc_waiting);
CC_LOCK(cc);
} else if (cc_cme_migrating(cc)) {
+   KASSERT((c_flags & CALLOUT_LOCAL_ALLOC) == 0,
+   ("Migrating legacy callout %p", c));
 #ifdef SMP
/*
 * If the callout was scheduled for
@@ -580,23 +576,20 @@ skip:
cc_cme_cleanup(cc);
 
/*
-* Handle deferred callout stops
+* It should be assert here that the callout is not destroyed
+* but that is not easy.
+*
+* As first thing, handle deferred callout stops.
 */
if ((c->c_flags & CALLOUT_DFRMIGRATION) == 0) {
CTR3(KTR_CALLOUT,
 "deferred cancelled %p func %p arg %p",
 c, new_func, new_arg);
callout_cc_del(c, cc);
-   goto nextc;
+   return;
}
-
c->c_flags &= ~CALLOUT_DFRMIGRATION;
 
-   /*
-* It should be assert here that the
-* callout is not destroyed but that
-* is not easy.
-*/
new_cc = callout_cpu_switch(c, cc, new_cpu);
callout_cc_add(c, new_cc, new_ticks, new_func, new_arg,
new_cpu);
@@ -606,10 +599,19 @@ skip:
panic("migration should not happen");
 #endif
}
-#ifdef SMP
-nextc:
-#endif
-   return (cc->cc_next);
+   /*
+* If the current callout is locally allocated (from
+  

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

2012-12-18 Thread Alan Cox
Author: alc
Date: Wed Dec 19 05:07:27 2012
New Revision: 244417
URL: http://svnweb.freebsd.org/changeset/base/244417

Log:
  Eliminate some definitions that haven't been used in a decade or more.

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

Modified: head/sys/mips/include/param.h
==
--- head/sys/mips/include/param.h   Wed Dec 19 04:24:11 2012
(r244416)
+++ head/sys/mips/include/param.h   Wed Dec 19 05:07:27 2012
(r244417)
@@ -163,20 +163,6 @@
 #defineKSTACK_PAGES2   /* kernel stack */
 #defineKSTACK_GUARD_PAGES  2   /* pages of kstack guard; 0 
disables */
 
-#defineUPAGES  2
-
-/* pages ("clicks") (4096 bytes) to disk blocks */
-#definectod(x) ((x) << (PAGE_SHIFT - DEV_BSHIFT))
-#definedtoc(x) ((x) >> (PAGE_SHIFT - DEV_BSHIFT))
-
-/*
- * Map a ``block device block'' to a file system block.
- * This should be device dependent, and should use the bsize
- * field from the disk label.
- * For now though just use DEV_BSIZE.
- */
-#definebdbtofsb(bn)((bn) / (BLKDEV_IOSIZE/DEV_BSIZE))
-
 /*
  * Mach derived conversion macros
  */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"