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

2014-03-04 Thread Adrian Chadd
Author: adrian
Date: Tue Mar  4 08:01:56 2014
New Revision: 262729
URL: http://svnweb.freebsd.org/changeset/base/262729

Log:
  Handle the newer-style bluetooth message format from the (at least)
  Centrino 2230 firmware.
  
  This fixes the general statistics block to be actually valid.
  
  I've verified this by contrasting the output of iwnstats before and
  after the change.  The general block is now correct.
  
  Tested:
  
  * Intel 5100 (old format stats message)
  * Intel 2230 (new format stats message)

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

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Tue Mar  4 06:55:54 2014(r262728)
+++ head/sys/dev/iwn/if_iwn.c   Tue Mar  4 08:01:56 2014(r262729)
@@ -685,6 +685,13 @@ iwn_attach(device_t dev)
goto fail;
}
 
+#if 0
+   device_printf(sc->sc_dev, "%s: rx_stats=%d, rx_stats_bt=%d\n",
+   __func__,
+   sizeof(struct iwn_stats),
+   sizeof(struct iwn_stats_bt));
+#endif
+
if (bootverbose)
ieee80211_announce(ic);
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);
@@ -3143,11 +3150,62 @@ iwn5000_rx_calib_results(struct iwn_soft
 
 static void
 iwn_stats_update(struct iwn_softc *sc, struct iwn_calib_state *calib,
-struct iwn_stats *stats)
+struct iwn_stats *stats, int len)
 {
+   struct iwn_stats_bt *stats_bt;
+   struct iwn_stats *lstats;
+
+   /*
+* First - check whether the length is the bluetooth or normal.
+*
+* If it's normal - just copy it and bump out.
+* Otherwise we have to convert things.
+*/
+
+   if (len == sizeof(struct iwn_stats) + 4) {
+   memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats));
+   sc->last_stat_valid = 1;
+   return;
+   }
 
-   /* XXX lock assert */
-   memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats));
+   /*
+* If it's not the bluetooth size - log, then just copy.
+*/
+   if (len != sizeof(struct iwn_stats_bt) + 4) {
+   DPRINTF(sc, IWN_DEBUG_STATS,
+   "%s: size of rx statistics (%d) not an expected size!\n",
+   __func__,
+   len);
+   memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats));
+   sc->last_stat_valid = 1;
+   return;
+   }
+
+   /*
+* Ok. Time to copy.
+*/
+   stats_bt = (struct iwn_stats_bt *) stats;
+   lstats = &sc->last_stat;
+
+   /* flags */
+   lstats->flags = stats_bt->flags;
+   /* rx_bt */
+   memcpy(&lstats->rx.ofdm, &stats_bt->rx_bt.ofdm,
+   sizeof(struct iwn_rx_phy_stats));
+   memcpy(&lstats->rx.cck, &stats_bt->rx_bt.cck,
+   sizeof(struct iwn_rx_phy_stats));
+   memcpy(&lstats->rx.general, &stats_bt->rx_bt.general_bt.common,
+   sizeof(struct iwn_rx_general_stats));
+   memcpy(&lstats->rx.ht, &stats_bt->rx_bt.ht,
+   sizeof(struct iwn_rx_ht_phy_stats));
+   /* tx */
+   memcpy(&lstats->tx, &stats_bt->tx,
+   sizeof(struct iwn_tx_stats));
+   /* general */
+   memcpy(&lstats->general, &stats_bt->general,
+   sizeof(struct iwn_general_stats));
+
+   /* XXX TODO: Squirrel away the extra bluetooth stats somewhere */
sc->last_stat_valid = 1;
 }
 
@@ -3165,6 +3223,7 @@ iwn_rx_statistics(struct iwn_softc *sc, 
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps);
struct iwn_calib_state *calib = &sc->calib;
struct iwn_stats *stats = (struct iwn_stats *)(desc + 1);
+   struct iwn_stats *lstats;
int temp;
 
DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);
@@ -3179,15 +3238,26 @@ iwn_rx_statistics(struct iwn_softc *sc, 
 
bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD);
 
-   DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: received statistics, cmd %d\n",
-   __func__, desc->type);
+   DPRINTF(sc, IWN_DEBUG_CALIBRATE | IWN_DEBUG_STATS,
+   "%s: received statistics, cmd %d, len %d\n",
+   __func__, desc->type, le16toh(desc->len));
sc->calib_cnt = 0;  /* Reset TX power calibration timeout. */
 
-   /* Collect/track general statistics for reporting */
-   iwn_stats_update(sc, calib, stats);
+   /*
+* Collect/track general statistics for reporting.
+*
+* This takes care of ensuring that the bluetooth sized message
+* will be correctly converted to the legacy sized message.
+*/
+   iwn_stats_update(sc, calib, stats, le16toh(desc->len));
+
+   /*
+* And now, let's take a reference of it to use!
+*/
+   lstats = &sc->last_stat;
 
/* Test if temperature has changed. */
-   if (stats->general.temp != sc->rawtemp) {
+   if (lstats->general.temp != s

Re: svn commit: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-com

2014-03-04 Thread Dag-Erling Smørgrav
Pawel Jakub Dawidek  writes:
> Dimitry Andric  writes:
> > Wouldn't it be enough to merge r261499 ("Fix installations that use
> > kernels without CAPABILITIES support") by pjd?
> Yes, my change should be definiately merged with OpenSSH merge. If
> nobody beats me to it, I should be able to merge it tomorrow.

Please do.  I thought I had included it in the MFC since it was already
in head, but I'd forgotten that it had been committed separately.

BTW, IWBNI there were a cap_available() predicate or something like that
which we could check up front, and short-circuit the entire Capsicum
part of ssh_sandbox_child() if it failed.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
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: r262730 - head/tests/sys/kern

2014-03-04 Thread Peter Holm
Author: pho
Date: Tue Mar  4 10:47:35 2014
New Revision: 262730
URL: http://svnweb.freebsd.org/changeset/base/262730

Log:
  Changed name of test case to a more descriptive one and moved
  comment to the "descr" property.
  
  Suggested by:  jmmv
  Sponsored by: EMC / Isilon storage division

Modified:
  head/tests/sys/kern/kern_descrip_test.c

Modified: head/tests/sys/kern/kern_descrip_test.c
==
--- head/tests/sys/kern/kern_descrip_test.c Tue Mar  4 08:01:56 2014
(r262729)
+++ head/tests/sys/kern/kern_descrip_test.c Tue Mar  4 10:47:35 2014
(r262730)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013 EMC Corp.
+ * Copyright (c) 2014 EMC Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -52,14 +52,12 @@ ATF_TC_BODY(dup2_simple, tc)
ATF_REQUIRE(bcmp(&sb1, &sb2, sizeof(sb1)) == 0);
 }
 
-/*
-   Regression test for r234131:
-   Return EBADF instead of EMFILE from dup2 when the second argument is
-   outside the range of valid file descriptors
- */
-
-ATF_TC_WITHOUT_HEAD(dup2_r234131);
-ATF_TC_BODY(dup2_r234131, tc)
+ATF_TC(dup2__ebadf_when_2nd_arg_out_of_range);
+ATF_TC_HEAD(dup2__ebadf_when_2nd_arg_out_of_range, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Regression test for r234131");
+}
+ATF_TC_BODY(dup2__ebadf_when_2nd_arg_out_of_range, tc)
 {
int fd1, fd2, ret;
 
@@ -74,7 +72,7 @@ ATF_TP_ADD_TCS(tp)
 {
 
 ATF_TP_ADD_TC(tp, dup2_simple);
-ATF_TP_ADD_TC(tp, dup2_r234131);
+ATF_TP_ADD_TC(tp, dup2__ebadf_when_2nd_arg_out_of_range);
 
 return atf_no_error();
 }
___
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: r262731 - in stable/10/lib: libc/iconv libiconv_modules/BIG5 libiconv_modules/HZ libiconv_modules/VIQR

2014-03-04 Thread Tijl Coosemans
Author: tijl
Date: Tue Mar  4 11:43:01 2014
New Revision: 262731
URL: http://svnweb.freebsd.org/changeset/base/262731

Log:
  MFC r262441-262442,262447,262461-262464,262655:
  
  - Consistently pass around context information using a simple pointer.
This fixes some dereferencing bugs in Chinese character set conversions.
  - Fix Simplified Chinese character set conversions by switching around the
fields of an internal struct so it corresponds with the way variables of
this type are initialised.
  - Fix an array index out of bounds bug in iconv VIQR (Vietnamese) module.
  - Silence gcc warning about unsigned comparison with 0.
  
  Also record r258316 and r258587 as merged so they no longer show up as
  eligible.
  
  PR:   185964
  Submitted by: Manuel Mausz 

Modified:
  stable/10/lib/libc/iconv/citrus_prop.c
  stable/10/lib/libc/iconv/citrus_prop.h
  stable/10/lib/libiconv_modules/BIG5/citrus_big5.c
  stable/10/lib/libiconv_modules/HZ/citrus_hz.c
  stable/10/lib/libiconv_modules/VIQR/citrus_viqr.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libc/iconv/citrus_prop.c
==
--- stable/10/lib/libc/iconv/citrus_prop.c  Tue Mar  4 10:47:35 2014
(r262730)
+++ stable/10/lib/libc/iconv/citrus_prop.c  Tue Mar  4 11:43:01 2014
(r262731)
@@ -339,7 +339,7 @@ name_found:
 
 static int
 _citrus_prop_parse_element(struct _memstream * __restrict ms,
-const _citrus_prop_hint_t * __restrict hints, void ** __restrict context)
+const _citrus_prop_hint_t * __restrict hints, void * __restrict context)
 {
int ch, errnum;
 #define _CITRUS_PROP_HINT_NAME_LEN_MAX 255
@@ -435,8 +435,7 @@ _citrus_prop_parse_variable(const _citru
if (ch == EOF || ch == '\0')
break;
_memstream_ungetc(&ms, ch);
-   errnum = _citrus_prop_parse_element(
-   &ms, hints, (void ** __restrict)context);
+   errnum = _citrus_prop_parse_element(&ms, hints, context);
if (errnum != 0)
return (errnum);
}

Modified: stable/10/lib/libc/iconv/citrus_prop.h
==
--- stable/10/lib/libc/iconv/citrus_prop.h  Tue Mar  4 10:47:35 2014
(r262730)
+++ stable/10/lib/libc/iconv/citrus_prop.h  Tue Mar  4 11:43:01 2014
(r262731)
@@ -42,7 +42,7 @@ typedef struct _citrus_prop_hint_t _citr
 
 #define _CITRUS_PROP_CB0_T(_func_, _type_) \
 typedef int (*_citrus_prop_##_func_##_cb_func_t) \
-(void ** __restrict, const char *, _type_); \
+(void * __restrict, const char *, _type_); \
 typedef struct { \
_citrus_prop_##_func_##_cb_func_t func; \
 } _citrus_prop_##_func_##_cb_t;
@@ -52,7 +52,7 @@ _CITRUS_PROP_CB0_T(str, const char *)
 
 #define _CITRUS_PROP_CB1_T(_func_, _type_) \
 typedef int (*_citrus_prop_##_func_##_cb_func_t) \
-(void ** __restrict, const char *, _type_, _type_); \
+(void * __restrict, const char *, _type_, _type_); \
 typedef struct { \
_citrus_prop_##_func_##_cb_func_t func; \
 } _citrus_prop_##_func_##_cb_t;

Modified: stable/10/lib/libiconv_modules/BIG5/citrus_big5.c
==
--- stable/10/lib/libiconv_modules/BIG5/citrus_big5.c   Tue Mar  4 10:47:35 
2014(r262730)
+++ stable/10/lib/libiconv_modules/BIG5/citrus_big5.c   Tue Mar  4 11:43:01 
2014(r262731)
@@ -172,7 +172,7 @@ _citrus_BIG5_check_excludes(_BIG5Encodin
 }
 
 static int
-_citrus_BIG5_fill_rowcol(void ** __restrict ctx, const char * __restrict s,
+_citrus_BIG5_fill_rowcol(void * __restrict ctx, const char * __restrict s,
 uint64_t start, uint64_t end)
 {
_BIG5EncodingInfo *ei;
@@ -191,7 +191,7 @@ _citrus_BIG5_fill_rowcol(void ** __restr
 
 static int
 /*ARGSUSED*/
-_citrus_BIG5_fill_excludes(void ** __restrict ctx,
+_citrus_BIG5_fill_excludes(void * __restrict ctx,
 const char * __restrict s __unused, uint64_t start, uint64_t end)
 {
_BIG5EncodingInfo *ei;
@@ -237,7 +237,6 @@ static int
 _citrus_BIG5_encoding_module_init(_BIG5EncodingInfo * __restrict ei,
 const void * __restrict var, size_t lenvar)
 {
-   void *ctx = (void *)ei;
const char *s;
int err;
 
@@ -259,9 +258,9 @@ _citrus_BIG5_encoding_module_init(_BIG5E
}
 
/* fallback Big5-1984, for backward compatibility. */
-   _citrus_BIG5_fill_rowcol((void **)&ctx, "row", 0xA1, 0xFE);
-   _citrus_BIG5_fill_rowcol((void **)&ctx, "col", 0x40, 0x7E);
-   _citrus_BIG5_fill_rowcol((void **)&ctx, "col", 0xA1, 0xFE);
+   _citrus_BIG5_fill_rowcol(ei, "row", 0xA1, 0xFE);
+   _citrus_BIG5_fill_rowcol(ei, "col", 0x40, 0x7E);
+   _citrus_BIG5_fill_rowcol(ei, "col", 0xA1, 0xFE);
 
return (0);
 }

Modified: stable/10/lib/libiconv_modules/HZ/citrus_hz.c
=

svn commit: r262732 - in head/sys/dev/usb: . quirk

2014-03-04 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Mar  4 12:33:18 2014
New Revision: 262732
URL: http://svnweb.freebsd.org/changeset/base/262732

Log:
  Add new quirk.
  
  MFC after:1 week
  PR:   usb/187188
  Submitted by: Hiroo Ono 

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==
--- head/sys/dev/usb/quirk/usb_quirk.c  Tue Mar  4 11:43:01 2014
(r262731)
+++ head/sys/dev/usb/quirk/usb_quirk.c  Tue Mar  4 12:33:18 2014
(r262732)
@@ -93,6 +93,7 @@ static struct usb_quirk_entry usb_quirks
USB_QUIRK(TELEX, MIC1, 0x009, 0x009, UQ_AU_NO_FRAC),
USB_QUIRK(SILICONPORTALS, YAPPHONE, 0x100, 0x100, UQ_AU_INP_ASYNC),
USB_QUIRK(LOGITECH, UN53B, 0x, 0x, UQ_NO_STRINGS),
+   USB_QUIRK(REALTEK, RTL8196EU, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(ELSA, MODEM1, 0x, 0x, UQ_CFG_INDEX_1),
USB_QUIRK(PLANEX2, MZKUE150N, 0x, 0x, UQ_CFG_INDEX_1),
/* Quirks for printer devices */

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsTue Mar  4 11:43:01 2014(r262731)
+++ head/sys/dev/usb/usbdevsTue Mar  4 12:33:18 2014(r262732)
@@ -3688,6 +3688,7 @@ product REALTEK RTL8188CU_1   0x817a  RTL81
 product REALTEK RTL8188CU_20x817b  RTL8188CU
 product REALTEK RTL81870x8187  RTL8187 Wireless Adapter
 product REALTEK RTL8187B_0 0x8189  RTL8187B Wireless Adapter
+product REALTEK RTL8196EU  0x8196  RTL8196EU
 product REALTEK RTL8187B_1 0x8197  RTL8187B Wireless Adapter
 product REALTEK RTL8187B_2 0x8198  RTL8187B Wireless Adapter
 product REALTEK RTL8188CUS 0x818a  RTL8188CUS
___
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: r262733 - head/sys/conf

2014-03-04 Thread Mark Johnston
Author: markj
Date: Tue Mar  4 14:00:49 2014
New Revision: 262733
URL: http://svnweb.freebsd.org/changeset/base/262733

Log:
  Use a full path to the target for make rules which create symlinks @,
  machine and ${MACHINE_CPUARCH}. Otherwise the presence of a file named
  "x86" or "x86.c" in the make path can cause problems.
  
  Submitted by: lwhsu (original version)
  MFC after:1 month

Modified:
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Tue Mar  4 12:33:18 2014(r262732)
+++ head/sys/conf/kmod.mk   Tue Mar  4 14:00:49 2014(r262733)
@@ -238,7 +238,7 @@ beforedepend: ${_ILINKS}
 # causes all the modules to be rebuilt when the directory pointed to changes.
 .for _link in ${_ILINKS}
 .if !exists(${.OBJDIR}/${_link})
-${OBJS}: ${_link}
+${OBJS}: ${.OBJDIR}/${_link}
 .endif
 .endfor
 
@@ -252,18 +252,23 @@ SYSDIR=   ${_dir}
 .error "can't find kernel source tree"
 .endif
 
-${_ILINKS}:
-   @case ${.TARGET} in \
+.for _link in ${_ILINKS}
+.PHONY: ${_link}
+${_link}: ${.OBJDIR}/${_link}
+
+${.OBJDIR}/${_link}:
+   @case ${.TARGET:T} in \
machine) \
path=${SYSDIR}/${MACHINE}/include ;; \
@) \
path=${SYSDIR} ;; \
*) \
-   path=${SYSDIR}/${.TARGET}/include ;; \
+   path=${SYSDIR}/${.TARGET:T}/include ;; \
esac ; \
path=`(cd $$path && /bin/pwd)` ; \
-   ${ECHO} ${.TARGET} "->" $$path ; \
-   ln -sf $$path ${.TARGET}
+   ${ECHO} ${.TARGET:T} "->" $$path ; \
+   ln -sf $$path ${.TARGET:T}
+.endfor
 
 CLEANFILES+= ${PROG} ${KMOD}.kld ${OBJS}
 
___
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: r262734 - in stable/10/sys: kern net netinet

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar  4 14:01:12 2014
New Revision: 262734
URL: http://svnweb.freebsd.org/changeset/base/262734

Log:
  Merge r261590, r261592 from head:
Remove identical vnet sysctl handlers, and handle CTLFLAG_VNET
in the sysctl_root().
  
Note: SYSCTL_VNET_* macros can be removed as well. All is
  needed to virtualize a sysctl oid is set CTLFLAG_VNET on it.
  But for now keep macros in place to avoid large code churn.

Modified:
  stable/10/sys/kern/kern_sysctl.c
  stable/10/sys/net/vnet.c
  stable/10/sys/net/vnet.h
  stable/10/sys/netinet/in_pcb.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_sysctl.c
==
--- stable/10/sys/kern/kern_sysctl.cTue Mar  4 14:00:49 2014
(r262733)
+++ stable/10/sys/kern/kern_sysctl.cTue Mar  4 14:01:12 2014
(r262734)
@@ -1491,7 +1491,10 @@ sysctl_root(SYSCTL_HANDLER_ARGS)
 #endif
oid->oid_running++;
SYSCTL_XUNLOCK();
-
+#ifdef VIMAGE
+   if ((oid->oid_kind & CTLFLAG_VNET) && arg1 != NULL)
+   arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1);
+#endif
if (!(oid->oid_kind & CTLFLAG_MPSAFE))
mtx_lock(&Giant);
error = oid->oid_handler(oid, arg1, arg2, req);

Modified: stable/10/sys/net/vnet.c
==
--- stable/10/sys/net/vnet.cTue Mar  4 14:00:49 2014(r262733)
+++ stable/10/sys/net/vnet.cTue Mar  4 14:01:12 2014(r262734)
@@ -465,47 +465,6 @@ vnet_data_copy(void *start, int size)
 }
 
 /*
- * Variants on sysctl_handle_foo that know how to handle virtualized global
- * variables: if 'arg1' is a pointer, then we transform it to the local vnet
- * offset.
- */
-int
-vnet_sysctl_handle_int(SYSCTL_HANDLER_ARGS)
-{
-
-   if (arg1 != NULL)
-   arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1);
-   return (sysctl_handle_int(oidp, arg1, arg2, req));
-}
-
-int
-vnet_sysctl_handle_opaque(SYSCTL_HANDLER_ARGS)
-{
-
-   if (arg1 != NULL)
-   arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1);
-   return (sysctl_handle_opaque(oidp, arg1, arg2, req));
-}
-
-int
-vnet_sysctl_handle_string(SYSCTL_HANDLER_ARGS)
-{
-
-   if (arg1 != NULL)
-   arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1);
-   return (sysctl_handle_string(oidp, arg1, arg2, req));
-}
-
-int
-vnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS)
-{
-
-   if (arg1 != NULL)
-   arg1 = (void *)(curvnet->vnet_data_base + (uintptr_t)arg1);
-   return (sysctl_handle_int(oidp, arg1, arg2, req));
-}
-
-/*
  * Support for special SYSINIT handlers registered via VNET_SYSINIT()
  * and VNET_SYSUNINIT().
  */

Modified: stable/10/sys/net/vnet.h
==
--- stable/10/sys/net/vnet.hTue Mar  4 14:00:49 2014(r262733)
+++ stable/10/sys/net/vnet.hTue Mar  4 14:01:12 2014(r262734)
@@ -290,15 +290,10 @@ void   vnet_data_free(void *start_arg, in
  * arguments themselves, if required.
  */
 #ifdef SYSCTL_OID
-intvnet_sysctl_handle_int(SYSCTL_HANDLER_ARGS);
-intvnet_sysctl_handle_opaque(SYSCTL_HANDLER_ARGS);
-intvnet_sysctl_handle_string(SYSCTL_HANDLER_ARGS);
-intvnet_sysctl_handle_uint(SYSCTL_HANDLER_ARGS);
-
 #defineSYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr) 
\
SYSCTL_OID(parent, nbr, name,   \
CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access),   \
-   ptr, val, vnet_sysctl_handle_int, "I", descr)
+   ptr, val, sysctl_handle_int, "I", descr)
 #defineSYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler,  
\
fmt, descr) \
CTASSERT(((access) & CTLTYPE) != 0);\
@@ -312,16 +307,16 @@ int   vnet_sysctl_handle_uint(SYSCTL_HANDL
 #defineSYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr)  
\
SYSCTL_OID(parent, nbr, name,   \
CTLTYPE_STRING|CTLFLAG_VNET|(access),   \
-   arg, len, vnet_sysctl_handle_string, "A", descr)
+   arg, len, sysctl_handle_string, "A", descr)
 #defineSYSCTL_VNET_STRUCT(parent, nbr, name, access, ptr, type, descr) 
\
SYSCTL_OID(parent, nbr, name,   \
CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr,  \
-   sizeof(struct type), vnet_sysctl_handle_opaque, "S," #type, \
+   sizeof(struct type), sysctl_handle_opaque, "S," #type,  \
descr)
 #defineSYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr)
\
SYSCTL_OID(parent, nbr, name, 

svn commit: r262735 - in stable/10/sys: net netinet netinet/cc

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar  4 14:05:37 2014
New Revision: 262735
URL: http://svnweb.freebsd.org/changeset/base/262735

Log:
  Merge r261590: Fixup for r261590 (vnet sysctl handlers cleanup)

Modified:
  stable/10/sys/net/vnet.h
  stable/10/sys/netinet/cc/cc_cdg.c
  stable/10/sys/netinet/sctp_sysctl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/vnet.h
==
--- stable/10/sys/net/vnet.hTue Mar  4 14:01:12 2014(r262734)
+++ stable/10/sys/net/vnet.hTue Mar  4 14:05:37 2014(r262735)
@@ -303,7 +303,7 @@ void vnet_data_free(void *start_arg, in
descr)  \
SYSCTL_OID(parent, nbr, name,   \
CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr, len, \
-   vnet_sysctl_handle_opaque, fmt, descr)
+   sysctl_handle_opaque, fmt, descr)
 #defineSYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr)  
\
SYSCTL_OID(parent, nbr, name,   \
CTLTYPE_STRING|CTLFLAG_VNET|(access),   \

Modified: stable/10/sys/netinet/cc/cc_cdg.c
==
--- stable/10/sys/netinet/cc/cc_cdg.c   Tue Mar  4 14:01:12 2014
(r262734)
+++ stable/10/sys/netinet/cc/cc_cdg.c   Tue Mar  4 14:05:37 2014
(r262735)
@@ -81,11 +81,6 @@ __FBSDID("$FreeBSD$");
 
 #defineCAST_PTR_INT(X) (*((int*)(X)))
 
-#ifndefVIMAGE
-#definevnet_sysctl_handle_uint(oidp, arg1, arg2, req) \
-sysctl_handle_int(oidp, arg1, arg2, req)
-#endif
-
 /* Private delay-gradient induced congestion control signal. */
 #defineCC_CDG_DELAY 0x0100
 
@@ -357,7 +352,7 @@ cdg_beta_handler(SYSCTL_HANDLER_ARGS)
(CAST_PTR_INT(req->newptr) == 0 || CAST_PTR_INT(req->newptr) > 100))
return (EINVAL);
 
-   return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req));
+   return (sysctl_handle_int(oidp, arg1, arg2, req));
 }
 
 static int
@@ -367,7 +362,7 @@ cdg_exp_backoff_scale_handler(SYSCTL_HAN
if (req->newptr != NULL && CAST_PTR_INT(req->newptr) < 1)
return (EINVAL);
 
-   return (vnet_sysctl_handle_uint(oidp, arg1, arg2, req));
+   return (sysctl_handle_int(oidp, arg1, arg2, req));
 }
 
 static inline unsigned long

Modified: stable/10/sys/netinet/sctp_sysctl.c
==
--- stable/10/sys/netinet/sctp_sysctl.c Tue Mar  4 14:01:12 2014
(r262734)
+++ stable/10/sys/netinet/sctp_sysctl.c Tue Mar  4 14:05:37 2014
(r262735)
@@ -587,11 +587,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS)
 {
int error;
 
-#ifdef VIMAGE
-   error = vnet_sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, 
req);
-#else
error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2, req);
-#endif
if (error == 0) {
RANGECHK(SCTP_BASE_SYSCTL(sctp_sendspace), 
SCTPCTL_MAXDGRAM_MIN, SCTPCTL_MAXDGRAM_MAX);
RANGECHK(SCTP_BASE_SYSCTL(sctp_recvspace), 
SCTPCTL_RECVSPACE_MIN, SCTPCTL_RECVSPACE_MAX);
___
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: r262736 - head/sys/boot/fdt/dts/arm

2014-03-04 Thread Ian Lepore
Author: ian
Date: Tue Mar  4 14:19:15 2014
New Revision: 262736
URL: http://svnweb.freebsd.org/changeset/base/262736

Log:
  Use an empty ranges statement for the bus, because all the children on the
  bus have their register properties declared as full physical addresses,
  not offsets from a base range for the bus.

Modified:
  head/sys/boot/fdt/dts/arm/imx53x.dtsi

Modified: head/sys/boot/fdt/dts/arm/imx53x.dtsi
==
--- head/sys/boot/fdt/dts/arm/imx53x.dtsi   Tue Mar  4 14:05:37 2014
(r262735)
+++ head/sys/boot/fdt/dts/arm/imx53x.dtsi   Tue Mar  4 14:19:15 2014
(r262736)
@@ -95,7 +95,7 @@
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&tzic>;
-   ranges = <0x0 0x5000 0x1400>;
+   ranges;
 
aips@5000 { /* AIPS1 */
compatible = "fsl,aips-bus", "simple-bus";
___
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: r262737 - in stable/10: share/man/man9 sys/sys sys/vm

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar  4 14:21:07 2014
New Revision: 262737
URL: http://svnweb.freebsd.org/changeset/base/262737

Log:
  Merge 261593 from head:
Provide macros that allow easily export uma(9) zone limits and
current usage via sysctl(9).

Modified:
  stable/10/share/man/man9/zone.9
  stable/10/sys/sys/sysctl.h
  stable/10/sys/vm/uma_core.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man9/zone.9
==
--- stable/10/share/man/man9/zone.9 Tue Mar  4 14:19:15 2014
(r262736)
+++ stable/10/share/man/man9/zone.9 Tue Mar  4 14:21:07 2014
(r262737)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 21, 2013
+.Dd February 7, 2014
 .Dt ZONE 9
 .Os
 .Sh NAME
@@ -71,6 +71,11 @@
 .Fn uma_zone_get_cur "uma_zone_t zone"
 .Ft void
 .Fn uma_zone_set_warning "uma_zone_t zone" "const char *warning"
+.In sys/sysctl.h
+.Fn SYSCTL_UMA_MAX parent nbr name access zone descr
+.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr
+.Fn SYSCTL_UMA_CUR parent nbr name access zone descr
+.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr
 .Sh DESCRIPTION
 The zone allocator provides an efficient interface for managing
 dynamically-sized collections of items of similar size.
@@ -307,6 +312,38 @@ Warnings can be turned off globally by s
 .Va vm.zone_warnings
 sysctl tunable to
 .Va 0 .
+.Pp
+The
+.Fn SYSCTL_UMA_MAX parent nbr name access zone descr
+macro declares a static
+.Xr sysctl
+oid that exports the effective upper limit number of items for a zone.
+The
+.Fa zone
+argument should be a pointer to
+.Vt uma_zone_t .
+A read of the oid returns value obtained through
+.Fn uma_zone_get_max .
+A write to the oid sets new value via
+.Fn uma_zone_set_max .
+The
+.Fn SYSCTL_ADD_UMA_MAX ctx parent nbr name access zone descr
+macro is provided to create this type of oid dynamically.
+.Pp
+The
+.Fn SYSCTL_UMA_CUR parent nbr name access zone descr
+macro declares a static read only
+.Xr sysctl
+oid that exports the approximate current occupancy of the zone.
+The
+.Fa zone
+argument should be a pointer to 
+.Vt uma_zone_t .
+A read of the oid returns value obtained through
+.Fn uma_zone_get_cur .
+The
+.Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name zone descr
+macro is provided to create this type of oid dynamically.
 .Sh RETURN VALUES
 The
 .Fn uma_zalloc

Modified: stable/10/sys/sys/sysctl.h
==
--- stable/10/sys/sys/sysctl.h  Tue Mar  4 14:19:15 2014(r262736)
+++ stable/10/sys/sys/sysctl.h  Tue Mar  4 14:21:07 2014(r262737)
@@ -186,6 +186,9 @@ int sysctl_handle_string(SYSCTL_HANDLER_
 int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS);
 int sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS);
 
+int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS);
+int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS);
+
 int sysctl_dpcpu_int(SYSCTL_HANDLER_ARGS);
 int sysctl_dpcpu_long(SYSCTL_HANDLER_ARGS);
 int sysctl_dpcpu_quad(SYSCTL_HANDLER_ARGS);
@@ -431,6 +434,30 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
sysctl_add_oid(ctx, parent, nbr, name, (access),
\
ptr, arg, handler, fmt, __DESCR(descr))
 
+/* Oid to handle limits on uma(9) zone specified by pointer. */
+#defineSYSCTL_UMA_MAX(parent, nbr, name, access, ptr, descr)   
\
+   SYSCTL_ASSERT_TYPE(INT, ptr, parent, name); \
+   SYSCTL_OID(parent, nbr, name,   \
+   CTLTYPE_INT | CTLFLAG_MPSAFE | (access),\
+   ptr, 0, sysctl_handle_uma_zone_max, "I", descr)
+#defineSYSCTL_ADD_UMA_MAX(ctx, parent, nbr, name, access, ptr, descr)\
+   sysctl_add_oid(ctx, parent, nbr, name,  \
+   CTLTYPE_INT | CTLFLAG_MPSAFE | (access),\
+   SYSCTL_ADD_ASSERT_TYPE(INT, ptr), 0,\
+   sysctl_handle_uma_zone_max, "I", __DESCR(descr))
+
+/* Oid to obtain current use of uma(9) zone specified by pointer. */
+#defineSYSCTL_UMA_CUR(parent, nbr, name, access, ptr, descr)   
\
+   SYSCTL_ASSERT_TYPE(INT, ptr, parent, name); \
+   SYSCTL_OID(parent, nbr, name,   \
+   CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access),   \
+   ptr, 0, sysctl_handle_uma_zone_cur, "I", descr)
+#defineSYSCTL_ADD_UMA_CUR(ctx, parent, nbr, name, access, ptr, descr)  
\
+   sysctl_add_oid(ctx, parent, nbr, name,  \
+   CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD | (access),   \
+   SYSCTL_ADD_ASSERT_TYPE(INT, ptr), 0,\
+   sysctl_handle_uma_zone_cur, "I", __DESCR(descr))
+
 /*
  * A macro to generate a read-only sysctl to indicate the presense of optional
  * kernel features.

svn commit: r262738 - in stable/10: share/man/man9 sys/sys

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar  4 14:23:58 2014
New Revision: 262738
URL: http://svnweb.freebsd.org/changeset/base/262738

Log:
  Merge 261595: simplify the SYSCTL_COUNTER_U64() macro.

Modified:
  stable/10/share/man/man9/counter.9
  stable/10/sys/sys/sysctl.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/man/man9/counter.9
==
--- stable/10/share/man/man9/counter.9  Tue Mar  4 14:21:07 2014
(r262737)
+++ stable/10/share/man/man9/counter.9  Tue Mar  4 14:23:58 2014
(r262738)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 3, 2013
+.Dd February 7, 2014
 .Dt COUNTER 9
 .Os
 .Sh NAME
@@ -52,7 +52,7 @@
 .Ft void
 .Fn counter_u64_zero "counter_u64_t c"
 .In sys/sysctl.h
-.Fn SYSCTL_COUNTER_U64 parent nbr name access ptr val descr
+.Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr
 .Fn SYSCTL_ADD_COUNTER_U64 ctx parent nbr name access ptr descr
 .Sh DESCRIPTION
 .Nm
@@ -126,7 +126,7 @@ value for any moment.
 Clear the counter
 .Fa c
 and set it to zero.
-.It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr val descr
+.It Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr
 Declare a static
 .Xr sysctl
 oid that would represent a

Modified: stable/10/sys/sys/sysctl.h
==
--- stable/10/sys/sys/sysctl.h  Tue Mar  4 14:21:07 2014(r262737)
+++ stable/10/sys/sys/sysctl.h  Tue Mar  4 14:23:58 2014(r262738)
@@ -393,11 +393,11 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
sysctl_handle_64, "QU", __DESCR(descr))
 
 /* Oid for a 64-bit unsigned counter(9).  The pointer must be non NULL. */
-#defineSYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, val, descr)  
\
+#defineSYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, descr)   
\
SYSCTL_ASSERT_TYPE(UINT64, ptr, parent, name);  \
SYSCTL_OID(parent, nbr, name,   \
CTLTYPE_U64 | CTLFLAG_MPSAFE | (access),\
-   ptr, val, sysctl_handle_counter_u64, "QU", descr)
+   ptr, 0, sysctl_handle_counter_u64, "QU", descr)
 
 #defineSYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, 
descr)\
sysctl_add_oid(ctx, parent, nbr, name,  \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r262739 - in stable/10/sys: kern sys vm

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar  4 14:46:30 2014
New Revision: 262739
URL: http://svnweb.freebsd.org/changeset/base/262739

Log:
  Merge r261722, r261723, r261724, r261725 from head:
several minor improvements for UMA_ZPCPU_ZONE zones.

Modified:
  stable/10/sys/kern/subr_counter.c
  stable/10/sys/kern/subr_pcpu.c
  stable/10/sys/sys/pcpu.h
  stable/10/sys/vm/uma.h
  stable/10/sys/vm/uma_core.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/subr_counter.c
==
--- stable/10/sys/kern/subr_counter.c   Tue Mar  4 14:23:58 2014
(r262738)
+++ stable/10/sys/kern/subr_counter.c   Tue Mar  4 14:46:30 2014
(r262739)
@@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$");
 #define IN_SUBR_COUNTER_C
 #include 
  
-static uma_zone_t uint64_pcpu_zone;
-
 void
 counter_u64_zero(counter_u64_t c)
 {
@@ -62,7 +60,7 @@ counter_u64_alloc(int flags)
 {
counter_u64_t r;
 
-   r = uma_zalloc(uint64_pcpu_zone, flags);
+   r = uma_zalloc(pcpu_zone_64, flags);
if (r != NULL)
counter_u64_zero(r);
 
@@ -73,7 +71,7 @@ void
 counter_u64_free(counter_u64_t c)
 {
 
-   uma_zfree(uint64_pcpu_zone, c);
+   uma_zfree(pcpu_zone_64, c);
 }
 
 int
@@ -96,12 +94,3 @@ sysctl_handle_counter_u64(SYSCTL_HANDLER
 
return (0);
 }
-
-static void
-counter_startup(void)
-{
-
-   uint64_pcpu_zone = uma_zcreate("uint64 pcpu", sizeof(uint64_t),
-   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU);
-}
-SYSINIT(counter, SI_SUB_KMEM, SI_ORDER_ANY, counter_startup, NULL);

Modified: stable/10/sys/kern/subr_pcpu.c
==
--- stable/10/sys/kern/subr_pcpu.c  Tue Mar  4 14:23:58 2014
(r262738)
+++ stable/10/sys/kern/subr_pcpu.c  Tue Mar  4 14:46:30 2014
(r262739)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 static MALLOC_DEFINE(M_PCPU, "Per-cpu", "Per-cpu resource accouting.");
@@ -127,6 +128,30 @@ dpcpu_startup(void *dummy __unused)
 SYSINIT(dpcpu, SI_SUB_KLD, SI_ORDER_FIRST, dpcpu_startup, 0);
 
 /*
+ * UMA_PCPU_ZONE zones, that are available for all kernel
+ * consumers. Right now 64 bit zone is used for counter(9)
+ * and pointer zone is used by flowtable.
+ */
+
+uma_zone_t pcpu_zone_64;
+uma_zone_t pcpu_zone_ptr;
+
+static void
+pcpu_zones_startup(void)
+{
+
+   pcpu_zone_64 = uma_zcreate("64 pcpu", sizeof(uint64_t),
+   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU);
+
+   if (sizeof(uint64_t) == sizeof(void *))
+   pcpu_zone_ptr = pcpu_zone_64;
+   else
+   pcpu_zone_ptr = uma_zcreate("ptr pcpu", sizeof(void *),
+   NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU);
+}
+SYSINIT(pcpu_zones, SI_SUB_KMEM, SI_ORDER_ANY, pcpu_zones_startup, NULL);
+
+/*
  * First-fit extent based allocator for allocating space in the per-cpu
  * region reserved for modules.  This is only intended for use by the
  * kernel linkers to place module linker sets.

Modified: stable/10/sys/sys/pcpu.h
==
--- stable/10/sys/sys/pcpu.hTue Mar  4 14:23:58 2014(r262738)
+++ stable/10/sys/sys/pcpu.hTue Mar  4 14:46:30 2014(r262739)
@@ -210,6 +210,13 @@ zpcpu_get(void *base)
return ((char *)(base) + sizeof(struct pcpu) * curcpu);
 }
 
+static inline void *
+zpcpu_get_cpu(void *base, int cpu)
+{
+
+   return ((char *)(base) + sizeof(struct pcpu) * cpu);
+}
+
 /*
  * Machine dependent callouts.  cpu_pcpu_init() is responsible for
  * initializing machine dependent fields of struct pcpu, and

Modified: stable/10/sys/vm/uma.h
==
--- stable/10/sys/vm/uma.h  Tue Mar  4 14:23:58 2014(r262738)
+++ stable/10/sys/vm/uma.h  Tue Mar  4 14:46:30 2014(r262739)
@@ -33,8 +33,8 @@
  *
 */
 
-#ifndef VM_UMA_H
-#define VM_UMA_H
+#ifndef _VM_UMA_H_
+#define _VM_UMA_H_
 
 #include  /* For NULL */
 #include /* For M_* */
@@ -636,6 +636,12 @@ int uma_zone_exhausted(uma_zone_t zone);
 int uma_zone_exhausted_nolock(uma_zone_t zone);
 
 /*
+ * Common UMA_ZONE_PCPU zones.
+ */
+extern uma_zone_t pcpu_zone_64;
+extern uma_zone_t pcpu_zone_ptr;
+
+/*
  * Exported statistics structures to be used by user space monitoring tools.
  * Statistics stream consists of a uma_stream_header, followed by a series of
  * alternative uma_type_header and uma_type_stat structures.
@@ -683,4 +689,4 @@ struct uma_percpu_stat {
uint64_t_ups_reserved[5];   /* Reserved. */
 };
 
-#endif
+#endif /* _VM_UMA_H_ */

Modified: stable/10/sys/vm/uma_core.c
==
--- stable/10/sys/vm/uma_core.c Tue Mar  4 14:23:58 2014

svn commit: r262740 - stable/10/lib/libkvm

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar  4 14:49:05 2014
New Revision: 262740
URL: http://svnweb.freebsd.org/changeset/base/262740

Log:
  Merge r261796 from head:
While it isn't too late and kvm_read_zpcpu() function isn't yet used
outside libkvm(3), change its order of arguments, so that it is the
same as in kvm_read().
  Merge r261805 from head:
Add kvm_getncpus() to obtain mp_ncpus.

Modified:
  stable/10/lib/libkvm/kvm.h
  stable/10/lib/libkvm/kvm_getpcpu.3
  stable/10/lib/libkvm/kvm_pcpu.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libkvm/kvm.h
==
--- stable/10/lib/libkvm/kvm.h  Tue Mar  4 14:46:30 2014(r262739)
+++ stable/10/lib/libkvm/kvm.h  Tue Mar  4 14:49:05 2014(r262740)
@@ -77,6 +77,7 @@ char   *kvm_geterr(kvm_t *);
 char*kvm_getfiles(kvm_t *, int, int, int *);
 int  kvm_getloadavg(kvm_t *, double [], int);
 int  kvm_getmaxcpu(kvm_t *);
+int  kvm_getncpus(kvm_t *);
 void*kvm_getpcpu(kvm_t *, int);
 uint64_t  kvm_counter_u64_fetch(kvm_t *, u_long);
 struct kinfo_proc *
@@ -88,7 +89,7 @@ kvm_t  *kvm_open
 kvm_t   *kvm_openfiles
(const char *, const char *, const char *, int, char *);
 ssize_t  kvm_read(kvm_t *, unsigned long, void *, size_t);
-ssize_t  kvm_read_zpcpu(kvm_t *, void *, u_long, size_t, int);
+ssize_t  kvm_read_zpcpu(kvm_t *, unsigned long, void *, size_t, int);
 ssize_t  kvm_write(kvm_t *, unsigned long, const void *, size_t);
 __END_DECLS
 

Modified: stable/10/lib/libkvm/kvm_getpcpu.3
==
--- stable/10/lib/libkvm/kvm_getpcpu.3  Tue Mar  4 14:46:30 2014
(r262739)
+++ stable/10/lib/libkvm/kvm_getpcpu.3  Tue Mar  4 14:49:05 2014
(r262740)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 11, 2013
+.Dd February 12, 2014
 .Dt KVM_GETPCPU 3
 .Os
 .Sh NAME
@@ -47,10 +47,12 @@
 .Fn kvm_dpcpu_setcpu "kvm_t *kd" "u_int cpu"
 .Ft int
 .Fn kvm_getmaxcpu "kvm_t *kd"
+.Ft int
+.Fn kvm_getncpus "kvm_t *kd"
 .Ft void *
 .Fn kvm_getpcpu "kvm_t *kd" "int cpu"
 .Ft ssize_t
-.Fn kvm_read_zpcpu "kvm_t *kd" "void *buf" "u_long base" "size_t size" "int 
cpu"
+.Fn kvm_read_zpcpu "kvm_t *kd" "u_long base" "void *buf" "size_t size" "int 
cpu"
 .Ft uint64_t
 .Fn kvm_counter_u64_fetch "kvm_t *kd" "u_long base"
 .Sh DESCRIPTION
@@ -73,6 +75,10 @@ The
 function returns the maximum number of CPUs supported by the kernel.
 .Pp
 The
+.Fn kvm_getncpus
+function returns the current number of CPUs in the kernel.
+.Pp
+The
 .Fn kvm_getpcpu
 function returns a buffer holding the per-CPU data for a single CPU.
 This buffer is described by the

Modified: stable/10/lib/libkvm/kvm_pcpu.c
==
--- stable/10/lib/libkvm/kvm_pcpu.c Tue Mar  4 14:46:30 2014
(r262739)
+++ stable/10/lib/libkvm/kvm_pcpu.c Tue Mar  4 14:49:05 2014
(r262740)
@@ -173,6 +173,16 @@ kvm_getmaxcpu(kvm_t *kd)
return (maxcpu);
 }
 
+int
+kvm_getncpus(kvm_t *kd)
+{
+
+   if (mp_ncpus == 0)
+   if (_kvm_pcpu_init(kd) < 0)
+   return (-1);
+   return (mp_ncpus);
+}
+
 static int
 _kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu, int report_error)
 {
@@ -306,7 +316,7 @@ kvm_dpcpu_setcpu(kvm_t *kd, u_int cpu)
  * Obtain a per-CPU copy for given cpu from UMA_ZONE_PCPU allocation.
  */
 ssize_t
-kvm_read_zpcpu(kvm_t *kd, void *buf, u_long base, size_t size, int cpu)
+kvm_read_zpcpu(kvm_t *kd, u_long base, void *buf, size_t size, int cpu)
 {
 
return (kvm_read(kd, (uintptr_t)(base + sizeof(struct pcpu) * cpu),
@@ -327,7 +337,7 @@ kvm_counter_u64_fetch(kvm_t *kd, u_long 
 
r = 0;
for (int i = 0; i < mp_ncpus; i++) {
-   if (kvm_read_zpcpu(kd, &c, base, sizeof(c), i) != sizeof(c))
+   if (kvm_read_zpcpu(kd, base, &c, sizeof(c), i) != sizeof(c))
return (0);
r += c;
}
___
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: r262741 - head/sys/cam

2014-03-04 Thread Alexander Motin
Author: mav
Date: Tue Mar  4 15:07:00 2014
New Revision: 262741
URL: http://svnweb.freebsd.org/changeset/base/262741

Log:
  Do not retry on CAM_FUNC_NOTAVAIL error, but return immediately.
  
  MFC after:2 weeks

Modified:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==
--- head/sys/cam/cam_periph.c   Tue Mar  4 14:49:05 2014(r262740)
+++ head/sys/cam/cam_periph.c   Tue Mar  4 15:07:00 2014(r262741)
@@ -1655,6 +1655,7 @@ cam_periph_error(union ccb *ccb, cam_fla
case CAM_REQ_TOO_BIG:
case CAM_LUN_INVALID:
case CAM_TID_INVALID:
+   case CAM_FUNC_NOTAVAIL:
error = EINVAL;
break;
case CAM_SCSI_BUS_RESET:
___
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: r262742 - head/usr.sbin/lpr/lpr

2014-03-04 Thread David Malone
Author: dwmalone
Date: Tue Mar  4 15:09:57 2014
New Revision: 262742
URL: http://svnweb.freebsd.org/changeset/base/262742

Log:
  Add missing description of du (daemon.user) printcap capability.

Modified:
  head/usr.sbin/lpr/lpr/printcap.5

Modified: head/usr.sbin/lpr/lpr/printcap.5
==
--- head/usr.sbin/lpr/lpr/printcap.5Tue Mar  4 15:07:00 2014
(r262741)
+++ head/usr.sbin/lpr/lpr/printcap.5Tue Mar  4 15:09:57 2014
(r262742)
@@ -82,6 +82,7 @@ call)
 .It "dfstr" Ta Dv NULL Ta No "tex data filter"
 .Tn ( DVI
 format)
+.It "dunum 1   UID to run daemon as"
 .It "ffstr" Ta So Li \ef Sc Ta No "string to send for a form feed"
 .It "foboolfalse   print a form feed when device is opened"
 .It "gfstr" Ta Dv NULL Ta No "graph data filter"
___
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: r262743 - in stable/10: sys/conf sys/net sys/netinet sys/netinet6 usr.bin/netstat

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar  4 15:14:47 2014
New Revision: 262743
URL: http://svnweb.freebsd.org/changeset/base/262743

Log:
  Merge r261582, r261601, r261610, r261613, r261627, r261640, r261641, r261823,
r261825, r261859, r261875, r261883, r261911, r262027, r262028, r262029,
r262030, r262162 from head.
  
Large flowtable revamp. See commit messages for merged revisions for
details.
  
  Sponsored by: Netflix

Added:
  stable/10/usr.bin/netstat/flowtable.c
 - copied, changed from r261601, head/usr.bin/netstat/flowtable.c
Modified:
  stable/10/sys/conf/options
  stable/10/sys/net/flowtable.c
  stable/10/sys/net/flowtable.h
  stable/10/sys/net/route.c
  stable/10/sys/netinet/ip_input.c
  stable/10/sys/netinet/ip_output.c
  stable/10/sys/netinet6/in6_proto.c
  stable/10/sys/netinet6/ip6_input.c
  stable/10/sys/netinet6/ip6_output.c
  stable/10/usr.bin/netstat/Makefile
  stable/10/usr.bin/netstat/main.c
  stable/10/usr.bin/netstat/netstat.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/conf/options
==
--- stable/10/sys/conf/options  Tue Mar  4 15:09:57 2014(r262742)
+++ stable/10/sys/conf/options  Tue Mar  4 15:14:47 2014(r262743)
@@ -438,6 +438,7 @@ TCP_SIGNATURE   opt_inet.h
 VLAN_ARRAY opt_vlan.h
 XBONEHACK
 FLOWTABLE  opt_route.h
+FLOWTABLE_HASH_ALL opt_route.h
 
 #
 # SCTP

Modified: stable/10/sys/net/flowtable.c
==
--- stable/10/sys/net/flowtable.c   Tue Mar  4 15:09:57 2014
(r262742)
+++ stable/10/sys/net/flowtable.c   Tue Mar  4 15:14:47 2014
(r262743)
@@ -1,31 +1,30 @@
-/**
-
-Copyright (c) 2008-2010, BitGravity Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-
- 2. Neither the name of the BitGravity Corporation nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-***/
+/*-
+ * Copyright (c) 2014 Gleb Smirnoff 
+ * Copyright (c) 2008-2010, BitGravity Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *  1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ *  2. Neither the name of the BitGravity Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
 
 #include "opt_route.h"
 #include "opt_mpath.h"
@@ -36,29 +35,32 @@ POSSIBILITY OF SUCH DAMAGE.
 #include 
 __FBSDID("$FreeBSD$");
 
-#include   
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include   
+#include 
 #include 
 #include 
 #include 
 #incl

svn commit: r262744 - head/usr.sbin/bhyve

2014-03-04 Thread Tycho Nightingale
Author: tychon
Date: Tue Mar  4 17:12:06 2014
New Revision: 262744
URL: http://svnweb.freebsd.org/changeset/base/262744

Log:
  Add SMBIOS support.
  
  A new option, -U, can be used to set the UUID in the System
  Information (Type 1) structure.  Manpage fix to follow.
  
  Approved by:  grehan (co-mentor)

Added:
  head/usr.sbin/bhyve/smbiostbl.c   (contents, props changed)
  head/usr.sbin/bhyve/smbiostbl.h   (contents, props changed)
Modified:
  head/usr.sbin/bhyve/Makefile
  head/usr.sbin/bhyve/acpi.c
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/bhyverun.h

Modified: head/usr.sbin/bhyve/Makefile
==
--- head/usr.sbin/bhyve/MakefileTue Mar  4 15:14:47 2014
(r262743)
+++ head/usr.sbin/bhyve/MakefileTue Mar  4 17:12:06 2014
(r262744)
@@ -34,6 +34,7 @@ SRCS= \
pmtmr.c \
post.c  \
rtc.c   \
+   smbiostbl.c \
uart_emul.c \
virtio.c\
xmsr.c  \

Modified: head/usr.sbin/bhyve/acpi.c
==
--- head/usr.sbin/bhyve/acpi.c  Tue Mar  4 15:14:47 2014(r262743)
+++ head/usr.sbin/bhyve/acpi.c  Tue Mar  4 17:12:06 2014(r262744)
@@ -39,14 +39,14 @@
  *
  *  Layout
  *  --
- *   RSDP  ->   0xf0400(36 bytes fixed)
- * RSDT  ->   0xf0440(36 bytes + 4*N table addrs, 2 used)
- * XSDT  ->   0xf0480(36 bytes + 8*N table addrs, 2 used)
- *   MADT  ->   0xf0500  (depends on #CPUs)
- *   FADT  ->   0xf0600  (268 bytes)
- *   HPET  ->   0xf0740  (56 bytes)
- * FACS  ->   0xf0780 (64 bytes)
- * DSDT  ->   0xf0800 (variable - can go up to 0x10)
+ *   RSDP  ->   0xf2400(36 bytes fixed)
+ * RSDT  ->   0xf2440(36 bytes + 4*N table addrs, 2 used)
+ * XSDT  ->   0xf2480(36 bytes + 8*N table addrs, 2 used)
+ *   MADT  ->   0xf2500  (depends on #CPUs)
+ *   FADT  ->   0xf2600  (268 bytes)
+ *   HPET  ->   0xf2740  (56 bytes)
+ * FACS  ->   0xf2780 (64 bytes)
+ * DSDT  ->   0xf2800 (variable - can go up to 0x10)
  */
 
 #include 
@@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$");
  * Define the base address of the ACPI tables, and the offsets to
  * the individual tables
  */
-#define BHYVE_ACPI_BASE0xf0400
+#define BHYVE_ACPI_BASE0xf2400
 #define RSDT_OFFSET0x040
 #define XSDT_OFFSET0x080
 #define MADT_OFFSET0x100

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Tue Mar  4 15:14:47 2014
(r262743)
+++ head/usr.sbin/bhyve/bhyverun.c  Tue Mar  4 17:12:06 2014
(r262744)
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
 #include "mptbl.h"
 #include "pci_emul.h"
 #include "pci_lpc.h"
+#include "smbiostbl.h"
 #include "xmsr.h"
 #include "spinup_ap.h"
 #include "rtc.h"
@@ -82,6 +83,7 @@ typedef int (*vmexit_handler_t)(struct v
 char *vmname;
 
 int guest_ncpus;
+char *guest_uuid_str;
 
 static int pincpu = -1;
 static int guest_vmexit_on_hlt, guest_vmexit_on_pause;
@@ -141,7 +143,8 @@ usage(int code)
"   -l: LPC device configuration\n"
"   -m: memory size in MB\n"
"   -w: ignore unimplemented MSRs\n"
-   "   -x: local apic is in x2APIC mode\n",
+   "   -x: local apic is in x2APIC mode\n"
+   "   -U: uuid\n",
progname, (int)strlen(progname), "");
 
exit(code);
@@ -599,7 +602,7 @@ main(int argc, char *argv[])
guest_ncpus = 1;
memsize = 256 * MB;
 
-   while ((c = getopt(argc, argv, "abehwxAHIPWp:g:c:s:m:l:")) != -1) {
+   while ((c = getopt(argc, argv, "abehwxAHIPWp:g:c:s:m:l:U:")) != -1) {
switch (c) {
case 'a':
x2apic_mode = 0;
@@ -653,6 +656,9 @@ main(int argc, char *argv[])
case 'e':
strictio = 1;
break;
+   case 'U':
+   guest_uuid_str = optarg;
+   break;
case 'w':
strictmsr = 0;
break;
@@ -723,6 +729,9 @@ main(int argc, char *argv[])
 */
mptable_build(ctx, guest_ncpus);
 
+   error = smbios_build(ctx);
+   assert(error == 0);
+
if (acpi) {
error = acpi_build(ctx, guest_ncpus);
assert(error == 0);

Modified: head/usr.sbin/bhyve/bhyverun.h
==
--- head/usr.sbin/bhyve/bhyverun.h  Tue Mar  4 15:14:47 2014
(r262743)
+++ head/usr.sbin/bhyve/bhyverun.h  Tue Mar  4 17:12:06 20

svn commit: r262745 - stable/9/sys/dev/iicbus

2014-03-04 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Tue Mar  4 18:27:00 2014
New Revision: 262745
URL: http://svnweb.freebsd.org/changeset/base/262745

Log:
  MFC r232365:
  
  Provide pre/post transfer method callbacks for icbbb
  clients.
  
  These are helful when making certain drivers work on both Linux
  and FreeBSD without changing the code flow too much.
  
  Reviewed by:  kib, wlosh
  Approved by:  kan@

Modified:
  stable/9/sys/dev/iicbus/iicbb.c
  stable/9/sys/dev/iicbus/iicbb_if.m
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/iicbus/iicbb.c
==
--- stable/9/sys/dev/iicbus/iicbb.c Tue Mar  4 17:12:06 2014
(r262744)
+++ stable/9/sys/dev/iicbus/iicbb.c Tue Mar  4 18:27:00 2014
(r262745)
@@ -75,6 +75,7 @@ static int iicbb_stop(device_t);
 static int iicbb_write(device_t, const char *, int, int *, int);
 static int iicbb_read(device_t, char *, int, int *, int, int);
 static int iicbb_reset(device_t, u_char, u_char, u_char *);
+static int iicbb_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs);
 
 static device_method_t iicbb_methods[] = {
/* device interface */
@@ -94,7 +95,7 @@ static device_method_t iicbb_methods[] =
DEVMETHOD(iicbus_write, iicbb_write),
DEVMETHOD(iicbus_read,  iicbb_read),
DEVMETHOD(iicbus_reset, iicbb_reset),
-   DEVMETHOD(iicbus_transfer,  iicbus_transfer_gen),
+   DEVMETHOD(iicbus_transfer,  iicbb_transfer),
 
{ 0, 0 }
 };
@@ -413,6 +414,21 @@ iicbb_read(device_t dev, char * buf, int
return (0);
 }
 
+static int
+iicbb_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
+{
+   int error;
+
+   error = IICBB_PRE_XFER(device_get_parent(dev));
+   if (error)
+   return (error);
+
+   error = iicbus_transfer_gen(dev, msgs, nmsgs);
+
+   IICBB_POST_XFER(device_get_parent(dev));
+   return (error);
+}
+
 DRIVER_MODULE(iicbus, iicbb, iicbus_driver, iicbus_devclass, 0, 0);
 
 MODULE_DEPEND(iicbb, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER);

Modified: stable/9/sys/dev/iicbus/iicbb_if.m
==
--- stable/9/sys/dev/iicbus/iicbb_if.m  Tue Mar  4 17:12:06 2014
(r262744)
+++ stable/9/sys/dev/iicbus/iicbb_if.m  Tue Mar  4 18:27:00 2014
(r262745)
@@ -31,13 +31,50 @@
 INTERFACE iicbb;
 
 #
+# Default implementation of optional methods
+#
+CODE {
+   static int
+   null_pre_xfer(device_t dev)
+   {
+   return 0;
+   }
+
+   static void
+   null_post_xfer(device_t dev)
+
+   {
+   }
+
+   static int
+   null_callback(device_t dev, int index, caddr_t data)
+   {
+   return 0;
+   }
+};
+
+#
 # iicbus callback
 #
 METHOD int callback {
device_t dev;
int index;
caddr_t data;
-};
+} DEFAULT null_callback;
+
+#
+# Prepare device for I2C transfer
+#
+METHOD int pre_xfer {
+   device_t dev;
+} DEFAULT null_pre_xfer;
+
+#
+# Cleanup device after I2C transfer
+#
+METHOD void post_xfer {
+   device_t dev;
+} DEFAULT null_post_xfer;
 
 #
 # Set I2C bus data line
___
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: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-com

2014-03-04 Thread John Baldwin
On Tuesday, March 04, 2014 3:40:47 am Dag-Erling Smørgrav wrote:
> Pawel Jakub Dawidek  writes:
> > Dimitry Andric  writes:
> > > Wouldn't it be enough to merge r261499 ("Fix installations that use
> > > kernels without CAPABILITIES support") by pjd?
> > Yes, my change should be definiately merged with OpenSSH merge. If
> > nobody beats me to it, I should be able to merge it tomorrow.
> 
> Please do.  I thought I had included it in the MFC since it was already
> in head, but I'd forgotten that it had been committed separately.
> 
> BTW, IWBNI there were a cap_available() predicate or something like that
> which we could check up front, and short-circuit the entire Capsicum
> part of ssh_sandbox_child() if it failed.

If the capsicum code adds a FEATURE(capsicum) macro in the kernel bits, you 
can use 'if (feature_present("capsicum"))' in userland to check.

-- 
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: r262718 - stable/10/crypto/openssh

2014-03-04 Thread John Baldwin
On Monday, March 03, 2014 6:19:29 pm Xin LI wrote:
> Author: delphij
> Date: Mon Mar  3 23:19:28 2014
> New Revision: 262718
> URL: http://svnweb.freebsd.org/changeset/base/262718
> 
> Log:
>   MFC r261499 (pjd):
>   
>   Fix installations that use kernels without CAPABILITIES support.

Thanks!

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

2014-03-04 Thread John Baldwin
On Tuesday, March 04, 2014 12:09:47 am George V. Neville-Neil wrote:
> Author: gnn
> Date: Tue Mar  4 05:09:46 2014
> New Revision: 262727
> URL: http://svnweb.freebsd.org/changeset/base/262727
> 
> Log:
>   Naming consistency fix. The routing code defines
>   RADIX_NODE_HEAD_LOCK as grabbing the write lock,
>   but RADIX_NODE_HEAD_LOCK_ASSERT as checking the read lock.

Actually, that isn't what RA_LOCKED means.  RA_LOCKED means that it is
either read- or write-locked.  Note that you have now made 
RADIX_NODE_HEAD_LOCK_ASSERT() a redundant copy of 
RADIX_NODE_HEAD_WLOCK_ASSERT().  You should revert that part in some
way (either remove HEAD_LOCK_ASSERT() entirely leaving just RLOCK_ASSERT() and 
WLOCK_ASSERT(), or restore HEAD_LOCK_ASSERT() to using RA_LOCKED if there are 
places that want to assert that the lock is held, but don't care if it is read 
or write).

>   Submitted by:   Vijay Singh 
>   MFC after:  1 month
> 
> Modified:
>   head/sys/net/radix.h
>   head/sys/net/route.c
> 
> Modified: head/sys/net/radix.h
> 
==
> --- head/sys/net/radix.h  Tue Mar  4 03:19:36 2014(r262726)
> +++ head/sys/net/radix.h  Tue Mar  4 05:09:46 2014(r262727)
> @@ -149,7 +149,8 @@ struct radix_node_head {
>  
>  
>  #define  RADIX_NODE_HEAD_DESTROY(rnh)rw_destroy(&(rnh)->rnh_lock)
> -#define  RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, 
RA_LOCKED)
> +#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, 
RA_WLOCKED)
> +#define RADIX_NODE_HEAD_RLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, 
RA_RLOCKED)
>  #define  RADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, 
RA_WLOCKED)
>  #endif /* _KERNEL */
>  
> 
> Modified: head/sys/net/route.c
> 
==
> --- head/sys/net/route.c  Tue Mar  4 03:19:36 2014(r262726)
> +++ head/sys/net/route.c  Tue Mar  4 05:09:46 2014(r262727)
> @@ -381,7 +381,7 @@ rtalloc1_fib(struct sockaddr *dst, int r
>   RADIX_NODE_HEAD_RLOCK(rnh);
>  #ifdef INVARIANTS
>   else
> - RADIX_NODE_HEAD_LOCK_ASSERT(rnh);
> + RADIX_NODE_HEAD_RLOCK_ASSERT(rnh);
>  #endif

This was fine before if it is ok for a caller to hold a write lock when 
calling this function.  If that is not allowed, then your change here is 
correct.

>   rn = rnh->rnh_matchaddr(dst, rnh);
>   if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
> @@ -1000,9 +1000,10 @@ rn_mpath_update(int req, struct rt_addri
>* a matching RTAX_GATEWAY.
>*/
>   struct rtentry *rt, *rto = NULL;
> - register struct radix_node *rn;
> + struct radix_node *rn;
>   int error = 0;
>  
> + RADIX_NODE_HEAD_LOCK_ASSERT(rnh);

If a write lock is required, please use WLOCK_ASSERT() instead.

>   rn = rnh->rnh_lookup(dst, netmask, rnh);
>   if (rn == NULL)
>   return (ESRCH);
> 

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

2014-03-04 Thread Jung-uk Kim
Author: jkim
Date: Tue Mar  4 19:41:16 2014
New Revision: 262746
URL: http://svnweb.freebsd.org/changeset/base/262746

Log:
  Remove dead code since r230426, fix a comment, and tidy up.
  
  Reported by:  jhb
  MFC after:3 days

Modified:
  head/sys/amd64/amd64/cpu_switch.S

Modified: head/sys/amd64/amd64/cpu_switch.S
==
--- head/sys/amd64/amd64/cpu_switch.S   Tue Mar  4 18:27:00 2014
(r262745)
+++ head/sys/amd64/amd64/cpu_switch.S   Tue Mar  4 19:41:16 2014
(r262746)
@@ -345,8 +345,8 @@ ENTRY(savectx)
movq%r14,PCB_R14(%rdi)
movq%r15,PCB_R15(%rdi)
 
-   movq%cr0,%rsi
-   movq%rsi,PCB_CR0(%rdi)
+   movq%cr0,%rax
+   movq%rax,PCB_CR0(%rdi)
movq%cr2,%rax
movq%rax,PCB_CR2(%rdi)
movq%cr3,%rax
@@ -409,8 +409,6 @@ ENTRY(savectx)
sldtPCB_LDT(%rdi)
str PCB_TR(%rdi)
 
-2: movq%rsi,%cr0   /* The previous %cr0 is saved in %rsi. */
-
movl$1,%eax
ret
 END(savectx)
@@ -550,12 +548,12 @@ ENTRY(resumectx)
 END(resumectx)
 
 /*
- * Wrapper around fpusave to care about TS0_CR.
+ * Wrapper around fpusave to care about CR0_TS.
  */
 ENTRY(ctx_fpusave)
-   movq%cr0,%rsi
+   movq%cr0,%rax
clts
callfpusave
-   movq%rsi,%cr0
+   movq%rax,%cr0
ret
 END(ctx_fpusave)
___
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: r262566 - in stable/10: crypto/openssh crypto/openssh/contrib/caldera crypto/openssh/contrib/cygwin crypto/openssh/contrib/redhat crypto/openssh/contrib/suse crypto/openssh/openbsd-com

2014-03-04 Thread Pawel Jakub Dawidek
On Tue, Mar 04, 2014 at 11:46:57AM -0500, John Baldwin wrote:
> On Tuesday, March 04, 2014 3:40:47 am Dag-Erling Smørgrav wrote:
> > Pawel Jakub Dawidek  writes:
> > > Dimitry Andric  writes:
> > > > Wouldn't it be enough to merge r261499 ("Fix installations that use
> > > > kernels without CAPABILITIES support") by pjd?
> > > Yes, my change should be definiately merged with OpenSSH merge. If
> > > nobody beats me to it, I should be able to merge it tomorrow.
> > 
> > Please do.  I thought I had included it in the MFC since it was already
> > in head, but I'd forgotten that it had been committed separately.

Xin already did it.

> > BTW, IWBNI there were a cap_available() predicate or something like that
> > which we could check up front, and short-circuit the entire Capsicum
> > part of ssh_sandbox_child() if it failed.
> 
> If the capsicum code adds a FEATURE(capsicum) macro in the kernel bits, you 
> can use 'if (feature_present("capsicum"))' in userland to check.

It does add the following:

FEATURE(security_capability_mode, "Capsicum Capability Mode");
FEATURE(security_capabilities, "Capsicum Capabilities");

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://mobter.com


pgp1_FBv_pGRz.pgp
Description: PGP signature


svn commit: r262747 - head/sys/netinet

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Tue Mar  4 19:49:41 2014
New Revision: 262747
URL: http://svnweb.freebsd.org/changeset/base/262747

Log:
  Remove ifa_ref()/ifa_free(), which are atomic(9), from ip_output().
  
  The ifaddr is already referenced by the rtentry, and we are holding
  reference on the rtentry throughout the function execution.
  
  Sponsored by: Netflix
  Sponsored by: Nginx, Inc.

Modified:
  head/sys/netinet/ip_output.c

Modified: head/sys/netinet/ip_output.c
==
--- head/sys/netinet/ip_output.cTue Mar  4 19:41:16 2014
(r262746)
+++ head/sys/netinet/ip_output.cTue Mar  4 19:49:41 2014
(r262747)
@@ -293,7 +293,6 @@ again:
goto bad;
}
ia = ifatoia(rte->rt_ifa);
-   ifa_ref(&ia->ia_ifa);
ifp = rte->rt_ifp;
rte->rt_rmx.rmx_pksent++;
if (rte->rt_flags & RTF_GATEWAY)
@@ -550,11 +549,8 @@ sendit:
 #endif
error = netisr_queue(NETISR_IP, m);
goto done;
-   } else {
-   if (ia != NULL)
-   ifa_free(&ia->ia_ifa);
+   } else
goto again; /* Redo the routing table lookup. */
-   }
}
 
/* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */
@@ -583,8 +579,6 @@ sendit:
m->m_flags |= M_SKIP_FIREWALL;
m->m_flags &= ~M_IP_NEXTHOP;
m_tag_delete(m, fwd_tag);
-   if (ia != NULL)
-   ifa_free(&ia->ia_ifa);
goto again;
}
 
@@ -697,8 +691,6 @@ passout:
 done:
if (ro == &iproute)
RO_RTFREE(ro);
-   if (ia != NULL)
-   ifa_free(&ia->ia_ifa);
return (error);
 bad:
m_freem(m);
___
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: r262748 - head/sys/amd64/amd64

2014-03-04 Thread Jung-uk Kim
Author: jkim
Date: Tue Mar  4 20:07:36 2014
New Revision: 262748
URL: http://svnweb.freebsd.org/changeset/base/262748

Log:
  Properly save and restore CR0.
  
  MFC after:3 days

Modified:
  head/sys/amd64/amd64/cpu_switch.S
  head/sys/amd64/amd64/mpboot.S
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/cpu_switch.S
==
--- head/sys/amd64/amd64/cpu_switch.S   Tue Mar  4 19:49:41 2014
(r262747)
+++ head/sys/amd64/amd64/cpu_switch.S   Tue Mar  4 20:07:36 2014
(r262748)
@@ -552,8 +552,10 @@ END(resumectx)
  */
 ENTRY(ctx_fpusave)
movq%cr0,%rax
+   pushq   %rax
clts
callfpusave
+   popq%rax
movq%rax,%cr0
ret
 END(ctx_fpusave)

Modified: head/sys/amd64/amd64/mpboot.S
==
--- head/sys/amd64/amd64/mpboot.S   Tue Mar  4 19:49:41 2014
(r262747)
+++ head/sys/amd64/amd64/mpboot.S   Tue Mar  4 20:07:36 2014
(r262748)
@@ -36,6 +36,7 @@
.p2align 4,0
.globl  mptramp_start
 mptramp_start:
+#ifndef__clang__
.code16
/*
 * The AP enters here in response to the startup IPI.
@@ -65,6 +66,43 @@ mptramp_start:
/* Enable protected mode */
movl$CR0_PE, %eax
mov %eax, %cr0 
+#else
+   /*
+* The AP enters here in response to the startup IPI.
+* We are in real mode. %cs is the only segment register set.
+*/
+   cli /* make sure no interrupts */
+   mov %cs, %eax   /* copy %cs to %ds.  Remember these */
+   mov %eax, %ds   /* are offsets rather than selectors */
+   mov %eax, %ss
+
+   /*
+* Find relocation base and patch the gdt descript and ljmp targets
+*/
+   .byte   0x66
+   xorl%ebx, %ebx
+   mov %cs, %ebx
+   .byte   0x66
+   sall$4, %ebx/* %ebx is now our relocation base */
+   .byte   0x66, 0x09, 0x1e
+   .word   lgdt_desc-mptramp_start+2
+   .byte   0x66, 0x09, 0x1e
+   .word   jmp_32-mptramp_start+2
+   .byte   0x66, 0x09, 0x1e
+   .word   jmp_64-mptramp_start+1
+
+   /*
+* Load the descriptor table pointer.  We'll need it when running
+* in 16 bit protected mode.
+*/
+   .byte   0x0f, 0x01, 0x16
+   .word   lgdt_desc-mptramp_start
+
+   /* Enable protected mode */
+   .byte   0x66
+   movl$CR0_PE, %eax
+   mov %eax, %cr0 
+#endif
 
/*
 * Now execute a far jump to turn on protected mode.  This
@@ -88,7 +126,7 @@ jmp_32:
.code32
 protmode:
mov $bootdata-gdt, %eax
-   mov %ax, %ds
+   mov %eax, %ds
 
/* Turn on the PAE, PSE and PGE bits for when paging is enabled */
mov %cr4, %eax

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Mar  4 19:49:41 2014(r262747)
+++ head/sys/amd64/amd64/pmap.c Tue Mar  4 20:07:36 2014(r262748)
@@ -146,6 +146,13 @@ __FBSDID("$FreeBSD$");
 #endif
 
 static __inline boolean_t
+pmap_type_guest(pmap_t pmap)
+{
+
+   return ((pmap->pm_type == PT_EPT) || (pmap->pm_type == PT_RVI));
+}
+
+static __inline boolean_t
 pmap_emulate_ad_bits(pmap_t pmap)
 {
 
@@ -159,6 +166,7 @@ pmap_valid_bit(pmap_t pmap)
 
switch (pmap->pm_type) {
case PT_X86:
+   case PT_RVI:
mask = X86_PG_V;
break;
case PT_EPT:
@@ -181,6 +189,7 @@ pmap_rw_bit(pmap_t pmap)
 
switch (pmap->pm_type) {
case PT_X86:
+   case PT_RVI:
mask = X86_PG_RW;
break;
case PT_EPT:
@@ -205,6 +214,7 @@ pmap_global_bit(pmap_t pmap)
case PT_X86:
mask = X86_PG_G;
break;
+   case PT_RVI:
case PT_EPT:
mask = 0;
break;
@@ -222,6 +232,7 @@ pmap_accessed_bit(pmap_t pmap)
 
switch (pmap->pm_type) {
case PT_X86:
+   case PT_RVI:
mask = X86_PG_A;
break;
case PT_EPT:
@@ -244,6 +255,7 @@ pmap_modified_bit(pmap_t pmap)
 
switch (pmap->pm_type) {
case PT_X86:
+   case PT_RVI:
mask = X86_PG_M;
break;
case PT_EPT:
@@ -1102,6 +1114,9 @@ pmap_swap_pat(pmap_t pmap, pt_entry_t en
if ((entry & x86_pat_bits) != 0)
entry ^= x86_pat_bits;
break;
+   case PT_RVI:
+   /* XXX: PAT support. */
+   break;
case PT_EPT:
/*
 * Nothing to do - the memory attributes are represented
@@ -1145,6 +1160,11 @@ pmap_cache_bits(pmap_t pmap, int mode, b
 

svn commit: r262749 - head/usr.sbin/makefs

2014-03-04 Thread Simon J. Gerraty
Author: sjg
Date: Tue Mar  4 20:09:23 2014
New Revision: 262749
URL: http://svnweb.freebsd.org/changeset/base/262749

Log:
  Allow comments at end of line.
  
  Reviewed by: marcel

Modified:
  head/usr.sbin/makefs/mtree.c

Modified: head/usr.sbin/makefs/mtree.c
==
--- head/usr.sbin/makefs/mtree.cTue Mar  4 20:07:36 2014
(r262748)
+++ head/usr.sbin/makefs/mtree.cTue Mar  4 20:09:23 2014
(r262749)
@@ -348,6 +348,13 @@ read_word(FILE *fp, char *buf, size_t bu
if (error == -1)
mtree_error("unexpected end of file");
return (error);
+   case '#':   /* comment -- skip to end of line. */
+   if (!esc) {
+   error = skip_to(fp, "\n");
+   if (!error)
+   continue;
+   }
+   break;
case '\\':
esc++;
if (esc == 1)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r262750 - head/sys/amd64/amd64

2014-03-04 Thread Jung-uk Kim
Author: jkim
Date: Tue Mar  4 20:16:00 2014
New Revision: 262750
URL: http://svnweb.freebsd.org/changeset/base/262750

Log:
  Revert accidentally committed changes in 262748.

Modified:
  head/sys/amd64/amd64/mpboot.S
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/mpboot.S
==
--- head/sys/amd64/amd64/mpboot.S   Tue Mar  4 20:09:23 2014
(r262749)
+++ head/sys/amd64/amd64/mpboot.S   Tue Mar  4 20:16:00 2014
(r262750)
@@ -36,7 +36,6 @@
.p2align 4,0
.globl  mptramp_start
 mptramp_start:
-#ifndef__clang__
.code16
/*
 * The AP enters here in response to the startup IPI.
@@ -66,43 +65,6 @@ mptramp_start:
/* Enable protected mode */
movl$CR0_PE, %eax
mov %eax, %cr0 
-#else
-   /*
-* The AP enters here in response to the startup IPI.
-* We are in real mode. %cs is the only segment register set.
-*/
-   cli /* make sure no interrupts */
-   mov %cs, %eax   /* copy %cs to %ds.  Remember these */
-   mov %eax, %ds   /* are offsets rather than selectors */
-   mov %eax, %ss
-
-   /*
-* Find relocation base and patch the gdt descript and ljmp targets
-*/
-   .byte   0x66
-   xorl%ebx, %ebx
-   mov %cs, %ebx
-   .byte   0x66
-   sall$4, %ebx/* %ebx is now our relocation base */
-   .byte   0x66, 0x09, 0x1e
-   .word   lgdt_desc-mptramp_start+2
-   .byte   0x66, 0x09, 0x1e
-   .word   jmp_32-mptramp_start+2
-   .byte   0x66, 0x09, 0x1e
-   .word   jmp_64-mptramp_start+1
-
-   /*
-* Load the descriptor table pointer.  We'll need it when running
-* in 16 bit protected mode.
-*/
-   .byte   0x0f, 0x01, 0x16
-   .word   lgdt_desc-mptramp_start
-
-   /* Enable protected mode */
-   .byte   0x66
-   movl$CR0_PE, %eax
-   mov %eax, %cr0 
-#endif
 
/*
 * Now execute a far jump to turn on protected mode.  This
@@ -126,7 +88,7 @@ jmp_32:
.code32
 protmode:
mov $bootdata-gdt, %eax
-   mov %eax, %ds
+   mov %ax, %ds
 
/* Turn on the PAE, PSE and PGE bits for when paging is enabled */
mov %cr4, %eax

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Mar  4 20:09:23 2014(r262749)
+++ head/sys/amd64/amd64/pmap.c Tue Mar  4 20:16:00 2014(r262750)
@@ -146,13 +146,6 @@ __FBSDID("$FreeBSD$");
 #endif
 
 static __inline boolean_t
-pmap_type_guest(pmap_t pmap)
-{
-
-   return ((pmap->pm_type == PT_EPT) || (pmap->pm_type == PT_RVI));
-}
-
-static __inline boolean_t
 pmap_emulate_ad_bits(pmap_t pmap)
 {
 
@@ -166,7 +159,6 @@ pmap_valid_bit(pmap_t pmap)
 
switch (pmap->pm_type) {
case PT_X86:
-   case PT_RVI:
mask = X86_PG_V;
break;
case PT_EPT:
@@ -189,7 +181,6 @@ pmap_rw_bit(pmap_t pmap)
 
switch (pmap->pm_type) {
case PT_X86:
-   case PT_RVI:
mask = X86_PG_RW;
break;
case PT_EPT:
@@ -214,7 +205,6 @@ pmap_global_bit(pmap_t pmap)
case PT_X86:
mask = X86_PG_G;
break;
-   case PT_RVI:
case PT_EPT:
mask = 0;
break;
@@ -232,7 +222,6 @@ pmap_accessed_bit(pmap_t pmap)
 
switch (pmap->pm_type) {
case PT_X86:
-   case PT_RVI:
mask = X86_PG_A;
break;
case PT_EPT:
@@ -255,7 +244,6 @@ pmap_modified_bit(pmap_t pmap)
 
switch (pmap->pm_type) {
case PT_X86:
-   case PT_RVI:
mask = X86_PG_M;
break;
case PT_EPT:
@@ -1114,9 +1102,6 @@ pmap_swap_pat(pmap_t pmap, pt_entry_t en
if ((entry & x86_pat_bits) != 0)
entry ^= x86_pat_bits;
break;
-   case PT_RVI:
-   /* XXX: PAT support. */
-   break;
case PT_EPT:
/*
 * Nothing to do - the memory attributes are represented
@@ -1160,11 +1145,6 @@ pmap_cache_bits(pmap_t pmap, int mode, b
cache_bits |= PG_NC_PWT;
break;
 
-   case PT_RVI:
-   /* XXX: PAT support. */
-   cache_bits = 0;
-   break;
-
case PT_EPT:
cache_bits = EPT_PG_IGNORE_PAT | EPT_PG_MEMORY_TYPE(mode);
break;
@@ -1185,10 +1165,6 @@ pmap_cache_mask(pmap_t pmap, boolean_t i
case PT_X86:
mask = is_pde ? X86_PG_PDE_CACHE : X86_PG_PTE_CACHE;
break;
-   case PT_RVI:
-   /* XXX: PAT support. */
-   mask

svn commit: r262751 - stable/9/sys/dev/iir

2014-03-04 Thread Jean-Sebastien Pedron
Author: dumbbell
Date: Tue Mar  4 20:21:43 2014
New Revision: 262751
URL: http://svnweb.freebsd.org/changeset/base/262751

Log:
  MFC r254379:
  
  Avoid potential redefinition of the macro.

Modified:
  stable/9/sys/dev/iir/iir.c
  stable/9/sys/dev/iir/iir.h
  stable/9/sys/dev/iir/iir_ctrl.c
  stable/9/sys/dev/iir/iir_pci.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/iir/iir.c
==
--- stable/9/sys/dev/iir/iir.c  Tue Mar  4 20:16:00 2014(r262750)
+++ stable/9/sys/dev/iir/iir.c  Tue Mar  4 20:21:43 2014(r262751)
@@ -399,7 +399,7 @@ iir_init(struct gdt_softc *gdt)
gdt->oem_name[7]='\0';
} else {
/* Old method, based on PCI ID */
-   if (gdt->sc_vendor == INTEL_VENDOR_ID)
+   if (gdt->sc_vendor == INTEL_VENDOR_ID_IIR)
 strcpy(gdt->oem_name,"Intel  ");
 else 
strcpy(gdt->oem_name,"ICP");
@@ -1374,7 +1374,7 @@ iir_action( struct cam_sim *sim, union c
   (bus == gdt->sc_virt_bus ? 127 : gdt->sc_bus_id[bus]);
   cpi->base_transfer_speed = 3300;
   strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
-  if (gdt->sc_vendor == INTEL_VENDOR_ID)
+  if (gdt->sc_vendor == INTEL_VENDOR_ID_IIR)
   strncpy(cpi->hba_vid, "Intel Corp.", HBA_IDLEN);
   else
   strncpy(cpi->hba_vid, "ICP vortex ", HBA_IDLEN);

Modified: stable/9/sys/dev/iir/iir.h
==
--- stable/9/sys/dev/iir/iir.h  Tue Mar  4 20:16:00 2014(r262750)
+++ stable/9/sys/dev/iir/iir.h  Tue Mar  4 20:21:43 2014(r262751)
@@ -63,7 +63,7 @@
 #define GDT_DEVICE_ID_MAX   0x2ff
 #define GDT_DEVICE_ID_NEWRX 0x300
 
-#define INTEL_VENDOR_ID 0x8086
+#define INTEL_VENDOR_ID_IIR 0x8086
 #define INTEL_DEVICE_ID_IIR 0x600
 
 #define GDT_MAXBUS  6   /* XXX Why not 5? */

Modified: stable/9/sys/dev/iir/iir_ctrl.c
==
--- stable/9/sys/dev/iir/iir_ctrl.c Tue Mar  4 20:16:00 2014
(r262750)
+++ stable/9/sys/dev/iir/iir_ctrl.c Tue Mar  4 20:21:43 2014
(r262751)
@@ -273,7 +273,7 @@ iir_ioctl(struct cdev *dev, u_long cmd, 
 return (ENXIO);
 /* only RP controllers */
 p->ext_type = 0x6000 | gdt->sc_device;
-if (gdt->sc_vendor == INTEL_VENDOR_ID) {
+if (gdt->sc_vendor == INTEL_VENDOR_ID_IIR) {
 p->oem_id = OEM_ID_INTEL;
 p->type = 0xfd;
 /* new -> subdevice into ext_type */

Modified: stable/9/sys/dev/iir/iir_pci.c
==
--- stable/9/sys/dev/iir/iir_pci.c  Tue Mar  4 20:16:00 2014
(r262750)
+++ stable/9/sys/dev/iir/iir_pci.c  Tue Mar  4 20:21:43 2014
(r262751)
@@ -163,7 +163,7 @@ MODULE_DEPEND(iir, cam, 1, 1, 1);
 static int
 iir_pci_probe(device_t dev)
 {
-if (pci_get_vendor(dev) == INTEL_VENDOR_ID &&
+if (pci_get_vendor(dev) == INTEL_VENDOR_ID_IIR &&
 pci_get_device(dev) == INTEL_DEVICE_ID_IIR) {
 device_set_desc(dev, "Intel Integrated RAID Controller");
 return (BUS_PROBE_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"


svn commit: r262752 - in head/sys: amd64/amd64 amd64/include x86/acpica

2014-03-04 Thread Jung-uk Kim
Author: jkim
Date: Tue Mar  4 21:35:57 2014
New Revision: 262752
URL: http://svnweb.freebsd.org/changeset/base/262752

Log:
  Move fpusave() wrapper for suspend hander to sys/amd64/amd64/fpu.c.
  
  Inspired by:  jhb

Modified:
  head/sys/amd64/amd64/cpu_switch.S
  head/sys/amd64/amd64/fpu.c
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/amd64/include/fpu.h
  head/sys/amd64/include/md_var.h
  head/sys/x86/acpica/acpi_wakeup.c

Modified: head/sys/amd64/amd64/cpu_switch.S
==
--- head/sys/amd64/amd64/cpu_switch.S   Tue Mar  4 20:21:43 2014
(r262751)
+++ head/sys/amd64/amd64/cpu_switch.S   Tue Mar  4 21:35:57 2014
(r262752)
@@ -546,16 +546,3 @@ ENTRY(resumectx)
xorl%eax,%eax
ret
 END(resumectx)
-
-/*
- * Wrapper around fpusave to care about CR0_TS.
- */
-ENTRY(ctx_fpusave)
-   movq%cr0,%rax
-   pushq   %rax
-   clts
-   callfpusave
-   popq%rax
-   movq%rax,%cr0
-   ret
-END(ctx_fpusave)

Modified: head/sys/amd64/amd64/fpu.c
==
--- head/sys/amd64/amd64/fpu.c  Tue Mar  4 20:21:43 2014(r262751)
+++ head/sys/amd64/amd64/fpu.c  Tue Mar  4 21:35:57 2014(r262752)
@@ -162,6 +162,17 @@ fpurestore(void *addr)
fxrstor((char *)addr);
 }
 
+void
+fpususpend(void *addr)
+{
+   u_long cr0;
+
+   cr0 = rcr0();
+   stop_emulating();
+   fpusave(addr);
+   load_cr0(cr0);
+}
+
 /*
  * Enable XSAVE if supported and allowed by user.
  * Calculate the xsave_mask.

Modified: head/sys/amd64/amd64/mp_machdep.c
==
--- head/sys/amd64/amd64/mp_machdep.c   Tue Mar  4 20:21:43 2014
(r262751)
+++ head/sys/amd64/amd64/mp_machdep.c   Tue Mar  4 21:35:57 2014
(r262752)
@@ -1464,7 +1464,7 @@ cpususpend_handler(void)
 
cpu = PCPU_GET(cpuid);
if (savectx(susppcbs[cpu])) {
-   ctx_fpusave(susppcbs[cpu]->pcb_fpususpend);
+   fpususpend(susppcbs[cpu]->pcb_fpususpend);
wbinvd();
CPU_SET_ATOMIC(cpu, &suspended_cpus);
} else {

Modified: head/sys/amd64/include/fpu.h
==
--- head/sys/amd64/include/fpu.hTue Mar  4 20:21:43 2014
(r262751)
+++ head/sys/amd64/include/fpu.hTue Mar  4 21:35:57 2014
(r262752)
@@ -63,6 +63,7 @@ int   fpusetregs(struct thread *td, struct
char *xfpustate, size_t xfpustate_size);
 intfpusetxstate(struct thread *td, char *xfpustate,
size_t xfpustate_size);
+void   fpususpend(void *addr);
 intfputrap_sse(void);
 intfputrap_x87(void);
 void   fpuuserinited(struct thread *td);

Modified: head/sys/amd64/include/md_var.h
==
--- head/sys/amd64/include/md_var.h Tue Mar  4 20:21:43 2014
(r262751)
+++ head/sys/amd64/include/md_var.h Tue Mar  4 21:35:57 2014
(r262752)
@@ -89,7 +89,6 @@ void  *alloc_fpusave(int flags);
 void   amd64_syscall(struct thread *td, int traced);
 void   busdma_swi(void);
 void   cpu_setregs(void);
-void   ctx_fpusave(void *);
 void   doreti_iret(void) __asm(__STRING(doreti_iret));
 void   doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault));
 void   ld_ds(void) __asm(__STRING(ld_ds));

Modified: head/sys/x86/acpica/acpi_wakeup.c
==
--- head/sys/x86/acpica/acpi_wakeup.c   Tue Mar  4 20:21:43 2014
(r262751)
+++ head/sys/x86/acpica/acpi_wakeup.c   Tue Mar  4 21:35:57 2014
(r262752)
@@ -202,7 +202,7 @@ acpi_sleep_machdep(struct acpi_softc *sc
 
if (savectx(susppcbs[0])) {
 #ifdef __amd64__
-   ctx_fpusave(susppcbs[0]->pcb_fpususpend);
+   fpususpend(susppcbs[0]->pcb_fpususpend);
 #endif
 #ifdef SMP
if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r262752 - in head/sys: amd64/amd64 amd64/include x86/acpica

2014-03-04 Thread John Baldwin
On Tuesday, March 04, 2014 4:35:57 pm Jung-uk Kim wrote:
> Author: jkim
> Date: Tue Mar  4 21:35:57 2014
> New Revision: 262752
> URL: http://svnweb.freebsd.org/changeset/base/262752
> 
> Log:
>   Move fpusave() wrapper for suspend hander to sys/amd64/amd64/fpu.c.
>   
>   Inspired by:jhb

Heh.  I had just replied to your first commit to note that %rax wasn't call-
safe and to suggest this very thing.  Thanks!

-- 
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: r262754 - in head/contrib/xz: . src/liblzma/api/lzma src/liblzma/check src/liblzma/common src/lzmainfo src/xz src/xzdec

2014-03-04 Thread Xin LI
Author: delphij
Date: Tue Mar  4 21:51:11 2014
New Revision: 262754
URL: http://svnweb.freebsd.org/changeset/base/262754

Log:
  MFV r253848 (mm):
  
  Update vendor/xz from v5.0 branch to post-5.0.5
  
  MFC after:2 weeks

Modified:
  head/contrib/xz/ChangeLog
  head/contrib/xz/README
  head/contrib/xz/THANKS
  head/contrib/xz/src/liblzma/api/lzma/version.h
  head/contrib/xz/src/liblzma/check/sha256.c
  head/contrib/xz/src/liblzma/common/alone_decoder.c
  head/contrib/xz/src/liblzma/common/alone_decoder.h
  head/contrib/xz/src/liblzma/common/auto_decoder.c
  head/contrib/xz/src/lzmainfo/lzmainfo.1
  head/contrib/xz/src/xz/coder.c
  head/contrib/xz/src/xz/coder.h
  head/contrib/xz/src/xz/file_io.c
  head/contrib/xz/src/xz/list.c
  head/contrib/xz/src/xz/util.c
  head/contrib/xz/src/xz/xz.1
  head/contrib/xz/src/xzdec/xzdec.1
  head/contrib/xz/src/xzdec/xzdec.c
Directory Properties:
  head/contrib/xz/   (props changed)

Modified: head/contrib/xz/ChangeLog
==
--- head/contrib/xz/ChangeLog   Tue Mar  4 21:51:09 2014(r262753)
+++ head/contrib/xz/ChangeLog   Tue Mar  4 21:51:11 2014(r262754)
@@ -1,3 +1,348 @@
+commit b69900ed0b2f914fc6c0a180dcb522dbe5b80ea7
+Author: Lasse Collin 
+Date:   Sun Jun 30 18:02:27 2013 +0300
+
+Man pages: Use similar syntax for synopsis as in xz.
+
+The man pages of lzmainfo, xzmore, and xzdec had similar
+constructs as the man page of xz had before the commit
+eb6ca9854b8eb9fbf72497c1cf608d6b19d2d494. Eric S. Raymond
+didn't mention these man pages in his bug report, but
+it's nice to be consistent.
+
+commit cf4a1e1879d89be314ef3c064bd2656ea452f87e
+Author: Lasse Collin 
+Date:   Sun Jun 30 15:55:09 2013 +0300
+
+Update NEWS for 5.0.5.
+
+commit cb94bb6d1f34e1e93c2d634ea9c3b7dfb3981d05
+Author: Lasse Collin 
+Date:   Sun Jun 30 15:54:38 2013 +0300
+
+Bump version and soname for 5.0.5.
+
+commit b7dee202d5b041ccae028d0c5433b83cecbe9e5d
+Author: Lasse Collin 
+Date:   Fri Jun 28 23:56:17 2013 +0300
+
+xz: Fix return value type in io_write_buf().
+
+It didn't affect the behavior of the code since -1
+becomes true anyway.
+
+commit 265e7b44d804b47373f10b7da28350db7611cea6
+Author: Lasse Collin 
+Date:   Fri Jun 28 18:46:13 2013 +0300
+
+xz: Remove an outdated NetBSD-specific comment.
+
+Nowadays errno == EFTYPE is documented in open(2).
+
+commit 78c2f8db902195468b8249c432252a6b281db836
+Author: Lasse Collin 
+Date:   Fri Jun 28 18:09:47 2013 +0300
+
+xz: Fix error detection of fcntl(fd, F_SETFL, flags) calls.
+
+POSIX says that fcntl(fd, F_SETFL, flags) returns -1 on
+error and "other than -1" on success. This is how it is
+documented e.g. on OpenBSD too. On Linux, success with
+F_SETFL is always 0 (at least accorinding to fcntl(2)
+from man-pages 3.51).
+
+commit 91750dff8f2c654ff636f12a2acdffe5492374b3
+Author: Lasse Collin 
+Date:   Fri Jun 28 17:36:47 2013 +0300
+
+xz: Fix use of wrong variable in a fcntl() call.
+
+Due to a wrong variable name, when writing a sparse file
+to standard output, *all* file status flags were cleared
+(to the extent the operating system allowed it) instead of
+only clearing the O_APPEND flag. In practice this worked
+fine in the common situations on GNU/Linux, but I didn't
+check how it behaved elsewhere.
+
+The original flags were still restored correctly. I still
+changed the code to use a separate boolean variable to
+indicate when the flags should be restored instead of
+relying on a special value in stdout_flags.
+
+commit e11888a79a4a77a69afde60445880d44f63d01aa
+Author: Lasse Collin 
+Date:   Wed Jun 26 13:30:57 2013 +0300
+
+xz: Check the value of lzma_stream_flags.version in --list.
+
+It is a no-op for now, but if an old xz version is used
+together with a newer liblzma that supports something new,
+then this check becomes important and will stop the old xz
+from trying to parse files that it won't understand.
+
+commit f39ddd88f319ada88998cf30abfdd3e0e96c
+Author: Lasse Collin 
+Date:   Wed Jun 26 12:17:00 2013 +0300
+
+Build: Require Automake 1.12 and use serial-tests option.
+
+It should actually still work with Automake 1.10 if
+the serial-tests option is removed. Automake 1.13 started
+using parallel tests by default and the option to get
+the old behavior isn't supported before 1.12.
+
+At least for now, parallel tests don't improve anything
+in XZ Utils but they hide the progress output from
+test_compress.sh.
+
+commit cb84e278027a90e9827a6f4d3bb0b4d4744a2fbb
+Author: Lasse Collin 
+Date:   Sun Jun 23 17:36:47 2013 +0300
+
+xz: Validate Uncompressed Size from Block Header in list.c.
+
+This affects only "xz -lvv". Normal decompression with xz
+already detected if Block Header and Index had mismatched
+Uncompresse

svn commit: r262753 - stable/10/sys/amd64/amd64

2014-03-04 Thread Ed Maste
Author: emaste
Date: Tue Mar  4 21:51:09 2014
New Revision: 262753
URL: http://svnweb.freebsd.org/changeset/base/262753

Log:
  Disable amd64 TLB Context ID (pcid) by default for now
  
  There are a number of reports of userspace application crashes that
  are "solved" by setting vm.pmap.pcid_enabled=0, including Java and the
  x11/mate-terminal port (PR ports/184362).
  
  For now apply a band-aid of disabling pcid by default in stable/10.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/sys/amd64/amd64/pmap.c

Modified: stable/10/sys/amd64/amd64/pmap.c
==
--- stable/10/sys/amd64/amd64/pmap.cTue Mar  4 21:35:57 2014
(r262752)
+++ stable/10/sys/amd64/amd64/pmap.cTue Mar  4 21:51:09 2014
(r262753)
@@ -367,7 +367,7 @@ static int pmap_flags = PMAP_PDE_SUPERPA
 
 static struct unrhdr pcid_unr;
 static struct mtx pcid_mtx;
-int pmap_pcid_enabled = 1;
+int pmap_pcid_enabled = 0;
 SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN, &pmap_pcid_enabled,
 0, "Is TLB Context ID enabled ?");
 int invpcid_works = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r262755 - head/bin/sh

2014-03-04 Thread Jilles Tjoelker
Author: jilles
Date: Tue Mar  4 22:30:38 2014
New Revision: 262755
URL: http://svnweb.freebsd.org/changeset/base/262755

Log:
  sh: Make argstr() return where it stopped and simplify expari() using this.

Modified:
  head/bin/sh/expand.c

Modified: head/bin/sh/expand.c
==
--- head/bin/sh/expand.cTue Mar  4 21:51:11 2014(r262754)
+++ head/bin/sh/expand.cTue Mar  4 22:30:38 2014(r262755)
@@ -98,7 +98,7 @@ static struct ifsregion ifsfirst; /* fir
 static struct ifsregion *ifslastp; /* last struct in list */
 static struct arglist exparg;  /* holds expanded arg list */
 
-static void argstr(char *, int);
+static char *argstr(char *, int);
 static char *exptilde(char *, int);
 static char *expari(char *);
 static void expbackq(union node *, int, int);
@@ -213,7 +213,7 @@ expandarg(union node *arg, struct arglis
  * characters to allow for further processing.
  * If EXP_FULL is set, also preserve CTLQUOTEMARK characters.
  */
-static void
+static char *
 argstr(char *p, int flag)
 {
char c;
@@ -231,9 +231,10 @@ argstr(char *p, int flag)
CHECKSTRSPACE(2, expdest);
switch (c = *p++) {
case '\0':
+   return (p - 1);
case CTLENDVAR:
case CTLENDARI:
-   goto breakloop;
+   return (p);
case CTLQUOTEMARK:
lit_quoted = 1;
/* "$@" syntax adherence hack */
@@ -290,7 +291,6 @@ argstr(char *p, int flag)
expdest - stackblock(), 0);
}
}
-breakloop:;
 }
 
 /*
@@ -399,13 +399,11 @@ expari(char *p)
arith_t result;
int begoff;
int quoted;
-   int c;
-   int nesting;
int adj;
 
quoted = *p++ == '"';
begoff = expdest - stackblock();
-   argstr(p, 0);
+   p = argstr(p, 0);
removerecordregions(begoff);
STPUTC('\0', expdest);
start = stackblock() + begoff;
@@ -424,20 +422,6 @@ expari(char *p)
STADJUST(adj, expdest);
if (!quoted)
recordregion(begoff, expdest - stackblock(), 0);
-   nesting = 1;
-   while (nesting > 0) {
-   c = *p++;
-   if (c == CTLESC)
-   p++;
-   else if (c == CTLARI)
-   nesting++;
-   else if (c == CTLENDARI)
-   nesting--;
-   else if (c == CTLVAR)
-   p++; /* ignore variable substitution byte */
-   else if (c == '\0')
-   return p - 1;
-   }
return p;
 }
 
___
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: r262727 - head/sys/net

2014-03-04 Thread George Neville-Neil

On Mar 4, 2014, at 12:14 , John Baldwin  wrote:

> On Tuesday, March 04, 2014 12:09:47 am George V. Neville-Neil wrote:
>> Author: gnn
>> Date: Tue Mar  4 05:09:46 2014
>> New Revision: 262727
>> URL: http://svnweb.freebsd.org/changeset/base/262727
>> 
>> Log:
>>  Naming consistency fix. The routing code defines
>>  RADIX_NODE_HEAD_LOCK as grabbing the write lock,
>>  but RADIX_NODE_HEAD_LOCK_ASSERT as checking the read lock.
> 
> Actually, that isn't what RA_LOCKED means.  RA_LOCKED means that it is
> either read- or write-locked.  Note that you have now made 
> RADIX_NODE_HEAD_LOCK_ASSERT() a redundant copy of 
> RADIX_NODE_HEAD_WLOCK_ASSERT().  You should revert that part in some
> way (either remove HEAD_LOCK_ASSERT() entirely leaving just RLOCK_ASSERT() 
> and 
> WLOCK_ASSERT(), or restore HEAD_LOCK_ASSERT() to using RA_LOCKED if there are 
> places that want to assert that the lock is held, but don't care if it is 
> read 
> or write).

Actually I’ll revert the whole thing and to back to Vijay to rework this.

Best,
George

___
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: r262756 - in vendor/xz-embedded/dist: . linux/include/linux linux/lib linux/lib/xz linux/scripts userspace

2014-03-04 Thread Xin LI
Author: delphij
Date: Tue Mar  4 23:23:55 2014
New Revision: 262756
URL: http://svnweb.freebsd.org/changeset/base/262756

Log:
  Import xz-embedded from git.
  
  This is from commit hash '6a8a2364434763a033781f6b2a605ace9a021013'.

Added:
  vendor/xz-embedded/dist/linux/lib/xz/xz_crc64.c   (contents, props changed)
  vendor/xz-embedded/dist/userspace/bytetest.c   (contents, props changed)
Modified:
  vendor/xz-embedded/dist/README
  vendor/xz-embedded/dist/linux/include/linux/xz.h
  vendor/xz-embedded/dist/linux/lib/decompress_unxz.c
  vendor/xz-embedded/dist/linux/lib/xz/Kconfig
  vendor/xz-embedded/dist/linux/lib/xz/xz_dec_stream.c
  vendor/xz-embedded/dist/linux/scripts/xz_wrap.sh
  vendor/xz-embedded/dist/userspace/Makefile
  vendor/xz-embedded/dist/userspace/boottest.c
  vendor/xz-embedded/dist/userspace/xz_config.h
  vendor/xz-embedded/dist/userspace/xzminidec.c

Modified: vendor/xz-embedded/dist/README
==
--- vendor/xz-embedded/dist/README  Tue Mar  4 22:30:38 2014
(r262755)
+++ vendor/xz-embedded/dist/README  Tue Mar  4 23:23:55 2014
(r262756)
@@ -7,7 +7,7 @@ XZ Embedded
 
 XZ Embedded was written for use in the Linux kernel, but the code can
 be easily used in other environments too, including regular userspace
-applications.
+applications. See userspace/xzminidec.c for an example program.
 
 This README contains information that is useful only when the copy
 of XZ Embedded isn't part of the Linux kernel tree. You should also
@@ -84,6 +84,42 @@ Embedding into userspace applications
 environment. Probably you should at least skim through it even if the
 default file works as is.
 
+Integrity check support
+
+XZ Embedded always supports the integrity check types None and
+CRC32. Support for CRC64 is optional. SHA-256 is currently not
+supported in XZ Embedded although the .xz format does support it.
+The xz tool from XZ Utils uses CRC64 by default, but CRC32 is usually
+enough in embedded systems to keep the code size smaller.
+
+If you want support for CRC64, you need to copy linux/lib/xz/xz_crc64.c
+into your application, and #define XZ_USE_CRC64 in xz_config.h or in
+compiler flags.
+
+When using the internal CRC32 or CRC64, their lookup tables need to be
+initialized with xz_crc32_init() and xz_crc64_init(), respectively.
+See xz.h for details.
+
+To use external CRC32 or CRC64 code instead of the code from
+xz_crc32.c or xz_crc64.c, the following #defines may be used
+in xz_config.h or in compiler flags:
+
+#define XZ_INTERNAL_CRC32 0
+#define XZ_INTERNAL_CRC64 0
+
+Then it is up to you to provide compatible xz_crc32() or xz_crc64()
+functions.
+
+If the .xz file being decompressed uses an integrity check type that
+isn't supported by XZ Embedded, it is treated as an error and the
+file cannot be decompressed. For multi-call mode, this can be modified
+by #defining XZ_DEC_ANY_CHECK. Then xz_dec_run() will return
+XZ_UNSUPPORTED_CHECK when unsupported check type is detected. After
+that decompression can be continued normally except that the
+integrity check won't be verified. In single-call mode there's
+no way to continue decoding, so XZ_DEC_ANY_CHECK is almost useless
+in single-call mode.
+
 BCJ filter support
 
 If you want support for one or more BCJ filters, you need to copy also

Modified: vendor/xz-embedded/dist/linux/include/linux/xz.h
==
--- vendor/xz-embedded/dist/linux/include/linux/xz.hTue Mar  4 22:30:38 
2014(r262755)
+++ vendor/xz-embedded/dist/linux/include/linux/xz.hTue Mar  4 23:23:55 
2014(r262756)
@@ -251,6 +251,22 @@ XZ_EXTERN void xz_dec_end(struct xz_dec 
 #  endif
 #endif
 
+/*
+ * If CRC64 support has been enabled with XZ_USE_CRC64, a CRC64
+ * implementation is needed too.
+ */
+#ifndef XZ_USE_CRC64
+#  undef XZ_INTERNAL_CRC64
+#  define XZ_INTERNAL_CRC64 0
+#endif
+#ifndef XZ_INTERNAL_CRC64
+#  ifdef __KERNEL__
+#  error Using CRC64 in the kernel has not been implemented.
+#  else
+#  define XZ_INTERNAL_CRC64 1
+#  endif
+#endif
+
 #if XZ_INTERNAL_CRC32
 /*
  * This must be called before any other xz_* function to initialize
@@ -266,6 +282,21 @@ XZ_EXTERN void xz_crc32_init(void);
 XZ_EXTERN uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc);
 #endif
 
+#if XZ_INTERNAL_CRC64
+/*
+ * This must be called before any other xz_* function (except xz_crc32_init())
+ * to initialize the CRC64 lookup table.
+ */
+XZ_EXTERN void xz_crc64_init(void);
+
+/*
+ * Update CRC64 value using the polynomial from ECMA-182. To start a new
+ * calculation, the third argument must be zero. To continue the calculation,
+ * the previously returned value is passed as the third argument

svn commit: r262757 - vendor/xz-embedded/6a8a2364434763a033781f6b2a605ace9a021013

2014-03-04 Thread Xin LI
Author: delphij
Date: Tue Mar  4 23:27:27 2014
New Revision: 262757
URL: http://svnweb.freebsd.org/changeset/base/262757

Log:
  Tag import 6a8a2364434763a033781f6b2a605ace9a021013.

Added:
  vendor/xz-embedded/6a8a2364434763a033781f6b2a605ace9a021013/
 - copied from r262756, vendor/xz-embedded/dist/
___
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: r262758 - head/sys/net

2014-03-04 Thread George V. Neville-Neil
Author: gnn
Date: Tue Mar  4 23:55:04 2014
New Revision: 262758
URL: http://svnweb.freebsd.org/changeset/base/262758

Log:
  Revert previous commit (262727) and bounce patch back to the
  submitter.
  
  Pointed out by: jhb

Modified:
  head/sys/net/radix.h
  head/sys/net/route.c

Modified: head/sys/net/radix.h
==
--- head/sys/net/radix.hTue Mar  4 23:27:27 2014(r262757)
+++ head/sys/net/radix.hTue Mar  4 23:55:04 2014(r262758)
@@ -149,8 +149,7 @@ struct radix_node_head {
 
 
 #defineRADIX_NODE_HEAD_DESTROY(rnh)rw_destroy(&(rnh)->rnh_lock)
-#define RADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, 
RA_WLOCKED)
-#define RADIX_NODE_HEAD_RLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, 
RA_RLOCKED)
+#defineRADIX_NODE_HEAD_LOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, 
RA_LOCKED)
 #defineRADIX_NODE_HEAD_WLOCK_ASSERT(rnh) rw_assert(&(rnh)->rnh_lock, 
RA_WLOCKED)
 #endif /* _KERNEL */
 

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cTue Mar  4 23:27:27 2014(r262757)
+++ head/sys/net/route.cTue Mar  4 23:55:04 2014(r262758)
@@ -381,7 +381,7 @@ rtalloc1_fib(struct sockaddr *dst, int r
RADIX_NODE_HEAD_RLOCK(rnh);
 #ifdef INVARIANTS  
else
-   RADIX_NODE_HEAD_RLOCK_ASSERT(rnh);
+   RADIX_NODE_HEAD_LOCK_ASSERT(rnh);
 #endif
rn = rnh->rnh_matchaddr(dst, rnh);
if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) {
@@ -1000,10 +1000,9 @@ rn_mpath_update(int req, struct rt_addri
 * a matching RTAX_GATEWAY.
 */
struct rtentry *rt, *rto = NULL;
-   struct radix_node *rn;
+   register struct radix_node *rn;
int error = 0;
 
-   RADIX_NODE_HEAD_LOCK_ASSERT(rnh);
rn = rnh->rnh_lookup(dst, netmask, rnh);
if (rn == NULL)
return (ESRCH);
___
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: r262759 - head/tools/tools/iwn/iwnstats

2014-03-04 Thread Adrian Chadd
Author: adrian
Date: Wed Mar  5 00:26:25 2014
New Revision: 262759
URL: http://svnweb.freebsd.org/changeset/base/262759

Log:
  Add command line parsing - and an -i  option so I can monitor
  multiple iwn interfaces.
  
  Tested:
  
  * Intel 5100

Modified:
  head/tools/tools/iwn/iwnstats/main.c

Modified: head/tools/tools/iwn/iwnstats/main.c
==
--- head/tools/tools/iwn/iwnstats/main.cTue Mar  4 23:55:04 2014
(r262758)
+++ head/tools/tools/iwn/iwnstats/main.cWed Mar  5 00:26:25 2014
(r262759)
@@ -252,12 +252,42 @@ iwn_print(struct iwnstats *is)
printf("--\n");
 }
 
+static void
+usage(void)
+{
+   printf("Usage: iwnstats [-h] [-i ifname]\n");
+   printf("-h: Help\n");
+   printf("-i :Use ifname (default %s)\n",
+   IWN_DEFAULT_IF);
+}
+
 int
-main(int argc, const char *argv[])
+main(int argc, char *argv[])
 {
struct iwnstats *is;
+   int ch;
+   char *ifname;
+
+   ifname = strdup(IWN_DEFAULT_IF);
+
+   /* Parse command line arguments */
+   while ((ch = getopt(argc, argv,
+   "hi:")) != -1) {
+   switch (ch) {
+   case 'i':
+   if (ifname)
+   free(ifname);
+   ifname = strdup(optarg);
+   break;
+   default:
+   case '?':
+   case 'h':
+   usage();
+   exit(1);
+   }
+   }
 
-   is = iwnstats_new(IWN_DEFAULT_IF);
+   is = iwnstats_new(ifname);
 
if (is == NULL) {
fprintf(stderr, "%s: couldn't allocate new stats structure\n",
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r262760 - in head: sbin/pfctl sys/net sys/netpfil/pf

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar  5 00:40:03 2014
New Revision: 262760
URL: http://svnweb.freebsd.org/changeset/base/262760

Log:
  Instead of playing games with casts simply add 3 more members to the
  structure pf_rule, that are used when the structure is passed via
  ioctl().
  
  PR:   187074

Modified:
  head/sbin/pfctl/pfctl.c
  head/sys/net/pfvar.h
  head/sys/netpfil/pf/pf_ioctl.c

Modified: head/sbin/pfctl/pfctl.c
==
--- head/sbin/pfctl/pfctl.c Wed Mar  5 00:26:25 2014(r262759)
+++ head/sbin/pfctl/pfctl.c Wed Mar  5 00:40:03 2014(r262760)
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -792,18 +791,17 @@ pfctl_print_rule_counters(struct pf_rule
}
if (opts & PF_OPT_VERBOSE) {
printf("  [ Evaluations: %-8llu  Packets: %-8llu  "
-   "Bytes: %-10llu  States: %-6"PRIuPTR"]\n",
+   "Bytes: %-10llu  States: %-6lu]\n",
(unsigned long long)rule->evaluations,
(unsigned long long)(rule->packets[0] +
rule->packets[1]),
(unsigned long long)(rule->bytes[0] +
-   rule->bytes[1]),
-   (uintptr_t)rule->states_cur);
+   rule->bytes[1]), rule->u_states_cur);
if (!(opts & PF_OPT_DEBUG))
printf("  [ Inserted: uid %u pid %u "
-   "State Creations: %-6"PRIuPTR"]\n",
+   "State Creations: %-6lu]\n",
(unsigned)rule->cuid, (unsigned)rule->cpid,
-   (uintptr_t)rule->states_tot);
+   rule->u_states_tot);
}
 }
 
@@ -905,7 +903,7 @@ pfctl_show_rules(int dev, char *path, in
case PFCTL_SHOW_LABELS:
if (pr.rule.label[0]) {
printf("%s %llu %llu %llu %llu"
-   " %llu %llu %llu %"PRIuPTR"\n",
+   " %llu %llu %llu %llu\n",
pr.rule.label,
(unsigned long long)pr.rule.evaluations,
(unsigned long long)(pr.rule.packets[0] +
@@ -916,7 +914,7 @@ pfctl_show_rules(int dev, char *path, in
(unsigned long long)pr.rule.bytes[0],
(unsigned long long)pr.rule.packets[1],
(unsigned long long)pr.rule.bytes[1],
-   (uintptr_t)pr.rule.states_tot);
+   (unsigned long long)pr.rule.u_states_tot);
}
break;
case PFCTL_SHOW_RULES:

Modified: head/sys/net/pfvar.h
==
--- head/sys/net/pfvar.hWed Mar  5 00:26:25 2014(r262759)
+++ head/sys/net/pfvar.hWed Mar  5 00:40:03 2014(r262760)
@@ -580,6 +580,10 @@ struct pf_rule {
struct pf_addr  addr;
u_int16_t   port;
}   divert;
+
+   uint64_t u_states_cur;
+   uint64_t u_states_tot;
+   uint64_t u_src_nodes;
 };
 
 /* rule flags */

Modified: head/sys/netpfil/pf/pf_ioctl.c
==
--- head/sys/netpfil/pf/pf_ioctl.c  Wed Mar  5 00:26:25 2014
(r262759)
+++ head/sys/netpfil/pf/pf_ioctl.c  Wed Mar  5 00:40:03 2014
(r262760)
@@ -1349,16 +1349,9 @@ DIOCADDRULE_error:
break;
}
bcopy(rule, &pr->rule, sizeof(struct pf_rule));
-   /*
-* XXXGL: this is what happens when internal kernel
-* structures are used as ioctl API structures.
-*/
-   pr->rule.states_cur =
-   (counter_u64_t )counter_u64_fetch(rule->states_cur);
-   pr->rule.states_tot =
-   (counter_u64_t )counter_u64_fetch(rule->states_tot);
-   pr->rule.src_nodes =
-   (counter_u64_t )counter_u64_fetch(rule->src_nodes);
+   pr->rule.u_states_cur = counter_u64_fetch(rule->states_cur);
+   pr->rule.u_states_tot = counter_u64_fetch(rule->states_tot);
+   pr->rule.u_src_nodes = counter_u64_fetch(rule->src_nodes);
if (pf_anchor_copyout(ruleset, rule, pr)) {
PF_RULES_WUNLOCK();
error = EBUSY;
___
svn-src-all@freebsd.org mailing list

svn commit: r262761 - in stable/10: release release/picobsd/build share/man/man7

2014-03-04 Thread Glen Barber
Author: gjb
Date: Wed Mar  5 00:45:28 2014
New Revision: 262761
URL: http://svnweb.freebsd.org/changeset/base/262761

Log:
  MFC r262499, r262505, r262507, r262509:
  
  r262499:
release.sh:
- Add a VCSCMD variable that defaults to 'svn checkout',
  and update places 'svn co' is used directly.
- After sourcing a configuration file, prefix SRCBRANCH,
  PORTBRANCH, and DOCBRANCH with the SVNROOT.
- Properly capitalize 'FreeBSD.org' in the default SVNROOT.
- Update Copyright.
  
release.conf.sample:
- Add an example to use git instead of svn, by nullifying
  SVNROOT, and setting SRCBRANCH, DOCBRANCH, and PORTBRANCH
  to the URL fo a git repository.
  
release.7:
- Document VCSCMD.
  
  r262505:
In release/Makefile, remove exclusion of CVS directories in the
src/ and ports/ distributions.
  
While I am thinking about it, exclude .git directories for src/
and ports/, as somewhat of a followup to r262499.
  
  r262507:
Chase r262505, and remove CVS exclusion from picobsd builds.
  
  r262509:
Rework how WORLD_FLAGS and KERNEL_FLAGS are set, to remove an
unnecessary expr(1) call.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/10/release/Makefile
  stable/10/release/picobsd/build/picobsd
  stable/10/release/release.conf.sample
  stable/10/release/release.sh
  stable/10/share/man/man7/release.7
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/release/Makefile
==
--- stable/10/release/Makefile  Wed Mar  5 00:40:03 2014(r262760)
+++ stable/10/release/Makefile  Wed Mar  5 00:45:28 2014(r262761)
@@ -119,13 +119,13 @@ src.txz:
mkdir -p ${DISTDIR}/usr
ln -fs ${WORLDDIR} ${DISTDIR}/usr/src
cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude 
.zfs \
-   --exclude CVS --exclude @ --exclude usr/src/release/dist usr/src
+   --exclude .git --exclude @ --exclude usr/src/release/dist usr/src
 
 ports.txz:
mkdir -p ${DISTDIR}/usr
ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \
-   --exclude CVS --exclude .svn \
+   --exclude .git --exclude .svn \
--exclude usr/ports/distfiles --exclude usr/ports/packages \
--exclude 'usr/ports/INDEX*' --exclude work usr/ports
 

Modified: stable/10/release/picobsd/build/picobsd
==
--- stable/10/release/picobsd/build/picobsd Wed Mar  5 00:40:03 2014
(r262760)
+++ stable/10/release/picobsd/build/picobsd Wed Mar  5 00:45:28 2014
(r262761)
@@ -474,7 +474,7 @@ populate_floppy_fs() {  # OK
 for FLOPPY_TREE in ${PICO_TREE}/floppy.tree ${MY_TREE}/floppy.tree \
${MY_TREE}/floppy.tree.${SITE} ; do
if [ -d ${FLOPPY_TREE} ] ; then
-   (cd ${FLOPPY_TREE} ; tar -cf - --exclude CVS \
+   (cd ${FLOPPY_TREE} ; tar -cf - \
--exclude .svn ${excl} . ) | \
(cd ${dst} ; tar x${o_tarv}f - )
log "Copied from ${FLOPPY_TREE}"
@@ -714,7 +714,7 @@ populate_mfs_tree() {
 for MFS_TREE in ${PICO_TREE}/mfs_tree ${MY_TREE}/mfs_tree ; do
if [ -d ${MFS_TREE} ] ; then
log "Copy ${MFS_TREE} ..."
-   (cd ${MFS_TREE} ; tar -cf - --exclude CVS --exclude .svn . ) | \
+   (cd ${MFS_TREE} ; tar -cf - --exclude .svn . ) | \
(cd ${dst} ; tar x${o_tarv}f - )
fi
 done

Modified: stable/10/release/release.conf.sample
==
--- stable/10/release/release.conf.sample   Wed Mar  5 00:40:03 2014
(r262760)
+++ stable/10/release/release.conf.sample   Wed Mar  5 00:45:28 2014
(r262761)
@@ -7,7 +7,7 @@
 CHROOTDIR="/scratch"
 
 ## Set the svn host.
-SVNROOT="svn://svn.FreeBSD.org"
+SVNROOT="svn://svn.FreeBSD.org/"
 
 ## Set the src/, ports/, and doc/ branches or tags.
 SRCBRANCH="base/head@rHEAD"
@@ -17,6 +17,13 @@ PORTBRANCH="ports/head@rHEAD"
 ## Run svn co --force for src checkout.
 #SRC_FORCE_CHECKOUT=yes
 
+## Sample configuration for using git instead of svn.
+#VCSCMD="/usr/local/bin/git clone --branch master"
+#SVNROOT=""
+#SRCBRANCH="https://github.com/freebsd/freebsd";
+#DOCBRANCH="https://github.com/freebsd/freebsd-doc";
+#PORTBRANCH="https://github.com/freebsd/freebsd-ports";
+
 ## Set to override the default target architecture.
 #TARGET="amd64"
 #TARGET_ARCH="amd64"

Modified: stable/10/release/release.sh
==
--- stable/10/release/release.shWed Mar  5 00:40:03 2014
(r262760)
+++ stable/10/release/release.shWed Mar  5 00:45:28 2014
(r262761)
@@ -1,9 +1,13 @@
 #!/bin/sh
 #-
+# Copyright (c) 2013, 2014 

svn commit: r262762 - in stable/9: release release/picobsd/build share/man/man7

2014-03-04 Thread Glen Barber
Author: gjb
Date: Wed Mar  5 00:48:11 2014
New Revision: 262762
URL: http://svnweb.freebsd.org/changeset/base/262762

Log:
  MFC r262499, r262505, r262507, r262509:
  
  r262499:
release.sh:
- Add a VCSCMD variable that defaults to 'svn checkout',
  and update places 'svn co' is used directly.
- After sourcing a configuration file, prefix SRCBRANCH,
  PORTBRANCH, and DOCBRANCH with the SVNROOT.
- Properly capitalize 'FreeBSD.org' in the default SVNROOT.
- Update Copyright.
  
release.conf.sample:
- Add an example to use git instead of svn, by nullifying
  SVNROOT, and setting SRCBRANCH, DOCBRANCH, and PORTBRANCH
  to the URL fo a git repository.
  
release.7:
- Document VCSCMD.
  
  r262505:
In release/Makefile, remove exclusion of CVS directories in the
src/ and ports/ distributions.
  
While I am thinking about it, exclude .git directories for src/
and ports/, as somewhat of a followup to r262499.
  
  r262507:
Chase r262505, and remove CVS exclusion from picobsd builds.
  
  r262509:
Rework how WORLD_FLAGS and KERNEL_FLAGS are set, to remove an
unnecessary expr(1) call.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/9/release/Makefile
  stable/9/release/picobsd/build/picobsd
  stable/9/release/release.conf.sample
  stable/9/release/release.sh
  stable/9/share/man/man7/release.7
Directory Properties:
  stable/9/release/   (props changed)
  stable/9/share/man/man7/   (props changed)

Modified: stable/9/release/Makefile
==
--- stable/9/release/Makefile   Wed Mar  5 00:45:28 2014(r262761)
+++ stable/9/release/Makefile   Wed Mar  5 00:48:11 2014(r262762)
@@ -118,13 +118,13 @@ src.txz:
mkdir -p ${DISTDIR}/usr
ln -fs ${WORLDDIR} ${DISTDIR}/usr/src
cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/src.txz --exclude .svn --exclude 
.zfs \
-   --exclude CVS --exclude @ --exclude usr/src/release/dist usr/src
+   --exclude .git --exclude @ --exclude usr/src/release/dist usr/src
 
 ports.txz:
mkdir -p ${DISTDIR}/usr
ln -fs ${PORTSDIR} ${DISTDIR}/usr/ports
cd ${DISTDIR} && tar cLvJf ${.OBJDIR}/ports.txz \
-   --exclude CVS --exclude .svn \
+   --exclude .git --exclude .svn \
--exclude usr/ports/distfiles --exclude usr/ports/packages \
--exclude 'usr/ports/INDEX*' --exclude work usr/ports
 

Modified: stable/9/release/picobsd/build/picobsd
==
--- stable/9/release/picobsd/build/picobsd  Wed Mar  5 00:45:28 2014
(r262761)
+++ stable/9/release/picobsd/build/picobsd  Wed Mar  5 00:48:11 2014
(r262762)
@@ -474,7 +474,7 @@ populate_floppy_fs() {  # OK
 for FLOPPY_TREE in ${PICO_TREE}/floppy.tree ${MY_TREE}/floppy.tree \
${MY_TREE}/floppy.tree.${SITE} ; do
if [ -d ${FLOPPY_TREE} ] ; then
-   (cd ${FLOPPY_TREE} ; tar -cf - --exclude CVS \
+   (cd ${FLOPPY_TREE} ; tar -cf - \
--exclude .svn ${excl} . ) | \
(cd ${dst} ; tar x${o_tarv}f - )
log "Copied from ${FLOPPY_TREE}"
@@ -714,7 +714,7 @@ populate_mfs_tree() {
 for MFS_TREE in ${PICO_TREE}/mfs_tree ${MY_TREE}/mfs_tree ; do
if [ -d ${MFS_TREE} ] ; then
log "Copy ${MFS_TREE} ..."
-   (cd ${MFS_TREE} ; tar -cf - --exclude CVS --exclude .svn . ) | \
+   (cd ${MFS_TREE} ; tar -cf - --exclude .svn . ) | \
(cd ${dst} ; tar x${o_tarv}f - )
fi
 done

Modified: stable/9/release/release.conf.sample
==
--- stable/9/release/release.conf.sampleWed Mar  5 00:45:28 2014
(r262761)
+++ stable/9/release/release.conf.sampleWed Mar  5 00:48:11 2014
(r262762)
@@ -7,7 +7,7 @@
 CHROOTDIR="/scratch"
 
 ## Set the svn host.
-SVNROOT="svn://svn.FreeBSD.org"
+SVNROOT="svn://svn.FreeBSD.org/"
 
 ## Set the src/, ports/, and doc/ branches or tags.
 SRCBRANCH="base/stable/9@rHEAD"
@@ -17,6 +17,13 @@ PORTBRANCH="ports/head@rHEAD"
 ## Run svn co --force for src checkout.
 #SRC_FORCE_CHECKOUT=yes
 
+## Sample configuration for using git instead of svn.
+#VCSCMD="/usr/local/bin/git clone --branch master"
+#SVNROOT=""
+#SRCBRANCH="https://github.com/freebsd/freebsd";
+#DOCBRANCH="https://github.com/freebsd/freebsd-doc";
+#PORTBRANCH="https://github.com/freebsd/freebsd-ports";
+
 ## Set to override the default target architecture.
 #TARGET="amd64"
 #TARGET_ARCH="amd64"

Modified: stable/9/release/release.sh
==
--- stable/9/release/release.sh Wed Mar  5 00:45:28 2014(r262761)
+++ stable/9/release/release.sh Wed Mar  5 00:48:11 2014(r262762)
@@ -1,9 +1,13 @@
 #!/bin/sh
 #-

svn commit: r262763 - in head: share/man/man9 sys/contrib/ipfilter/netinet sys/net sys/netatalk sys/netinet sys/netinet6 sys/netipx sys/netpfil/pf sys/nfs usr.bin/netstat

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar  5 01:17:47 2014
New Revision: 262763
URL: http://svnweb.freebsd.org/changeset/base/262763

Log:
  - Remove rt_metrics_lite and simply put its members into rtentry.
  - Use counter(9) for rt_pksent (former rt_rmx.rmx_pksent). This
removes another cache trashing ++ from packet forwarding path.
  - Create zini/fini methods for the rtentry UMA zone. Via initialize
mutex and counter in them.
  - Fix reporting of rmx_pksent to routing socket.
  - Fix netstat(1) to report "Use" both in kvm(3) and sysctl(3) mode.
  
  The change is mostly targeted for stable/10 merge. For head,
  rt_pksent is expected to just disappear.
  
  Discussed with:   melifaro
  Sponsored by: Netflix
  Sponsored by: Nginx, Inc.

Modified:
  head/share/man/man9/rtentry.9
  head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
  head/sys/net/if_disc.c
  head/sys/net/if_faith.c
  head/sys/net/if_loop.c
  head/sys/net/if_stf.c
  head/sys/net/radix_mpath.c
  head/sys/net/route.c
  head/sys/net/route.h
  head/sys/net/rtsock.c
  head/sys/netatalk/ddp_output.c
  head/sys/netinet/in_rmx.c
  head/sys/netinet/ip_fastfwd.c
  head/sys/netinet/ip_input.c
  head/sys/netinet/ip_ipsec.c
  head/sys/netinet/ip_output.c
  head/sys/netinet/sctp_os_bsd.h
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet6/in6_rmx.c
  head/sys/netinet6/ip6_ipsec.c
  head/sys/netinet6/ip6_output.c
  head/sys/netipx/ipx_input.c
  head/sys/netipx/ipx_outputfl.c
  head/sys/netpfil/pf/pf.c
  head/sys/nfs/bootp_subr.c
  head/usr.bin/netstat/main.c
  head/usr.bin/netstat/netstat.h
  head/usr.bin/netstat/route.c

Modified: head/share/man/man9/rtentry.9
==
--- head/share/man/man9/rtentry.9   Wed Mar  5 00:48:11 2014
(r262762)
+++ head/share/man/man9/rtentry.9   Wed Mar  5 01:17:47 2014
(r262763)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 16, 2013
+.Dd March 5, 2014
 .Dt RTENTRY 9
 .Os
 .Sh NAME
@@ -78,6 +78,12 @@ intermediate stop on the way to that des
 flag is set).
 .It Vt "int rt_flags" ;
 See below.
+If the
+.Dv RTF_UP
+flag is not present, the
+.Fn rtfree
+function will delete the route from the radix tree when the last
+reference drops.
 .It Vt "int rt_refcnt" ;
 Route entries are reference-counted; this field indicates the number
 of external (to the radix tree) references.
@@ -89,14 +95,14 @@ as it were, to the question posed by a r
 name the interface and interface address to be used in sending a
 packet to the destination or set of destinations which this route
 represents.
-.It Vt "struct rt_metrics_lite rt_rmx" ;
-See below.
-If the
-.Dv RTF_UP
-flag is not present, the
-.Fn rtfree
-function will delete the route from the radix tree when the last
-reference drops.
+.It Vt "u_long rt_mtu";
+See description of rmx_mtu below.
+.It Vt "u_long rt_weight";
+See description of rmx_weight below.
+.It Vt "u_long rt_expire";
+See description of rmx_expire below.
+.It Vt "counter64_t rt_pksent";
+See description of rmx_pksent below.
 .It Vt "struct rtentry *rt_gwroute" ;
 This member is a reference to a route whose destination is
 .Va rt_gateway .
@@ -164,9 +170,7 @@ Indicates that the destination is a broa
 Indicates that the destination is a multicast address.
 .El
 .Pp
-Every route has associated with it a set of metrics, stored in
-.Vt "struct rt_metrics_lite" .
-Metrics are supplied in
+Several metrics are supplied in
 .Vt "struct rt_metrics"
 passed with routing control messages via
 .Xr route 4
@@ -175,8 +179,7 @@ Currently only
 .Vt rmx_mtu , rmx_expire ,
 and
 .Vt rmx_pksent
-metrics are used in
-.Vt "struct rt_metrics_lite" .
+metrics are supplied.
 All others are ignored.
 .Pp
 The following metrics are defined by

Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==
--- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c  Wed Mar  5 00:48:11 
2014(r262762)
+++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c  Wed Mar  5 01:17:47 
2014(r262763)
@@ -802,7 +802,7 @@ ipf_fastroute(m0, mpp, fin, fdp)
if (ro->ro_rt->rt_flags & RTF_GATEWAY)
dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway;
if (ro->ro_rt)
-   ro->ro_rt->rt_use++;
+   counter_u64_add(ro->ro_rt->rt_pksent, 1);
 
/*
 * For input packets which are being "fastrouted", they won't

Modified: head/sys/net/if_disc.c
==
--- head/sys/net/if_disc.c  Wed Mar  5 00:48:11 2014(r262762)
+++ head/sys/net/if_disc.c  Wed Mar  5 01:17:47 2014(r262763)
@@ -186,7 +186,7 @@ static void
 discrtrequest(int cmd, struct rtentry *rt, struct rt_addrinfo *info)
 {
RT_LOCK_ASSERT(rt);
-   rt->rt_rmx.rmx_mtu = DSMTU;
+   rt->rt_mtu = DSMTU;
 }
 
 /*

Modif

svn commit: r262765 - head/sys/amd64/amd64

2014-03-04 Thread Ed Maste
Author: emaste
Date: Wed Mar  5 01:34:10 2014
New Revision: 262765
URL: http://svnweb.freebsd.org/changeset/base/262765

Log:
  Disable amd64 TLB Context ID (pcid) by default for now
  
  There are a number of reports of userspace application crashes that
  are "solved" by setting vm.pmap.pcid_enabled=0, including Java and the
  x11/mate-terminal port (PR ports/184362).
  
  I originally planned to disable this only in stable/10 (in r262753), but
  it has been pointed out that additional crash reports on HEAD are not
  likely to provide new insight into the problem.  The feature can easily
  be enabled for testing.

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed Mar  5 01:33:15 2014(r262764)
+++ head/sys/amd64/amd64/pmap.c Wed Mar  5 01:34:10 2014(r262765)
@@ -367,7 +367,7 @@ static int pmap_flags = PMAP_PDE_SUPERPA
 
 static struct unrhdr pcid_unr;
 static struct mtx pcid_mtx;
-int pmap_pcid_enabled = 1;
+int pmap_pcid_enabled = 0;
 SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN, &pmap_pcid_enabled,
 0, "Is TLB Context ID enabled ?");
 int invpcid_works = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r262764 - in head/sys/contrib/xz-embedded: . linux/include/linux linux/lib linux/lib/xz linux/scripts userspace

2014-03-04 Thread Xin LI
Author: delphij
Date: Wed Mar  5 01:33:15 2014
New Revision: 262764
URL: http://svnweb.freebsd.org/changeset/base/262764

Log:
  MFV r262756:
  
  Import xz-embedded from git.
  
  This is from commit hash '6a8a2364434763a033781f6b2a605ace9a021013'.
  
  This makes it possible to use CRC64 but for now it's intentionally
  not added to build.

Added:
  head/sys/contrib/xz-embedded/linux/lib/xz/xz_crc64.c
 - copied unchanged from r262756, 
vendor/xz-embedded/dist/linux/lib/xz/xz_crc64.c
  head/sys/contrib/xz-embedded/userspace/bytetest.c
 - copied unchanged from r262756, 
vendor/xz-embedded/dist/userspace/bytetest.c
Modified:
  head/sys/contrib/xz-embedded/README
  head/sys/contrib/xz-embedded/linux/include/linux/xz.h
  head/sys/contrib/xz-embedded/linux/lib/decompress_unxz.c
  head/sys/contrib/xz-embedded/linux/lib/xz/Kconfig
  head/sys/contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c
  head/sys/contrib/xz-embedded/linux/scripts/xz_wrap.sh
  head/sys/contrib/xz-embedded/userspace/Makefile
  head/sys/contrib/xz-embedded/userspace/boottest.c
  head/sys/contrib/xz-embedded/userspace/xz_config.h
  head/sys/contrib/xz-embedded/userspace/xzminidec.c
Directory Properties:
  head/sys/contrib/xz-embedded/   (props changed)

Modified: head/sys/contrib/xz-embedded/README
==
--- head/sys/contrib/xz-embedded/README Wed Mar  5 01:17:47 2014
(r262763)
+++ head/sys/contrib/xz-embedded/README Wed Mar  5 01:33:15 2014
(r262764)
@@ -7,7 +7,7 @@ XZ Embedded
 
 XZ Embedded was written for use in the Linux kernel, but the code can
 be easily used in other environments too, including regular userspace
-applications.
+applications. See userspace/xzminidec.c for an example program.
 
 This README contains information that is useful only when the copy
 of XZ Embedded isn't part of the Linux kernel tree. You should also
@@ -84,6 +84,42 @@ Embedding into userspace applications
 environment. Probably you should at least skim through it even if the
 default file works as is.
 
+Integrity check support
+
+XZ Embedded always supports the integrity check types None and
+CRC32. Support for CRC64 is optional. SHA-256 is currently not
+supported in XZ Embedded although the .xz format does support it.
+The xz tool from XZ Utils uses CRC64 by default, but CRC32 is usually
+enough in embedded systems to keep the code size smaller.
+
+If you want support for CRC64, you need to copy linux/lib/xz/xz_crc64.c
+into your application, and #define XZ_USE_CRC64 in xz_config.h or in
+compiler flags.
+
+When using the internal CRC32 or CRC64, their lookup tables need to be
+initialized with xz_crc32_init() and xz_crc64_init(), respectively.
+See xz.h for details.
+
+To use external CRC32 or CRC64 code instead of the code from
+xz_crc32.c or xz_crc64.c, the following #defines may be used
+in xz_config.h or in compiler flags:
+
+#define XZ_INTERNAL_CRC32 0
+#define XZ_INTERNAL_CRC64 0
+
+Then it is up to you to provide compatible xz_crc32() or xz_crc64()
+functions.
+
+If the .xz file being decompressed uses an integrity check type that
+isn't supported by XZ Embedded, it is treated as an error and the
+file cannot be decompressed. For multi-call mode, this can be modified
+by #defining XZ_DEC_ANY_CHECK. Then xz_dec_run() will return
+XZ_UNSUPPORTED_CHECK when unsupported check type is detected. After
+that decompression can be continued normally except that the
+integrity check won't be verified. In single-call mode there's
+no way to continue decoding, so XZ_DEC_ANY_CHECK is almost useless
+in single-call mode.
+
 BCJ filter support
 
 If you want support for one or more BCJ filters, you need to copy also

Modified: head/sys/contrib/xz-embedded/linux/include/linux/xz.h
==
--- head/sys/contrib/xz-embedded/linux/include/linux/xz.h   Wed Mar  5 
01:17:47 2014(r262763)
+++ head/sys/contrib/xz-embedded/linux/include/linux/xz.h   Wed Mar  5 
01:33:15 2014(r262764)
@@ -256,6 +256,22 @@ XZ_EXTERN void xz_dec_end(struct xz_dec 
 #  endif
 #endif
 
+/*
+ * If CRC64 support has been enabled with XZ_USE_CRC64, a CRC64
+ * implementation is needed too.
+ */
+#ifndef XZ_USE_CRC64
+#  undef XZ_INTERNAL_CRC64
+#  define XZ_INTERNAL_CRC64 0
+#endif
+#ifndef XZ_INTERNAL_CRC64
+#  ifdef __KERNEL__
+#  error Using CRC64 in the kernel has not been implemented.
+#  else
+#  define XZ_INTERNAL_CRC64 1
+#  endif
+#endif
+
 #if XZ_INTERNAL_CRC32
 /*
  * This must be called before any other xz_* function to initialize
@@ -271,6 +287,21 @@ XZ_EXTERN void xz_crc32_init(void);
 XZ_EXTERN uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc);
 #endif
 
+#if XZ_INTERNAL_CRC64
+/*
+ *

svn commit: r262766 - head/tools/tools/iwn/iwnstats

2014-03-04 Thread Eitan Adler
Author: eadler
Date: Wed Mar  5 01:41:10 2014
New Revision: 262766
URL: http://svnweb.freebsd.org/changeset/base/262766

Log:
  If the device doesn't exist when iwnstats starts running don't spam the 
console
  forever.

Modified:
  head/tools/tools/iwn/iwnstats/main.c

Modified: head/tools/tools/iwn/iwnstats/main.c
==
--- head/tools/tools/iwn/iwnstats/main.cWed Mar  5 01:34:10 2014
(r262765)
+++ head/tools/tools/iwn/iwnstats/main.cWed Mar  5 01:41:10 2014
(r262766)
@@ -29,6 +29,7 @@
  * $FreeBSD$
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -267,6 +268,7 @@ main(int argc, char *argv[])
struct iwnstats *is;
int ch;
char *ifname;
+   bool first;
 
ifname = strdup(IWN_DEFAULT_IF);
 
@@ -296,9 +298,12 @@ main(int argc, char *argv[])
}
 
/* begin fetching data */
+   first = true;
while (1) {
if (iwn_collect(is) != 0) {
fprintf(stderr, "%s: fetch failed\n", argv[0]);
+   if (first)
+   return 1;
goto next;
}
 
@@ -306,6 +311,7 @@ main(int argc, char *argv[])
 
next:
usleep(100 * 1000);
+   first = false;
}
 
exit(0);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r262767 - in head: sys/net usr.bin/netstat

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar  5 01:47:08 2014
New Revision: 262767
URL: http://svnweb.freebsd.org/changeset/base/262767

Log:
  Hide struct rtentry from userland.

Modified:
  head/sys/net/route.h
  head/usr.bin/netstat/route.c

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hWed Mar  5 01:41:10 2014(r262766)
+++ head/sys/net/route.hWed Mar  5 01:47:08 2014(r262767)
@@ -105,6 +105,8 @@ struct mbuf;
 #include 
 #endif
 #endif
+
+#if defined(_KERNEL) || defined(_WANT_RTENTRY)
 struct rtentry {
struct  radix_node rt_nodes[2]; /* tree glue, and other values */
/*
@@ -127,6 +129,7 @@ struct rtentry {
counter_u64_t   rt_pksent;  /* packets sent using this route */
struct mtx  rt_mtx; /* mutex for routing entry */
 };
+#endif /* _KERNEL || _WANT_RTENTRY */
 
 /*
  * Following structure necessary for 4.3 compatibility;

Modified: head/usr.bin/netstat/route.c
==
--- head/usr.bin/netstat/route.cWed Mar  5 01:41:10 2014
(r262766)
+++ head/usr.bin/netstat/route.cWed Mar  5 01:47:08 2014
(r262767)
@@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#define_WANT_RTENTRY
 #include 
 
 #include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r262768 - head/tools/tools/iwn/iwnstats

2014-03-04 Thread Eitan Adler
Author: eadler
Date: Wed Mar  5 01:49:39 2014
New Revision: 262768
URL: http://svnweb.freebsd.org/changeset/base/262768

Log:
  Add static where appropriate.

Modified:
  head/tools/tools/iwn/iwnstats/main.c

Modified: head/tools/tools/iwn/iwnstats/main.c
==
--- head/tools/tools/iwn/iwnstats/main.cWed Mar  5 01:47:08 2014
(r262767)
+++ head/tools/tools/iwn/iwnstats/main.cWed Mar  5 01:49:39 2014
(r262768)
@@ -49,7 +49,7 @@
 
 #defineIWN_DEFAULT_IF  "iwn0"
 
-struct iwnstats *
+static struct iwnstats *
 iwnstats_new(const char *ifname)
 {
struct iwnstats *is;
___
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: r262769 - head/usr.bin/logger

2014-03-04 Thread Brad Davis
Author: brd (doc committer)
Date: Wed Mar  5 02:10:10 2014
New Revision: 262769
URL: http://svnweb.freebsd.org/changeset/base/262769

Log:
  - Clarify usage of the -f option.
  
  Reviewed by:  gjb@, dru@, and Allan Jude

Modified:
  head/usr.bin/logger/logger.1

Modified: head/usr.bin/logger/logger.1
==
--- head/usr.bin/logger/logger.1Wed Mar  5 01:49:39 2014
(r262768)
+++ head/usr.bin/logger/logger.1Wed Mar  5 02:10:10 2014
(r262769)
@@ -28,7 +28,7 @@
 .\"@(#)logger.18.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd August 2, 2006
+.Dd March 4, 2014
 .Dt LOGGER 1
 .Os
 .Sh NAME
@@ -74,7 +74,7 @@ with each line.
 .It Fl s
 Log the message to standard error, as well as the system log.
 .It Fl f Ar file
-Log the specified file.
+Read the contents of the specified file into syslog.
 .It Fl h Ar host
 Send the message to the remote system
 .Ar host
___
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: r262770 - head/sys/net

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar  5 02:35:15 2014
New Revision: 262770
URL: http://svnweb.freebsd.org/changeset/base/262770

Log:
  Pacify gcc.

Modified:
  head/sys/net/flowtable.c

Modified: head/sys/net/flowtable.c
==
--- head/sys/net/flowtable.cWed Mar  5 02:10:10 2014(r262769)
+++ head/sys/net/flowtable.cWed Mar  5 02:35:15 2014(r262770)
@@ -772,6 +772,7 @@ flowtable_free_stale(struct flowtable *f
tmpsize = ft->ft_size;
memcpy(tmpmask, mask, ft->ft_size/8);
curbit = 0;
+   fleprev = NULL; /* pacify gcc */
/*
 * XXX Note to self, bit_ffs operates at the byte level
 * and thus adds gratuitous overhead
___
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: r262771 - head/sys/netatalk

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar  5 02:35:41 2014
New Revision: 262771
URL: http://svnweb.freebsd.org/changeset/base/262771

Log:
  Fix build.

Modified:
  head/sys/netatalk/at_proto.c

Modified: head/sys/netatalk/at_proto.c
==
--- head/sys/netatalk/at_proto.cWed Mar  5 02:35:15 2014
(r262770)
+++ head/sys/netatalk/at_proto.cWed Mar  5 02:35:41 2014
(r262771)
@@ -24,6 +24,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r262772 - stable/10/sys/net

2014-03-04 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar  5 03:16:23 2014
New Revision: 262772
URL: http://svnweb.freebsd.org/changeset/base/262772

Log:
  Merge r262770 from head: pacify gcc.

Modified:
  stable/10/sys/net/flowtable.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/flowtable.c
==
--- stable/10/sys/net/flowtable.c   Wed Mar  5 02:35:41 2014
(r262771)
+++ stable/10/sys/net/flowtable.c   Wed Mar  5 03:16:23 2014
(r262772)
@@ -772,6 +772,7 @@ flowtable_free_stale(struct flowtable *f
tmpsize = ft->ft_size;
memcpy(tmpmask, mask, ft->ft_size/8);
curbit = 0;
+   fleprev = NULL; /* pacify gcc */
/*
 * XXX Note to self, bit_ffs operates at the byte level
 * and thus adds gratuitous overhead
___
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: r262775 - head/sbin/savecore

2014-03-04 Thread Mark Johnston
Author: markj
Date: Wed Mar  5 04:15:17 2014
New Revision: 262775
URL: http://svnweb.freebsd.org/changeset/base/262775

Log:
  Log the name of the device that we failed to open rather than an
  uninitialized buffer.
  
  MFC after:3 days

Modified:
  head/sbin/savecore/savecore.c

Modified: head/sbin/savecore/savecore.c
==
--- head/sbin/savecore/savecore.c   Wed Mar  5 04:09:05 2014
(r262774)
+++ head/sbin/savecore/savecore.c   Wed Mar  5 04:15:17 2014
(r262775)
@@ -618,7 +618,7 @@ DoFile(const char *savedir, const char *
 */
fdinfo = open(infoname, O_WRONLY | O_CREAT | O_TRUNC, 0600);
if (fdinfo < 0) {
-   syslog(LOG_ERR, "%s: %m", buf);
+   syslog(LOG_ERR, "%s: %m", infoname);
nerr++;
goto closefd;
}
___
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: r262776 - head/sys/mips/conf

2014-03-04 Thread Sean Bruno
Author: sbruno
Date: Wed Mar  5 04:18:42 2014
New Revision: 262776
URL: http://svnweb.freebsd.org/changeset/base/262776

Log:
  Rename the Dlink 825 configuration file to indicate that this is for the
  mips 24k B1

Added:
  head/sys/mips/conf/DIR-825B1
 - copied unchanged from r262775, head/sys/mips/conf/DIR-825
  head/sys/mips/conf/DIR-825B1.hints
 - copied unchanged from r262775, head/sys/mips/conf/DIR-825.hints
Deleted:
  head/sys/mips/conf/DIR-825
  head/sys/mips/conf/DIR-825.hints

Copied: head/sys/mips/conf/DIR-825B1 (from r262775, head/sys/mips/conf/DIR-825)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/DIR-825B1Wed Mar  5 04:18:42 2014
(r262776, copy of r262775, head/sys/mips/conf/DIR-825)
@@ -0,0 +1,71 @@
+#
+# Specific board setup for the D-Link DIR-825 router.
+#
+# The DIR-825 has the following hardware:
+#
+# + AR7161 CPU SoC
+# + AR9223 2.4GHz 11n
+# + AR9220 5GHz 11n
+# + RealTek RTL8366S Gigabit switch
+# + m25p64 based 8MB flash
+# + 64MB RAM
+# + uboot environment
+
+# $FreeBSD$
+
+include"AR71XX_BASE"
+ident  "DIR-825"
+hints  "DIR-825.hints"
+
+# Since the kernel image must fit inside 1024KiB, we have to build almost
+# everything as modules.
+nodevice random
+nodevice gpio
+nodevice gpioled
+nodevice gif
+nodevice gre
+nodevice if_bridge
+nodevice usb
+nodevice ehci
+nodevice wlan
+nodevice wlan_xauth
+nodevice wlan_acl
+nodevice wlan_wep
+nodevice wlan_tkip
+nodevice wlan_ccmp
+nodevice wlan_rssadapt
+nodevice wlan_amrr
+nodevice ath
+nodevice ath_pci
+nodevice ath_hal
+nodevice umass
+nodevice ath_rate_sample
+
+nooptions  INET6
+
+# Don't include the SCSI/CAM strings in the default build
+optionsSCSI_NO_SENSE_STRINGS
+optionsSCSI_NO_OP_STRINGS
+
+# .. And no sysctl strings
+optionsNO_SYSCTL_DESCR
+
+# GEOM modules
+device geom_map# to get access to the SPI flash partitions
+device geom_uncompress # compressed in-memory filesystem hackery!
+optionsGEOM_UNCOMPRESS
+optionsGEOM_PART_GPT
+
+optionsROOTDEVNAME=\"ufs:/dev/map/rootfs.uncompress\"
+optionsAR71XX_REALMEM=64*1024*1024
+
+optionsAR71XX_ENV_UBOOT
+
+optionsMSDOSFS # Read MSDOS filesystems; 
useful for USB/CF
+
+# options  MD_ROOT
+# options  MD_ROOT_SIZE="6144"
+
+optionsAR71XX_ATH_EEPROM   # Fetch EEPROM/PCI config from 
flash
+optionsATH_EEPROM_FIRMWARE # Use EEPROM from flash
+device firmware# Used by the above

Copied: head/sys/mips/conf/DIR-825B1.hints (from r262775, 
head/sys/mips/conf/DIR-825.hints)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/DIR-825B1.hints  Wed Mar  5 04:18:42 2014
(r262776, copy of r262775, head/sys/mips/conf/DIR-825.hints)
@@ -0,0 +1,71 @@
+# $FreeBSD$
+
+# arge0 is connected to the LAN side of the switch PHY.
+# arge1 is connected to the single port WAN side of the switch PHY.
+
+hint.arge.0.phymask=0x0
+hint.arge.0.media=1000
+hint.arge.0.fduplex=1
+hint.arge.0.eeprommac=0x1f66ffa0
+hint.arge.0.readascii=1
+
+hint.arge.1.phymask=0x0
+hint.arge.1.media=1000
+hint.arge.1.fduplex=1
+hint.arge.1.eeprommac=0x1f66ffb4
+hint.arge.1.readascii=1
+
+# ath0 - slot 17
+hint.pcib.0.bus.0.17.0.ath_fixup_addr=0x1f661000
+hint.pcib.0.bus.0.17.0.ath_fixup_size=4096
+
+# ath1 - slot 18
+hint.pcib.0.bus.0.18.0.ath_fixup_addr=0x1f665000
+hint.pcib.0.bus.0.18.0.ath_fixup_size=4096
+
+# .. and now, telling each ath(4) NIC where to find the firmware
+# image.
+hint.ath.0.eeprom_firmware="pcib.0.bus.0.17.0.eeprom_firmware"
+hint.ath.1.eeprom_firmware="pcib.0.bus.0.18.0.eeprom_firmware"
+
+# TODO: gpio LEDs
+
+# Geom MAP
+
+# The DIR-825 has an 8MB flash part - HOWEVER, the 64k caldata isn't
+# at the end of the flash. It's ~ 6MB into the flash image.
+
+# 
mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata)
+
+hint.map.0.at="flash/spi0"
+hint.map.0.start=0x
+hint.map.0.end=0x4
+hint.map.0.name="uboot"
+hint.map.0.readonly=1
+
+# This config partition is the D-Link specific configuration area.
+# I'm re-purposing it for FreeBSD.
+hint.map.1.at="flash/spi0"
+hint.map.1.start=0x0004
+hint.map.1.end=0x0005
+hint.map.1.name="cfg"
+hint.map.1.readonly=0
+
+hint.map.2.at="flash/spi0"
+hint.map.2.start=0x005
+hint.map.2.end=0x0015
+hint.map.2.name="kernel"
+hint.map.2.readonly=1
+
+hint.map.3.at="flash/spi0"
+hint.map.3.start=0x0015
+hint.map.3.end=0x0066
+hint.map.3.name="rootfs"
+hint.map.3.readonly=0
+
+hint.map.4.at="flash/spi0"
+hint.map.4.start=0x0066
+hint.map.4.end=0x0067
+hint.map.

svn commit: r262777 - head/sys/mips/conf

2014-03-04 Thread Sean Bruno
Author: sbruno
Date: Wed Mar  5 04:19:52 2014
New Revision: 262777
URL: http://svnweb.freebsd.org/changeset/base/262777

Log:
  Update location of hints and name of the kernel we are building.

Modified:
  head/sys/mips/conf/DIR-825B1
  head/sys/mips/conf/DIR-825B1.hints

Modified: head/sys/mips/conf/DIR-825B1
==
--- head/sys/mips/conf/DIR-825B1Wed Mar  5 04:18:42 2014
(r262776)
+++ head/sys/mips/conf/DIR-825B1Wed Mar  5 04:19:52 2014
(r262777)
@@ -1,7 +1,7 @@
 #
-# Specific board setup for the D-Link DIR-825 router.
+# Specific board setup for the D-Link DIR-825B1 router.
 #
-# The DIR-825 has the following hardware:
+# The DIR-825B1 has the following hardware:
 #
 # + AR7161 CPU SoC
 # + AR9223 2.4GHz 11n
@@ -14,8 +14,8 @@
 # $FreeBSD$
 
 include"AR71XX_BASE"
-ident  "DIR-825"
-hints  "DIR-825.hints"
+ident  "DIR-825B1"
+hints  "DIR-825B1.hints"
 
 # Since the kernel image must fit inside 1024KiB, we have to build almost
 # everything as modules.

Modified: head/sys/mips/conf/DIR-825B1.hints
==
--- head/sys/mips/conf/DIR-825B1.hints  Wed Mar  5 04:18:42 2014
(r262776)
+++ head/sys/mips/conf/DIR-825B1.hints  Wed Mar  5 04:19:52 2014
(r262777)
@@ -32,7 +32,7 @@ hint.ath.1.eeprom_firmware="pcib.0.bus.0
 
 # Geom MAP
 
-# The DIR-825 has an 8MB flash part - HOWEVER, the 64k caldata isn't
+# The DIR-825B1 has an 8MB flash part - HOWEVER, the 64k caldata isn't
 # at the end of the flash. It's ~ 6MB into the flash image.
 
 # 
mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata)
___
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: r262778 - head/sys/mips/conf

2014-03-04 Thread Sean Bruno
Author: sbruno
Date: Wed Mar  5 04:22:07 2014
New Revision: 262778
URL: http://svnweb.freebsd.org/changeset/base/262778

Log:
  Populate the GPIO pins and GPIOLED configs

Modified:
  head/sys/mips/conf/DIR-825B1.hints

Modified: head/sys/mips/conf/DIR-825B1.hints
==
--- head/sys/mips/conf/DIR-825B1.hints  Wed Mar  5 04:19:52 2014
(r262777)
+++ head/sys/mips/conf/DIR-825B1.hints  Wed Mar  5 04:22:07 2014
(r262778)
@@ -28,14 +28,13 @@ hint.pcib.0.bus.0.18.0.ath_fixup_size=40
 hint.ath.0.eeprom_firmware="pcib.0.bus.0.17.0.eeprom_firmware"
 hint.ath.1.eeprom_firmware="pcib.0.bus.0.18.0.eeprom_firmware"
 
-# TODO: gpio LEDs
-
 # Geom MAP
 
 # The DIR-825B1 has an 8MB flash part - HOWEVER, the 64k caldata isn't
 # at the end of the flash. It's ~ 6MB into the flash image.
 
-# 
mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),64k(caldata)
+# mtdparts=ar7100-nor0:256k(uboot),64k(Config),1024k(vmlinux),5184k(rootfs),
+#  64k(caldata)
 
 hint.map.0.at="flash/spi0"
 hint.map.0.start=0x
@@ -69,3 +68,73 @@ hint.map.4.end=0x0067
 hint.map.4.name="art"
 hint.map.4.readonly=1
 
+# GPIO specific configuration block
+
+# Don't flip on anything that isn't already enabled.
+# This includes leaving the SPI CS1/CS2 pins as GPIO pins as they're
+# not used here.
+hint.gpio.0.function_set=0x
+
+hint.gpio.0.function_clear=0x
+
+# These are the GPIO LEDs and buttons which can be software controlled.
+hint.gpio.0.pinmask=0x09ff
+
+# Pin 1  - USB (LED blue) --> works
+# Pin 2  - Power (LED orange) --> works
+# Pin 3  - Power (LED blue)   --> works
+# Pin 4  - Button (RESET) --> works
+# Pin 5  - WPS (LED blue) --> works
+# Pin 6  - RTL8366RB switch data line
+# Pin 7  - Planet (LED orange)--> works
+# Pin 8  - RTL8366RB switch clock line
+# Pin 9  - Button (WPS)   --> works after set to high
+# Pin 10 - N/C
+# Pin 11 - N/C
+# Pin 12 - Planet (LED blue)  --> works
+
+# LEDs are configured separately and driven by the LED device
+# usb tested good
+hint.gpioled.0.at="gpiobus0"
+hint.gpioled.0.name="usb-blue"
+hint.gpioled.0.pins=0x0001
+
+# no orange power led?
+hint.gpioled.1.at="gpiobus0"
+hint.gpioled.1.name="power-orange"
+hint.gpioled.1.pins=0x0002
+
+# blue power tested good
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.name="power-blue"
+hint.gpioled.2.pins=0x0004
+
+# wps tested good
+hint.gpioled.3.at="gpiobus0"
+hint.gpioled.3.name="wps-blue"
+hint.gpioled.3.pins=0x0010
+
+# orage globe tested good
+hint.gpioled.4.at="gpiobus0"
+hint.gpioled.4.name="planet-orange"
+hint.gpioled.4.pins=0x0040
+
+# no blue planet LED on this unit
+hint.gpioled.5.at="gpiobus0"
+hint.gpioled.5.name="planet-blue"
+hint.gpioled.5.pins=0x0800
+
+# GPIO I2C bus
+hint.gpioiic.0.at="gpiobus0"
+hint.gpioiic.0.pins=0x00a0
+hint.gpioiic.0.sda=0
+hint.gpioiic.0.scl=1
+
+# I2C bus
+# Don't be strict about I2C protocol - the relaxed semantics are required
+# by the realtek switch PHY.
+hint.iicbus.0.strict=0
+
+# Bit bang bus - override default delay
+#hint.iicbb.0.udelay=3
+
___
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: r262780 - in stable/9/sys/ufs: ffs ufs

2014-03-04 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Mar  5 04:27:15 2014
New Revision: 262780
URL: http://svnweb.freebsd.org/changeset/base/262780

Log:
  MFC   r262678;
  ufs: small formatting fixes.
  
  Cleanup some extra space.
  Use of tabs vs. spaces.
  No functional change.
  
  Reviewed by:  mckusick

Modified:
  stable/9/sys/ufs/ffs/ffs_alloc.c
  stable/9/sys/ufs/ffs/ffs_balloc.c
  stable/9/sys/ufs/ffs/ffs_extern.h
  stable/9/sys/ufs/ffs/ffs_snapshot.c
  stable/9/sys/ufs/ffs/ffs_softdep.c
  stable/9/sys/ufs/ffs/ffs_vfsops.c
  stable/9/sys/ufs/ffs/ffs_vnops.c
  stable/9/sys/ufs/ffs/fs.h
  stable/9/sys/ufs/ffs/softdep.h
  stable/9/sys/ufs/ufs/dir.h
  stable/9/sys/ufs/ufs/dirhash.h
  stable/9/sys/ufs/ufs/extattr.h
  stable/9/sys/ufs/ufs/gjournal.h
  stable/9/sys/ufs/ufs/inode.h
  stable/9/sys/ufs/ufs/quota.h
  stable/9/sys/ufs/ufs/ufs_extern.h
  stable/9/sys/ufs/ufs/ufsmount.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ufs/ffs/ffs_alloc.c
==
--- stable/9/sys/ufs/ffs/ffs_alloc.cWed Mar  5 04:23:19 2014
(r262779)
+++ stable/9/sys/ufs/ffs/ffs_alloc.cWed Mar  5 04:27:15 2014
(r262780)
@@ -1181,14 +1181,14 @@ ffs_dirpref(pip)
for (cg = prefcg; cg < fs->fs_ncg; cg++)
if (fs->fs_cs(fs, cg).cs_ndir < maxndir &&
fs->fs_cs(fs, cg).cs_nifree >= minifree &&
-   fs->fs_cs(fs, cg).cs_nbfree >= minbfree) {
+   fs->fs_cs(fs, cg).cs_nbfree >= minbfree) {
if (fs->fs_contigdirs[cg] < maxcontigdirs)
return ((ino_t)(fs->fs_ipg * cg));
}
for (cg = 0; cg < prefcg; cg++)
if (fs->fs_cs(fs, cg).cs_ndir < maxndir &&
fs->fs_cs(fs, cg).cs_nifree >= minifree &&
-   fs->fs_cs(fs, cg).cs_nbfree >= minbfree) {
+   fs->fs_cs(fs, cg).cs_nbfree >= minbfree) {
if (fs->fs_contigdirs[cg] < maxcontigdirs)
return ((ino_t)(fs->fs_ipg * cg));
}

Modified: stable/9/sys/ufs/ffs/ffs_balloc.c
==
--- stable/9/sys/ufs/ffs/ffs_balloc.c   Wed Mar  5 04:23:19 2014
(r262779)
+++ stable/9/sys/ufs/ffs/ffs_balloc.c   Wed Mar  5 04:27:15 2014
(r262780)
@@ -248,7 +248,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t 
UFS_LOCK(ump);
pref = ffs_blkpref_ufs1(ip, lbn, -indirs[0].in_off - 1,
(ufs1_daddr_t *)0);
-   if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
+   if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
flags, cred, &newb)) != 0) {
curthread_pflags_restore(saved_inbdflush);
return (error);
@@ -809,7 +809,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t 
UFS_LOCK(ump);
pref = ffs_blkpref_ufs2(ip, lbn, -indirs[0].in_off - 1,
(ufs2_daddr_t *)0);
-   if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
+   if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
flags, cred, &newb)) != 0) {
curthread_pflags_restore(saved_inbdflush);
return (error);

Modified: stable/9/sys/ufs/ffs/ffs_extern.h
==
--- stable/9/sys/ufs/ffs/ffs_extern.h   Wed Mar  5 04:23:19 2014
(r262779)
+++ stable/9/sys/ufs/ffs/ffs_extern.h   Wed Mar  5 04:27:15 2014
(r262780)
@@ -167,10 +167,10 @@ void  softdep_freework(struct workhead *)
 /*
  * Things to request flushing in softdep_request_cleanup()
  */
-#define FLUSH_INODES   1
-#define FLUSH_INODES_WAIT  2
-#define FLUSH_BLOCKS   3
-#define FLUSH_BLOCKS_WAIT  4
+#defineFLUSH_INODES1
+#defineFLUSH_INODES_WAIT   2
+#defineFLUSH_BLOCKS3
+#defineFLUSH_BLOCKS_WAIT   4
 /*
  * Flag to ffs_syncvnode() to request flushing of data only,
  * but skip the ffs_update() on the inode itself. Used to avoid

Modified: stable/9/sys/ufs/ffs/ffs_snapshot.c
==
--- stable/9/sys/ufs/ffs/ffs_snapshot.c Wed Mar  5 04:23:19 2014
(r262779)
+++ stable/9/sys/ufs/ffs/ffs_snapshot.c Wed Mar  5 04:27:15 2014
(r262780)
@@ -2640,7 +2640,7 @@ ffs_snapdata_acquire(struct vnode *devvp
struct snapdata *sn;
 
/*
-* Allocate a free snapdata.  This is done before acquiring the
+* Allocate a free snapdata.  This is done before acquiring the
 * devvp lock to avoid allocation while the devvp interlock is
 * held.
 */

Modified: stable/9/sys/ufs/ffs/ffs_softdep.c
===

svn commit: r262779 - in stable/10/sys/ufs: ffs ufs

2014-03-04 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Mar  5 04:23:19 2014
New Revision: 262779
URL: http://svnweb.freebsd.org/changeset/base/262779

Log:
  MFC   r262678;
  ufs: small formatting fixes.
  
  Cleanup some extra space.
  Use of tabs vs. spaces.
  No functional change.
  
  Reviewed by:  mckusick

Modified:
  stable/10/sys/ufs/ffs/ffs_alloc.c
  stable/10/sys/ufs/ffs/ffs_balloc.c
  stable/10/sys/ufs/ffs/ffs_extern.h
  stable/10/sys/ufs/ffs/ffs_snapshot.c
  stable/10/sys/ufs/ffs/ffs_softdep.c
  stable/10/sys/ufs/ffs/ffs_vfsops.c
  stable/10/sys/ufs/ffs/ffs_vnops.c
  stable/10/sys/ufs/ffs/fs.h
  stable/10/sys/ufs/ffs/softdep.h
  stable/10/sys/ufs/ufs/dir.h
  stable/10/sys/ufs/ufs/dirhash.h
  stable/10/sys/ufs/ufs/extattr.h
  stable/10/sys/ufs/ufs/gjournal.h
  stable/10/sys/ufs/ufs/inode.h
  stable/10/sys/ufs/ufs/quota.h
  stable/10/sys/ufs/ufs/ufs_extern.h
  stable/10/sys/ufs/ufs/ufsmount.h

Modified: stable/10/sys/ufs/ffs/ffs_alloc.c
==
--- stable/10/sys/ufs/ffs/ffs_alloc.c   Wed Mar  5 04:22:07 2014
(r262778)
+++ stable/10/sys/ufs/ffs/ffs_alloc.c   Wed Mar  5 04:23:19 2014
(r262779)
@@ -1182,14 +1182,14 @@ ffs_dirpref(pip)
for (cg = prefcg; cg < fs->fs_ncg; cg++)
if (fs->fs_cs(fs, cg).cs_ndir < maxndir &&
fs->fs_cs(fs, cg).cs_nifree >= minifree &&
-   fs->fs_cs(fs, cg).cs_nbfree >= minbfree) {
+   fs->fs_cs(fs, cg).cs_nbfree >= minbfree) {
if (fs->fs_contigdirs[cg] < maxcontigdirs)
return ((ino_t)(fs->fs_ipg * cg));
}
for (cg = 0; cg < prefcg; cg++)
if (fs->fs_cs(fs, cg).cs_ndir < maxndir &&
fs->fs_cs(fs, cg).cs_nifree >= minifree &&
-   fs->fs_cs(fs, cg).cs_nbfree >= minbfree) {
+   fs->fs_cs(fs, cg).cs_nbfree >= minbfree) {
if (fs->fs_contigdirs[cg] < maxcontigdirs)
return ((ino_t)(fs->fs_ipg * cg));
}

Modified: stable/10/sys/ufs/ffs/ffs_balloc.c
==
--- stable/10/sys/ufs/ffs/ffs_balloc.c  Wed Mar  5 04:22:07 2014
(r262778)
+++ stable/10/sys/ufs/ffs/ffs_balloc.c  Wed Mar  5 04:23:19 2014
(r262779)
@@ -248,7 +248,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t 
UFS_LOCK(ump);
pref = ffs_blkpref_ufs1(ip, lbn, -indirs[0].in_off - 1,
(ufs1_daddr_t *)0);
-   if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
+   if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
flags, cred, &newb)) != 0) {
curthread_pflags_restore(saved_inbdflush);
return (error);
@@ -809,7 +809,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t 
UFS_LOCK(ump);
pref = ffs_blkpref_ufs2(ip, lbn, -indirs[0].in_off - 1,
(ufs2_daddr_t *)0);
-   if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
+   if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize,
flags, cred, &newb)) != 0) {
curthread_pflags_restore(saved_inbdflush);
return (error);

Modified: stable/10/sys/ufs/ffs/ffs_extern.h
==
--- stable/10/sys/ufs/ffs/ffs_extern.h  Wed Mar  5 04:22:07 2014
(r262778)
+++ stable/10/sys/ufs/ffs/ffs_extern.h  Wed Mar  5 04:23:19 2014
(r262779)
@@ -165,10 +165,10 @@ void  softdep_freework(struct workhead *)
 /*
  * Things to request flushing in softdep_request_cleanup()
  */
-#define FLUSH_INODES   1
-#define FLUSH_INODES_WAIT  2
-#define FLUSH_BLOCKS   3
-#define FLUSH_BLOCKS_WAIT  4
+#defineFLUSH_INODES1
+#defineFLUSH_INODES_WAIT   2
+#defineFLUSH_BLOCKS3
+#defineFLUSH_BLOCKS_WAIT   4
 /*
  * Flag to ffs_syncvnode() to request flushing of data only,
  * but skip the ffs_update() on the inode itself. Used to avoid

Modified: stable/10/sys/ufs/ffs/ffs_snapshot.c
==
--- stable/10/sys/ufs/ffs/ffs_snapshot.cWed Mar  5 04:22:07 2014
(r262778)
+++ stable/10/sys/ufs/ffs/ffs_snapshot.cWed Mar  5 04:23:19 2014
(r262779)
@@ -2642,7 +2642,7 @@ ffs_snapdata_acquire(struct vnode *devvp
struct snapdata *sn;
 
/*
-* Allocate a free snapdata.  This is done before acquiring the
+* Allocate a free snapdata.  This is done before acquiring the
 * devvp lock to avoid allocation while the devvp interlock is
 * held.
 */

Modified: stable/10/sys/ufs/ffs/ffs_softdep.c
=