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

2015-07-03 Thread Adrian Chadd
Author: adrian
Date: Fri Jul  3 07:00:24 2015
New Revision: 285083
URL: https://svnweb.freebsd.org/changeset/base/285083

Log:
  Oops - fix typo.

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

Modified: head/sys/mips/atheros/qca955xreg.h
==
--- head/sys/mips/atheros/qca955xreg.h  Fri Jul  3 06:15:54 2015
(r285082)
+++ head/sys/mips/atheros/qca955xreg.h  Fri Jul  3 07:00:24 2015
(r285083)
@@ -212,9 +212,9 @@
 #defineQCA955X_DDR_REG_FLUSH_PCIE  (AR71XX_APB_BASE + 0xa8)
 #defineQCA955X_DDR_REG_FLUSH_WMAC  (AR71XX_APB_BASE + 0xac)
 /* PCIe EP */
-#defineQCA955X_DDR_REG_FLUSH_SRC1  (AR71XX_APB_BSAE + 0xb0)
+#defineQCA955X_DDR_REG_FLUSH_SRC1  (AR71XX_APB_BASE + 0xb0)
 /* checksum engine */
-#defineQCA955X_DDR_REG_FLUSH_SRC2  (AR71XX_APB_BSAE + 0xb2)
+#defineQCA955X_DDR_REG_FLUSH_SRC2  (AR71XX_APB_BASE + 0xb2)
 
 /* PCIe control block - relative to PCI_CTRL_BASE0/PCI_CTRL_BASE1 */
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285084 - head/sys/netinet6

2015-07-03 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Jul  3 09:53:56 2015
New Revision: 285084
URL: https://svnweb.freebsd.org/changeset/base/285084

Log:
  Move comment to the right position.
  
  PR:   152791
  Submitted by: vangyzen (as part of the functional change)
  MFC after:3 days

Modified:
  head/sys/netinet6/icmp6.c

Modified: head/sys/netinet6/icmp6.c
==
--- head/sys/netinet6/icmp6.c   Fri Jul  3 07:00:24 2015(r285083)
+++ head/sys/netinet6/icmp6.c   Fri Jul  3 09:53:56 2015(r285084)
@@ -2404,7 +2404,6 @@ icmp6_redirect_input(struct mbuf *m, int
icmp6_redirect_diag(&src6, &reddst6, &redtgt6)));
goto bad;
}
-   /* validation passed */
 
icmp6len -= sizeof(*nd_rd);
nd6_option_init(nd_rd + 1, icmp6len, &ndopts);
@@ -2429,6 +2428,8 @@ icmp6_redirect_input(struct mbuf *m, int
goto bad;
}
 
+   /* Validation passed. */
+
/* RFC 2461 8.3 */
nd6_cache_lladdr(ifp, &redtgt6, lladdr, lladdrlen, ND_REDIRECT,
is_onlink ? ND_REDIRECT_ONLINK : ND_REDIRECT_ROUTER);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285085 - head/usr.sbin/ctladm

2015-07-03 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jul  3 10:04:41 2015
New Revision: 285085
URL: https://svnweb.freebsd.org/changeset/base/285085

Log:
  User proper terminology - iSCSI sessions, not iSCSI connections.
  
  Sponsored by: The FreeBSD Foundation

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

Modified: head/usr.sbin/ctladm/ctladm.8
==
--- head/usr.sbin/ctladm/ctladm.8   Fri Jul  3 09:53:56 2015
(r285084)
+++ head/usr.sbin/ctladm/ctladm.8   Fri Jul  3 10:04:41 2015
(r285085)
@@ -34,7 +34,7 @@
 .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $
 .\" $FreeBSD$
 .\"
-.Dd May 22, 2015
+.Dd June 3, 2015
 .Dt CTLADM 8
 .Os
 .Sh NAME
@@ -951,21 +951,21 @@ If you specify
 the entire LUN database is displayed in XML format.
 .El
 .It Ic islist
-Get a list of currently running iSCSI connections.
+Get a list of currently running iSCSI sessions.
 This includes initiator and target names and the unique connection IDs.
 .Bl -tag -width 11n
 .It Fl v
 Verbose mode.
 .It Fl x
 Dump the raw XML.
-The connections list information from the kernel comes in XML format, and this
+The sessions list information from the kernel comes in XML format, and this
 option allows the display of the raw XML data.
 .El
 .It Ic islogout
-Ask the initiator to log out iSCSI connections matching criteria.
+Ask the initiator to log out iSCSI sessions matching criteria.
 .Bl -tag -width 11n
 .It Fl a
-Log out all connections.
+Log out all sessions.
 .It Fl c
 Specify connection ID.
 .It Fl i
@@ -974,10 +974,10 @@ Specify initiator name.
 Specify initiator portal (hostname or IP address).
 .El
 .It Ic isterminate
-Forcibly terminate iSCSI connections matching criteria.
+Forcibly terminate iSCSI sessions matching criteria.
 .Bl -tag -width 11n
 .It Fl a
-Terminate all connections.
+Terminate all sessions.
 .It Fl c
 Specify connection ID.
 .It Fl i
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285086 - in head/usr.sbin: ctld iscsid

2015-07-03 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jul  3 10:08:10 2015
New Revision: 285086
URL: https://svnweb.freebsd.org/changeset/base/285086

Log:
  Remove OpenSSL dependency from iscsid(8) and ctld(8).
  
  Differential Revision:https://reviews.freebsd.org/D2866
  Submitted by: Tony Morlan  (earlier version)
  Reviewed by:  bapt@, delphij@
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/ctld/Makefile
  head/usr.sbin/ctld/chap.c
  head/usr.sbin/ctld/ctld.h
  head/usr.sbin/iscsid/Makefile
  head/usr.sbin/iscsid/chap.c
  head/usr.sbin/iscsid/iscsid.h

Modified: head/usr.sbin/ctld/Makefile
==
--- head/usr.sbin/ctld/Makefile Fri Jul  3 10:04:41 2015(r285085)
+++ head/usr.sbin/ctld/Makefile Fri Jul  3 10:08:10 2015(r285086)
@@ -10,7 +10,7 @@ CFLAGS+=  -I${.CURDIR}/../../sys/dev/iscs
 #CFLAGS+=  -DICL_KERNEL_PROXY
 MAN=   ctld.8 ctl.conf.5
 
-LIBADD=bsdxml crypto l sbuf util
+LIBADD=bsdxml l md sbuf util
 
 YFLAGS+=   -v
 CLEANFILES=y.tab.c y.tab.h y.output

Modified: head/usr.sbin/ctld/chap.c
==
--- head/usr.sbin/ctld/chap.c   Fri Jul  3 10:04:41 2015(r285085)
+++ head/usr.sbin/ctld/chap.c   Fri Jul  3 10:08:10 2015(r285086)
@@ -32,12 +32,11 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
 
 #include "ctld.h"
 
@@ -47,17 +46,14 @@ chap_compute_md5(const char id, const ch
 size_t response_len)
 {
MD5_CTX ctx;
-   int rv;
 
-   assert(response_len == MD5_DIGEST_LENGTH);
+   assert(response_len == CHAP_DIGEST_LEN);
 
-   MD5_Init(&ctx);
-   MD5_Update(&ctx, &id, sizeof(id));
-   MD5_Update(&ctx, secret, strlen(secret));
-   MD5_Update(&ctx, challenge, challenge_len);
-   rv = MD5_Final(response, &ctx);
-   if (rv != 1)
-   log_errx(1, "MD5_Final");
+   MD5Init(&ctx);
+   MD5Update(&ctx, &id, sizeof(id));
+   MD5Update(&ctx, secret, strlen(secret));
+   MD5Update(&ctx, challenge, challenge_len);
+   MD5Final(response, &ctx);
 }
 
 static int
@@ -235,7 +231,6 @@ struct chap *
 chap_new(void)
 {
struct chap *chap;
-   int rv;
 
chap = calloc(sizeof(*chap), 1);
if (chap == NULL)
@@ -244,16 +239,8 @@ chap_new(void)
/*
 * Generate the challenge.
 */
-   rv = RAND_bytes(chap->chap_challenge, sizeof(chap->chap_challenge));
-   if (rv != 1) {
-   log_errx(1, "RAND_bytes failed: %s",
-   ERR_error_string(ERR_get_error(), NULL));
-   }
-   rv = RAND_bytes(&chap->chap_id, sizeof(chap->chap_id));
-   if (rv != 1) {
-   log_errx(1, "RAND_bytes failed: %s",
-   ERR_error_string(ERR_get_error(), NULL));
-   }
+   arc4random_buf(chap->chap_challenge, sizeof(chap->chap_challenge));
+   arc4random_buf(&chap->chap_id, sizeof(chap->chap_id));
 
return (chap);
 }
@@ -320,7 +307,7 @@ chap_receive(struct chap *chap, const ch
 int
 chap_authenticate(struct chap *chap, const char *secret)
 {
-   char expected_response[MD5_DIGEST_LENGTH];
+   char expected_response[CHAP_DIGEST_LEN];
 
chap_compute_md5(chap->chap_id, secret,
chap->chap_challenge, sizeof(chap->chap_challenge),
@@ -397,7 +384,7 @@ rchap_get_response_bin(struct rchap *rch
 void **responsep, size_t *response_lenp)
 {
void *response_bin;
-   size_t response_bin_len = MD5_DIGEST_LENGTH;
+   size_t response_bin_len = CHAP_DIGEST_LEN;
 
response_bin = calloc(response_bin_len, 1);
if (response_bin == NULL)

Modified: head/usr.sbin/ctld/ctld.h
==
--- head/usr.sbin/ctld/ctld.h   Fri Jul  3 10:04:41 2015(r285085)
+++ head/usr.sbin/ctld/ctld.h   Fri Jul  3 10:08:10 2015(r285086)
@@ -39,7 +39,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #defineDEFAULT_CONFIG_PATH "/etc/ctl.conf"
 #defineDEFAULT_PIDFILE "/var/run/ctld.pid"
@@ -263,11 +262,12 @@ struct keys {
 };
 
 #defineCHAP_CHALLENGE_LEN  1024
+#defineCHAP_DIGEST_LEN 16 /* Equal to MD5 digest size. */
 
 struct chap {
unsigned char   chap_id;
charchap_challenge[CHAP_CHALLENGE_LEN];
-   charchap_response[MD5_DIGEST_LENGTH];
+   charchap_response[CHAP_DIGEST_LEN];
 };
 
 struct rchap {

Modified: head/usr.sbin/iscsid/Makefile
==
--- head/usr.sbin/iscsid/Makefile   Fri Jul  3 10:04:41 2015
(r285085)
+++ head/usr.sbin/iscsid/Makefile   Fri Jul  3 10:08:10 2015
(r285086)
@@ -8,7 +8,7 @@ C

svn commit: r285088 - head/sys/ofed/include/linux

2015-07-03 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jul  3 11:16:20 2015
New Revision: 285088
URL: https://svnweb.freebsd.org/changeset/base/285088

Log:
  Fix broken implementation of "kvasprintf()" function by adding missing
  kmalloc() call. Make function global instead of static inline to fix
  compiler warnings about passing variable argument lists to inline
  functions.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/include/linux/device.h
  head/sys/ofed/include/linux/linux_compat.c

Modified: head/sys/ofed/include/linux/device.h
==
--- head/sys/ofed/include/linux/device.hFri Jul  3 11:02:20 2015
(r285087)
+++ head/sys/ofed/include/linux/device.hFri Jul  3 11:16:20 2015
(r285088)
@@ -416,21 +416,7 @@ static inline int dev_to_node(struct dev
 return -1;
 }
 
-static inline char *kvasprintf(gfp_t gfp, const char *fmt, va_list ap)
-{
-   unsigned int len;
-   char *p = NULL;
-   va_list aq;
-
-   va_copy(aq, ap);
-   len = vsnprintf(NULL, 0, fmt, aq);
-   va_end(aq);
-
-   vsnprintf(p, len+1, fmt, ap);
-
-   return p;
-}
-
+char *kvasprintf(gfp_t, const char *, va_list);
 char *kasprintf(gfp_t, const char *, ...);
 
 #endif /* _LINUX_DEVICE_H_ */

Modified: head/sys/ofed/include/linux/linux_compat.c
==
--- head/sys/ofed/include/linux/linux_compat.c  Fri Jul  3 11:02:20 2015
(r285087)
+++ head/sys/ofed/include/linux/linux_compat.c  Fri Jul  3 11:16:20 2015
(r285088)
@@ -715,6 +715,23 @@ vunmap(void *addr)
kfree(vmmap);
 }
 
+char *
+kvasprintf(gfp_t gfp, const char *fmt, va_list ap)
+{
+   unsigned int len;
+   char *p;
+   va_list aq;
+
+   va_copy(aq, ap);
+   len = vsnprintf(NULL, 0, fmt, aq);
+   va_end(aq);
+
+   p = kmalloc(len + 1, gfp);
+   if (p != NULL)
+   vsnprintf(p, len + 1, fmt, ap);
+
+   return (p);
+}
 
 char *
 kasprintf(gfp_t gfp, const char *fmt, ...)
@@ -726,7 +743,7 @@ kasprintf(gfp_t gfp, const char *fmt, ..
p = kvasprintf(gfp, fmt, ap);
va_end(ap);
 
-   return p;
+   return (p);
 }
 
 static int
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285089 - head/sys/dev/xen/netfront

2015-07-03 Thread Roger Pau Monné
Author: royger
Date: Fri Jul  3 12:09:05 2015
New Revision: 285089
URL: https://svnweb.freebsd.org/changeset/base/285089

Log:
  netfront: preserve configuration across migrations
  
  Try to preserve the xn configuration when migrating. This is not always
  possible since the backend might not have the same set of options
  available, in which case we will try to preserve as many as possible.
  
  MFC after:2 weeks
  PR:   183139
  Reported by:  mcdou...@egr.msu.edu
  Sponsored by: Citrix Systems R&D

Modified:
  head/sys/dev/xen/netfront/netfront.c

Modified: head/sys/dev/xen/netfront/netfront.c
==
--- head/sys/dev/xen/netfront/netfront.cFri Jul  3 11:16:20 2015
(r285088)
+++ head/sys/dev/xen/netfront/netfront.cFri Jul  3 12:09:05 2015
(r285089)
@@ -285,6 +285,8 @@ struct netfront_info {
multicall_entry_t   rx_mcl[NET_RX_RING_SIZE+1];
mmu_update_trx_mmu[NET_RX_RING_SIZE];
struct ifmedia  sc_media;
+
+   boolxn_resume;
 };
 
 #define rx_mbufs xn_cdata.xn_rx_chain
@@ -500,6 +502,7 @@ netfront_resume(device_t dev)
 {
struct netfront_info *info = device_get_softc(dev);
 
+   info->xn_resume = true;
netif_disconnect_backend(info);
return (0);
 }
@@ -1982,18 +1985,33 @@ xn_query_features(struct netfront_info *
 static int
 xn_configure_features(struct netfront_info *np)
 {
-   int err;
+   int err, cap_enabled;
 
err = 0;
+
+   if (np->xn_resume &&
+   ((np->xn_ifp->if_capenable & np->xn_ifp->if_capabilities)
+   == np->xn_ifp->if_capenable)) {
+   /* Current options are available, no need to do anything. */
+   return (0);
+   }
+
+   /* Try to preserve as many options as possible. */
+   if (np->xn_resume)
+   cap_enabled = np->xn_ifp->if_capenable;
+   else
+   cap_enabled = UINT_MAX;
+
 #if __FreeBSD_version >= 70 && (defined(INET) || defined(INET6))
-   if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0)
+   if ((np->xn_ifp->if_capenable & IFCAP_LRO) == (cap_enabled & IFCAP_LRO))
tcp_lro_free(&np->xn_lro);
 #endif
np->xn_ifp->if_capenable =
-   np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4);
+   np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4) & cap_enabled;
np->xn_ifp->if_hwassist &= ~CSUM_TSO;
 #if __FreeBSD_version >= 70 && (defined(INET) || defined(INET6))
-   if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) {
+   if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) ==
+   (cap_enabled & IFCAP_LRO)) {
err = tcp_lro_init(&np->xn_lro);
if (err) {
device_printf(np->xbdev, "LRO initialization failed\n");
@@ -2002,7 +2020,8 @@ xn_configure_features(struct netfront_in
np->xn_ifp->if_capenable |= IFCAP_LRO;
}
}
-   if ((np->xn_ifp->if_capabilities & IFCAP_TSO4) != 0) {
+   if ((np->xn_ifp->if_capabilities & IFCAP_TSO4) ==
+   (cap_enabled & IFCAP_TSO4)) {
np->xn_ifp->if_capenable |= IFCAP_TSO4;
np->xn_ifp->if_hwassist |= CSUM_TSO;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285090 - in head/sys: arm/allwinner arm/conf boot/fdt/dts/arm dev/ahci

2015-07-03 Thread Luiz Otavio O Souza
Author: loos
Date: Fri Jul  3 14:11:01 2015
New Revision: 285090
URL: https://svnweb.freebsd.org/changeset/base/285090

Log:
  Add AHCI attachment code for Allwinner A10/A20 SoCs.
  
  The Allwinner SoC has an AHCI device on its internal main bus rather
  than the PCI bus.  This SoC is somewhat underdocumented, and its SATA
  controller is no exception.  The methods to support this chip were
  harvested from the Linux Allwinner SDK, and then constants invented to
  describe what's going on based on low-level constants contained in the
  SATA standard and guess work.
  
  This SoC requires a specific AHCI channel setup in order to start the
  operations on the channel properly.
  
  Clock setup and AHCI channel setup idea came from NetBSD.
  
  Tested on Cubieboard 2 and Banana pi (and attachment on Cubieboard by
  Pratik Singhal).
  
  Differential Revision:https://reviews.freebsd.org/D737
  Submitted by: imp
  Reviewed by:  imp, ganbold, mav, andrew

Added:
  head/sys/arm/allwinner/a10_ahci.c   (contents, props changed)
Modified:
  head/sys/arm/allwinner/a10_clk.c
  head/sys/arm/allwinner/a10_clk.h
  head/sys/arm/allwinner/files.allwinner
  head/sys/arm/conf/CUBIEBOARD
  head/sys/arm/conf/CUBIEBOARD2
  head/sys/boot/fdt/dts/arm/cubieboard.dts
  head/sys/boot/fdt/dts/arm/sun4i-a10.dtsi
  head/sys/boot/fdt/dts/arm/sun7i-a20.dtsi
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ahci/ahci.h

Added: head/sys/arm/allwinner/a10_ahci.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/allwinner/a10_ahci.c   Fri Jul  3 14:11:01 2015
(r285090)
@@ -0,0 +1,382 @@
+/*-
+ * Copyright (c) 2014-2015 M. Warner Losh 
+ * Copyright (c) 2015 Luiz Otavio O Souza 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * The magic-bit-bang sequence used in this code may be based on a linux
+ * platform driver in the Allwinner SDK from Allwinner Technology Co., Ltd.
+ * www.allwinnertech.com, by Daniel Wang 
+ * though none of the original code was copied.
+ */
+
+#include "opt_bus.h"
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include  
+#include 
+
+#include 
+#include 
+#include "gpio_if.h"
+
+/*
+ * Allwinner a1x/a2x/a8x SATA attachment.  This is just the AHCI register
+ * set with a few extra implementation-specific registers that need to
+ * be accounted for.  There's only one PHY in the system, and it needs
+ * to be trained to bring the link up.  In addition, there's some DMA
+ * specific things that need to be done as well.  These things are also
+ * just about completely undocumented, except in ugly code in the Linux
+ * SDK Allwinner releases.
+ */
+
+/* BITx -- Unknown bit that needs to be set/cleared at position x */
+/* UFx -- Uknown multi-bit field frobbed during init */
+#defineAHCI_BISTAFR0x00A0
+#defineAHCI_BISTCR 0x00A4
+#defineAHCI_BISTFCTR   0x00A8
+#defineAHCI_BISTSR 0x00AC
+#defineAHCI_BISTDECR   0x00B0
+#defineAHCI_DIAGNR 0x00B4
+#defineAHCI_DIAGNR10x00B8
+#defineAHCI_OOBR   0x00BC
+#defineAHCI_PHYCS0R0x00C0
+/* Bits 0..17 are a mystery */
+#define PHYCS0R_BIT18  (1 << 18)
+#define PHYCS0R_POWER_ENABLE   (1 << 19)
+#define PHYCS0R_UF1_MASK   (7 << 20)   /* Unknown 
Field 1 */
+#define  PHYCS0R_UF1_INIT  (3 << 20)
+#define PHYCS0R_BIT23  (1 << 23)
+#define PHYCS0R_UF2_MASK   (7 << 24)   /* Uknown Field 
2 */
+#de

svn commit: r285091 - head/sys/dev/virtio/mmio

2015-07-03 Thread Ruslan Bukin
Author: br
Date: Fri Jul  3 14:13:16 2015
New Revision: 285091
URL: https://svnweb.freebsd.org/changeset/base/285091

Log:
  Add 'prewrite' method allowing us to run some platform-specific
  code before each write happens, e.g. write-back caches.
  This will help booting in Bluespec simulator of CHERI processor.

Modified:
  head/sys/dev/virtio/mmio/virtio_mmio.c
  head/sys/dev/virtio/mmio/virtio_mmio_if.m

Modified: head/sys/dev/virtio/mmio/virtio_mmio.c
==
--- head/sys/dev/virtio/mmio/virtio_mmio.c  Fri Jul  3 14:11:01 2015
(r285090)
+++ head/sys/dev/virtio/mmio/virtio_mmio.c  Fri Jul  3 14:13:16 2015
(r285091)
@@ -138,18 +138,24 @@ static void   vtmmio_vq_intr(void *);
  */
 #define vtmmio_write_config_1(sc, o, v)\
 do {   \
+   if (sc->platform != NULL)   \
+   VIRTIO_MMIO_PREWRITE(sc->platform, (o), (v));   \
bus_write_1((sc)->res[0], (o), (v));\
if (sc->platform != NULL)   \
VIRTIO_MMIO_NOTE(sc->platform, (o), (v));   \
 } while (0)
 #define vtmmio_write_config_2(sc, o, v)\
 do {   \
+   if (sc->platform != NULL)   \
+   VIRTIO_MMIO_PREWRITE(sc->platform, (o), (v));   \
bus_write_2((sc)->res[0], (o), (v));\
if (sc->platform != NULL)   \
VIRTIO_MMIO_NOTE(sc->platform, (o), (v));   \
 } while (0)
 #define vtmmio_write_config_4(sc, o, v)\
 do {   \
+   if (sc->platform != NULL)   \
+   VIRTIO_MMIO_PREWRITE(sc->platform, (o), (v));   \
bus_write_4((sc)->res[0], (o), (v));\
if (sc->platform != NULL)   \
VIRTIO_MMIO_NOTE(sc->platform, (o), (v));   \

Modified: head/sys/dev/virtio/mmio/virtio_mmio_if.m
==
--- head/sys/dev/virtio/mmio/virtio_mmio_if.m   Fri Jul  3 14:11:01 2015
(r285090)
+++ head/sys/dev/virtio/mmio/virtio_mmio_if.m   Fri Jul  3 14:13:16 2015
(r285091)
@@ -42,6 +42,13 @@ INTERFACE virtio_mmio;
 
 CODE {
static int
+   virtio_mmio_prewrite(device_t dev, size_t offset, int val)
+   {
+
+   return (1);
+   }
+
+   static int
virtio_mmio_note(device_t dev, size_t offset, int val)
{
 
@@ -58,6 +65,15 @@ CODE {
 };
 
 #
+# Inform backend we are going to write data at offset.
+#
+METHOD int prewrite {
+   device_tdev;
+   size_t  offset;
+   int val;
+} DEFAULT virtio_mmio_prewrite;
+
+#
 # Inform backend we have data wrotten to offset.
 #
 METHOD int note {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285093 - head/sys/dev/beri/virtio

2015-07-03 Thread Ruslan Bukin
Author: br
Date: Fri Jul  3 14:27:28 2015
New Revision: 285093
URL: https://svnweb.freebsd.org/changeset/base/285093

Log:
  Allow BERI virtio-platform code to operate with no PIO devices specified.
  We will use it with Bluespec simulator of CHERI processor for invalidating
  caches only.

Modified:
  head/sys/dev/beri/virtio/virtio_mmio_platform.c

Modified: head/sys/dev/beri/virtio/virtio_mmio_platform.c
==
--- head/sys/dev/beri/virtio/virtio_mmio_platform.c Fri Jul  3 14:22:44 
2015(r285092)
+++ head/sys/dev/beri/virtio/virtio_mmio_platform.c Fri Jul  3 14:27:28 
2015(r285093)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2014 Ruslan Bukin 
+ * Copyright (c) 2014-2015 Ruslan Bukin 
  * All rights reserved.
  *
  * This software was developed by SRI International and the University of
@@ -70,6 +70,7 @@ static void platform_intr(void *arg);
 
 struct virtio_mmio_platform_softc {
struct resource *res[1];
+   void*ih;
bus_space_tag_t bst;
bus_space_handle_t  bsh;
device_tdev;
@@ -77,6 +78,7 @@ struct virtio_mmio_platform_softc {
void*ih_user;
device_tpio_recv;
device_tpio_send;
+   int use_pio;
 };
 
 static int
@@ -131,11 +133,11 @@ virtio_mmio_platform_attach(device_t dev
 
sc = device_get_softc(dev);
sc->dev = dev;
+   sc->use_pio = 1;
 
-   if (setup_pio(sc, "pio-send", &sc->pio_send) != 0)
-   return (ENXIO);
-   if (setup_pio(sc, "pio-recv", &sc->pio_recv) != 0)
-   return (ENXIO);
+   if ((setup_pio(sc, "pio-send", &sc->pio_send) != 0) ||
+   (setup_pio(sc, "pio-recv", &sc->pio_recv) != 0))
+   sc->use_pio = 0;
 
if ((node = ofw_bus_get_node(sc->dev)) == -1)
return (ENXIO);
@@ -149,6 +151,24 @@ virtio_mmio_platform_attach(device_t dev
 }
 
 static int
+platform_prewrite(device_t dev, size_t offset, int val)
+{
+   struct virtio_mmio_platform_softc *sc;
+
+   sc = device_get_softc(dev);
+
+   switch (offset) {
+   case (VIRTIO_MMIO_QUEUE_NOTIFY):
+   mips_dcache_wbinv_all();
+   break;
+   default:
+   break;
+   }
+
+   return (0);
+}
+
+static int
 platform_note(device_t dev, size_t offset, int val)
 {
struct virtio_mmio_platform_softc *sc;
@@ -158,25 +178,30 @@ platform_note(device_t dev, size_t offse
sc = device_get_softc(dev);
 
switch (offset) {
-   case (VIRTIO_MMIO_QUEUE_NOTIFY):
-   if (val == 0)
-   note = Q_NOTIFY;
-   else if (val == 1)
-   note = Q_NOTIFY1;
-   break;
-   case (VIRTIO_MMIO_QUEUE_PFN):
-   note = Q_PFN;
-   break;
-   case (VIRTIO_MMIO_QUEUE_SEL):
-   note = Q_SEL;
-   break;
-   default:
+   case (VIRTIO_MMIO_QUEUE_NOTIFY):
+   if (val == 0)
+   note = Q_NOTIFY;
+   else if (val == 1)
+   note = Q_NOTIFY1;
+   else
note = 0;
+   break;
+   case (VIRTIO_MMIO_QUEUE_PFN):
+   note = Q_PFN;
+   break;
+   case (VIRTIO_MMIO_QUEUE_SEL):
+   note = Q_SEL;
+   break;
+   default:
+   note = 0;
}
 
if (note) {
mips_dcache_wbinv_all();
 
+   if (!sc->use_pio)
+   return (0);
+
PIO_SET(sc->pio_send, note, 1);
 
/* 
@@ -205,11 +230,13 @@ platform_intr(void *arg)
 
sc = arg;
 
-   /* Read pending */
-   reg = PIO_READ(sc->pio_recv);
+   if (sc->use_pio) {
+   /* Read pending */
+   reg = PIO_READ(sc->pio_recv);
 
-   /* Ack */
-   PIO_SET(sc->pio_recv, reg, 0);
+   /* Ack */
+   PIO_SET(sc->pio_recv, reg, 0);
+   }
 
/* Writeback, invalidate cache */
mips_dcache_wbinv_all();
@@ -223,13 +250,31 @@ platform_setup_intr(device_t dev, device
void *intr_handler, void *ih_user)
 {
struct virtio_mmio_platform_softc *sc;
+   int rid;
 
sc = device_get_softc(dev);
 
sc->intr_handler = intr_handler;
sc->ih_user = ih_user;
 
-   PIO_SETUP_IRQ(sc->pio_recv, platform_intr, sc);
+   if (sc->use_pio) {
+   PIO_SETUP_IRQ(sc->pio_recv, platform_intr, sc);
+   return (0);
+   }
+
+   rid = 0;
+   sc->res[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+   RF_ACTIVE);
+   if (!sc->res[0]) {
+  

svn commit: r285095 - in head/sys: boot/fdt/dts/mips mips/conf

2015-07-03 Thread Ruslan Bukin
Author: br
Date: Fri Jul  3 14:46:57 2015
New Revision: 285095
URL: https://svnweb.freebsd.org/changeset/base/285095

Log:
  o Add a description for virtio block device implemented
in PISM (Bluespec C-interface device)
  o Add a kernel config
  
  Sponsored by: HEIF5

Added:
  head/sys/mips/conf/BERI_SIM_VIRTIO   (contents, props changed)
Modified:
  head/sys/boot/fdt/dts/mips/beri-sim.dts

Modified: head/sys/boot/fdt/dts/mips/beri-sim.dts
==
--- head/sys/boot/fdt/dts/mips/beri-sim.dts Fri Jul  3 14:29:55 2015
(r285094)
+++ head/sys/boot/fdt/dts/mips/beri-sim.dts Fri Jul  3 14:46:57 2015
(r285095)
@@ -128,6 +128,18 @@
reg = <0x7f002000 0x40>;
};
 
+   virtio_mmio_platform0: virtio_mmio_platform@0 {
+   compatible = "beri,virtio_mmio_platform";
+   interrupts = <1>;
+   interrupt-parent = <&beripic0>;
+   };
+
+   virtio_block@7f02 {
+   compatible = "virtio,mmio";
+   reg = <0x7f02 0x1000>;
+   platform = <&virtio_mmio_platform0>;
+   };
+
sdcard@7f008000 {
compatible = "altera,sdcard_11_2011";
reg = <0x7f008000 0x400>;

Added: head/sys/mips/conf/BERI_SIM_VIRTIO
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/mips/conf/BERI_SIM_VIRTIO  Fri Jul  3 14:46:57 2015
(r285095)
@@ -0,0 +1,20 @@
+#
+# BERI_SIM_VIRTIO -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible
+# RISC Implementation) FPGA soft core, as configured for simulation.
+#
+# $FreeBSD$
+#
+
+include "BERI_SIM_BASE"
+
+ident  BERI_SIM_VIRTIO
+
+device virtio
+device virtio_blk
+device virtio_mmio
+device altera_pio
+
+#
+# This kernel expects to find its root filesystem on the SD Card.
+#
+optionsROOTDEVNAME=\"ufs:/dev/vtbd0\"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285096 - head/sys/netipsec

2015-07-03 Thread Ermal Luçi
Author: eri
Date: Fri Jul  3 15:31:56 2015
New Revision: 285096
URL: https://svnweb.freebsd.org/changeset/base/285096

Log:
  Reduce overhead of IPSEC for traffic generated from host
  
  When IPSEC is enabled on the kernel the forwarding path has an optimization 
to not enter the code paths
  for checking security policies but first checks if there is any security 
policy active at all.
  
  The patch introduces the same optimization but for traffic generated from the 
host itself.
  This reduces the overhead by 50% on my tests for generated host traffic 
without and SP active.
  
  Differential Revision:https://reviews.freebsd.org/D2980
  Reviewed by:  ae, gnn
  Approved by:  gnn(mentor)

Modified:
  head/sys/netipsec/ipsec.c

Modified: head/sys/netipsec/ipsec.c
==
--- head/sys/netipsec/ipsec.c   Fri Jul  3 14:46:57 2015(r285095)
+++ head/sys/netipsec/ipsec.c   Fri Jul  3 15:31:56 2015(r285096)
@@ -334,6 +334,12 @@ ipsec_getpolicybysock(struct mbuf *m, u_
IPSEC_ASSERT(dir == IPSEC_DIR_INBOUND || dir == IPSEC_DIR_OUTBOUND,
("invalid direction %u", dir));
 
+   if (!key_havesp(dir)) {
+   /* No SP found, use system default. */
+   sp = KEY_ALLOCSP_DEFAULT();
+   return (sp);
+   }
+
/* Set spidx in pcb. */
*error = ipsec_setspidx_inpcb(m, inp);
if (*error)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285097 - head/sys/conf

2015-07-03 Thread Marcel Moolenaar
Author: marcel
Date: Fri Jul  3 15:56:00 2015
New Revision: 285097
URL: https://svnweb.freebsd.org/changeset/base/285097

Log:
  Allow proto(4) to be compiled into the kernel.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Jul  3 15:31:56 2015(r285096)
+++ head/sys/conf/files Fri Jul  3 15:56:00 2015(r285097)
@@ -2069,6 +2069,10 @@ dev/ppc/ppc_acpi.c   optional ppc acpi
 dev/ppc/ppc_isa.c  optional ppc isa
 dev/ppc/ppc_pci.c  optional ppc pci
 dev/ppc/ppc_puc.c  optional ppc puc
+dev/proto/proto_bus_isa.c  optional proto acpi | proto isa
+dev/proto/proto_bus_pci.c  optional proto pci
+dev/proto/proto_busdma.c   optional proto
+dev/proto/proto_core.c optional proto
 dev/pst/pst-iop.c  optional pst
 dev/pst/pst-pci.c  optional pst pci
 dev/pst/pst-raid.c optional pst
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285098 - head/sys/conf

2015-07-03 Thread Marcel Moolenaar
Author: marcel
Date: Fri Jul  3 16:02:06 2015
New Revision: 285098
URL: https://svnweb.freebsd.org/changeset/base/285098

Log:
  Remove commented-out and non-existent cbus(4) attachment for uart(4).

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Jul  3 15:56:00 2015(r285097)
+++ head/sys/conf/files Fri Jul  3 16:02:06 2015(r285098)
@@ -2335,7 +2335,6 @@ dev/tws/tws_user.coptional tws
 dev/tx/if_tx.c optional tx
 dev/txp/if_txp.c   optional txp
 dev/uart/uart_bus_acpi.c   optional uart acpi
-#dev/uart/uart_bus_cbus.c  optional uart cbus
 dev/uart/uart_bus_ebus.c   optional uart ebus
 dev/uart/uart_bus_fdt.coptional uart fdt
 dev/uart/uart_bus_isa.coptional uart isa
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285099 - head/share/man/man4

2015-07-03 Thread Marcel Moolenaar
Author: marcel
Date: Fri Jul  3 16:20:14 2015
New Revision: 285099
URL: https://svnweb.freebsd.org/changeset/base/285099

Log:
  Minor update to the proto(4) man page:
  1.  We now support ISA devices
  2.  DMA support has been added

Modified:
  head/share/man/man4/proto.4

Modified: head/share/man/man4/proto.4
==
--- head/share/man/man4/proto.4 Fri Jul  3 16:02:06 2015(r285098)
+++ head/share/man/man4/proto.4 Fri Jul  3 16:20:14 2015(r285099)
@@ -1,5 +1,5 @@
 .\"
-.\" Copyright (c) 2014 Marcel Moolenaar
+.\" Copyright (c) 2014, 2015 Marcel Moolenaar
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -25,13 +25,13 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 29, 2014
+.Dd July 3, 2015
 .Dt PROTO 4
 .Os
 .\"
 .Sh NAME
 .Nm proto
-.Nd Driver for prototyping and H/W diagnostics
+.Nd Generic prototyping and diagnostics driver
 .\"
 .Sh SYNOPSIS
 To compile this driver into the kernel,
@@ -51,9 +51,9 @@ proto_load="YES"
 .Sh DESCRIPTION
 The
 .Nm
-device driver attaches to PCI devices when no other device drivers are
-present and creates device special files for all resources associated
-with the device.
+device driver attaches to PCI or ISA devices when no other device drivers
+are present for those devices and it creates device special files for all
+resources associated with the device.
 The driver itself has no knowledge of the device it attaches to.
 Programs can open these device special files and perform register-level
 reads and writes.
@@ -75,9 +75,9 @@ All device special files corresponding t
 with
 .Pa pci:::
 representing the location of the PCI device in the PCI hierarchy.
-A location includes:
+A PCI location includes:
 .Pp
-.Bl -tag -width XX -compact
+.Bl -tag -width XX -compact -offset indent
 .It 
 The PCI domain number
 .It 
@@ -91,6 +91,10 @@ The PCI function number
 Every PCI device has a device special file called
 .Pa pcicfg .
 This device special file gives access to the PCI configuration space.
+A device special file called
+.Pa busdma
+is also created.
+This device special file provides the interfaces needed for doing DMA.
 For each valid base address register (BAR), a device special file is created
 that contains the BAR offset and the resource type.
 A resource type can be either
@@ -98,15 +102,49 @@ A resource type can be either
 or
 .Pa mem
 representing I/O port or memory mapped I/O space (resp.)
+.Pp
+ISA devices do not have a location. Instead, they are identified by the
+first I/O port address or first memory mapped I/O address.
+Consequently, all device special files corresponding to an ISA device are
+located under
+.Pa /dev/proto/isa:
+with
+.Pa addr
+the address in hexadecimal notation.
+For each I/O port or memory mapped I/O address, a device special file is
+created that contains the resource identification used by the kernel and
+the resource type.
+The resource type can be either
+.Pa io
+or
+.Pa mem
+representing I/O port or memory mapped I/O space (resp.)
+When the device has a DMA channel assigned to it, a device special file
+with the name
+.Pa busdma
+is created as well.
+This device special file provides the interfaces needed for doing DMA.
+.Pp
+If the ISA device is not a Plug-and-Play device nor present in the ACPI
+device tree, it must have the appropriate hints so that the kernel can
+reserve the resources for it.
 .\"
 .Sh EXAMPLES
 A single function PCI device in domain 0, on bus 1, in slot 2 and having a
 single memory mapped I/O region will have the following device special files:
 .Pp
-.Bl -tag -width XX -compact
+.Bl -tag -width XX -compact -offset indent
 .It Pa /dev/proto/pci0:1:2:0/10.mem
 .It Pa /dev/proto/pci0:1:2:0/pcicfg
 .El
+.Pp
+A legacy floppy controller will have the following device files:
+.Pp
+.Bl -tag -width XX -compact -offset indent
+.It Pa /dev/proto/isa:0x3f0/00.io
+.It Pa /dev/proto/isa:0x3f0/01.io
+.It Pa /dev/proto/isa:0x3f0/busdma
+.El
 .\"
 .Sh AUTHORS
 The
@@ -123,13 +161,12 @@ It is not advisable to use this driver o
 The
 .Nm
 driver does not yet support interrupts.
-Since interrupts cannot be handled by the driver itself, they must be converted
-into signals and delivered to the program that has registered for interrupts.
-.Pp
-In order to test the transmission or reception of data, some means of doing
-direct memory access (DMA) by the device must be possible.
-This too must be under the control of the program.
-The details of how a program can set up and
-initiate DMA still need to be fleshed out.
-.Pp
-Support for non-PCI devices has not been implemented yet.
+Since interrupts cannot be handled by the driver itself, they must be
+converted into signals and delivered to the program that has registered
+for interrupts.
+A satisfactory mechanism for keeping the interrupt masked during the
+signal handling is still being worked out.
+.Pp
+DMA support for devices other

svn commit: r285100 - head/share/man/man4

2015-07-03 Thread Edward Tomasz Napierala
Author: trasz
Date: Fri Jul  3 16:55:08 2015
New Revision: 285100
URL: https://svnweb.freebsd.org/changeset/base/285100

Log:
  Make ctl(4) appear in "man -k iscsi" results.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

Modified:
  head/share/man/man4/ctl.4

Modified: head/share/man/man4/ctl.4
==
--- head/share/man/man4/ctl.4   Fri Jul  3 16:20:14 2015(r285099)
+++ head/share/man/man4/ctl.4   Fri Jul  3 16:55:08 2015(r285100)
@@ -23,12 +23,12 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd June 20, 2015
+.Dd July 3, 2015
 .Dt CTL 4
 .Os
 .Sh NAME
 .Nm ctl
-.Nd CAM Target Layer
+.Nd CAM Target Layer / iSCSI target
 .Sh SYNOPSIS
 To compile this driver into the kernel,
 place the following line in your
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r285068 - in head/sys: conf modules/agp modules/geom/geom_part/geom_part_apm modules/geom/geom_part/geom_part_bsd modules/geom/geom_part/geom_part_bsd64 modules/geom/geom_part/geom_par

2015-07-03 Thread Roger Pau Monné
El 03/07/15 a les 3.50, Warner Losh ha escrit:
> Author: imp
> Date: Fri Jul  3 01:50:26 2015
> New Revision: 285068
> URL: https://svnweb.freebsd.org/changeset/base/285068
> 
> Log:
>   Kill MFILES and find things automatically. It turned out to be only
>   lightly used. Find the proper .m file when we depend on *_if.[ch] in
>   the srcs line, with seat-belts for false positive matches.  This uses
>   make's path mechanism. A further refinement would be to calculate this
>   once, and then pass the resulting _MPATH to modules submakes.

This makes building the kernel from a NFS share extremely slow, I've
been waiting for >2h for a simple buildkernel to finish, and I ended up
killing it in order to bisect what was causing this (and it was still at
the "make dependencies" phase only).

Roger.

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


svn commit: r285103 - head/sys/arm/allwinner

2015-07-03 Thread Luiz Otavio O Souza
Author: loos
Date: Fri Jul  3 17:09:27 2015
New Revision: 285103
URL: https://svnweb.freebsd.org/changeset/base/285103

Log:
  Remove duplicate and unnecessary includes.
  
  While here remove an unused and wrong define.

Modified:
  head/sys/arm/allwinner/a10_clk.c
  head/sys/arm/allwinner/a10_clk.h

Modified: head/sys/arm/allwinner/a10_clk.c
==
--- head/sys/arm/allwinner/a10_clk.cFri Jul  3 16:58:17 2015
(r285102)
+++ head/sys/arm/allwinner/a10_clk.cFri Jul  3 17:09:27 2015
(r285103)
@@ -36,20 +36,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
-#include 
-#include 
 
-#include 
 #include 
-#include 
 #include 
 
-#include 
-
 #include "a10_clk.h"
 
 struct a10_ccm_softc {

Modified: head/sys/arm/allwinner/a10_clk.h
==
--- head/sys/arm/allwinner/a10_clk.hFri Jul  3 16:58:17 2015
(r285102)
+++ head/sys/arm/allwinner/a10_clk.hFri Jul  3 17:09:27 2015
(r285103)
@@ -29,8 +29,6 @@
 #ifndef_A10_CLK_H_
 #define_A10_CLK_H_
 
-#defineCCMU_BASE   0xe1c2
-
 #defineCCM_PLL1_CFG0x
 #defineCCM_PLL1_TUN0x0004
 #defineCCM_PLL2_CFG0x0008
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r285068 - in head/sys: conf modules/agp modules/geom/geom_part/geom_part_apm modules/geom/geom_part/geom_part_bsd modules/geom/geom_part/geom_part_bsd64 modules/geom/geom_part/geom_par

2015-07-03 Thread Adrian Chadd
ok, so why's it make NFS builds so slow?


-a

On 3 July 2015 at 10:08, Roger Pau Monné  wrote:
> El 03/07/15 a les 3.50, Warner Losh ha escrit:
>> Author: imp
>> Date: Fri Jul  3 01:50:26 2015
>> New Revision: 285068
>> URL: https://svnweb.freebsd.org/changeset/base/285068
>>
>> Log:
>>   Kill MFILES and find things automatically. It turned out to be only
>>   lightly used. Find the proper .m file when we depend on *_if.[ch] in
>>   the srcs line, with seat-belts for false positive matches.  This uses
>>   make's path mechanism. A further refinement would be to calculate this
>>   once, and then pass the resulting _MPATH to modules submakes.
>
> This makes building the kernel from a NFS share extremely slow, I've
> been waiting for >2h for a simple buildkernel to finish, and I ended up
> killing it in order to bisect what was causing this (and it was still at
> the "make dependencies" phase only).
>
> Roger.
>
>
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r285104 - head/lib/libc/sys

2015-07-03 Thread Konstantin Belousov
Author: kib
Date: Fri Jul  3 17:30:31 2015
New Revision: 285104
URL: https://svnweb.freebsd.org/changeset/base/285104

Log:
  Grammar and language fixes.
  
  Submitted by: wblock
  Review:   https://reviews.freebsd.org/D2969
  MFC after:12 days

Modified:
  head/lib/libc/sys/ptrace.2

Modified: head/lib/libc/sys/ptrace.2
==
--- head/lib/libc/sys/ptrace.2  Fri Jul  3 17:09:27 2015(r285103)
+++ head/lib/libc/sys/ptrace.2  Fri Jul  3 17:30:31 2015(r285104)
@@ -2,7 +2,7 @@
 .\"$NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
 .\"
 .\" This file is in the public domain.
-.Dd June 30, 2015
+.Dd July 3, 2015
 .Dt PTRACE 2
 .Os
 .Sh NAME
@@ -506,16 +506,16 @@ argument is ignored.
 .Sh x86 MACHINE-SPECIFIC REQUESTS
 .Bl -tag -width "Dv PT_GETXSTATE_INFO"
 .It Dv PT_GETXMMREGS
-Copies out the XMM FPU state into the buffer pointed to by the
+Copy the XMM FPU state into the buffer pointed to by the
 argument
 .Fa addr .
-The buffer has the same layout as the 32bit save buffer for the
+The buffer has the same layout as the 32-bit save buffer for the
 machine instruction
 .Dv FXSAVE .
 .Pp
-This request is only valid for i386 programs, both on native 32bit
+This request is only valid for i386 programs, both on native 32-bit
 systems and on amd64 kernels.
-For 64bit amd64 programs, the XMM state is reported as part of
+For 64-bit amd64 programs, the XMM state is reported as part of
 the FPU state returned by the
 .Dv PT_GETFPREGS
 request.
@@ -524,10 +524,10 @@ The
 .Fa data
 argument is ignored.
 .It Dv PT_SETXMMREGS
-Loads the XMM FPU state for the thread from the buffer pointed to
+Load the XMM FPU state for the thread from the buffer pointed to
 by the argument
 .Fa addr .
-The buffer has the same layout as the 32bit load buffer for the
+The buffer has the same layout as the 32-bit load buffer for the
 machine instruction
 .Dv FXRSTOR .
 .Pp
@@ -539,15 +539,13 @@ The
 .Fa data
 argument is ignored.
 .It Dv PT_GETXSTATE_INFO
-Returns the information about the enablement state of the XSAVE FPU
-extensions supported by the CPU and allowed by the OS for use by userspace
-programs.
+Report which XSAVE FPU extensions are supported by the CPU
+and allowed in userspace programs.
 The
 .Fa addr
-argument must point to the variable of type
+argument must point to a variable of type
 .Vt struct ptrace_xstate_info ,
 which contains the information on the request return.
-The
 .Vt struct ptrace_xstate_info
 is defined as follows:
 .Bd -literal
@@ -558,8 +556,8 @@ struct ptrace_xstate_info {
 .Ed
 The
 .Dv xsave_mask
-field is the bitmask of the currently enabled extensions.
-The meaning of the bits is defined by the Intel and AMD
+field is a bitmask of the currently enabled extensions.
+The meaning of the bits is defined in the Intel and AMD
 processor documentation.
 The
 .Dv xsave_len
@@ -573,10 +571,10 @@ The
 argument value must be equal to the size of the
 .Vt struct ptrace_xstate_info .
 .It Dv PT_GETXSTATE
-Returns the content of the XSAVE area for the thread.
+Return the content of the XSAVE area for the thread.
 The
 .Fa addr
-argument points to the buffer where the content is copied, the
+argument points to the buffer where the content is copied, and the
 .Fa data
 argument specifies the size of the buffer.
 The kernel copies out as much content as allowed by the buffer size.
@@ -590,8 +588,12 @@ pointer.
 The buffer size is passed in the
 .Fa data
 argument.
-The buffer must be at least as large to allow the x87 FPU and XMM state,
-but not large than the XSAVE state length, as reported by the
+The buffer must be at least as large as the
+.Vt struct savefpu
+(defined in
+.Pa x86/fpu.h )
+to allow the complete x87 FPU and XMM state load.
+It must not be larger than the XSAVE state length, as reported by the
 .Dv xsave_len
 field from the
 .Vt struct ptrace_xstate_info
@@ -602,26 +604,28 @@ Layout of the buffer is identical to the
 .Dv XRSTOR
 machine instruction.
 .It Dv PT_GETFSBASE
-The request returns the value of base used when doing segmented
+Return the value of the base used when doing segmented
 memory addressing using the %fs segment register.
 The
 .Fa addr
-argument points to the
+argument points to an
 .Vt unsigned long
-variable which gets the base value.
+variable where the base value is stored.
 .Pp
 The
 .Fa data
 argument is ignored.
 .It Dv PT_GETGSBASE
-Same as the
+Like the
 .Dv PT_GETFSBASE
 request, but returns the base for the %gs segment register.
 .It Dv PT_SETFSBASE
-Sets the base for the %fs segment register to the value pointed
+Set the base for the %fs segment register to the value pointed to
 by the
 .Fa addr
-argument, which must point to the
+argument.
+.Fa addr
+must point to the
 .Vt unsigned long
 variable containing the new base.
 .Pp
@@ -629,27 +633,25 @@ The
 .Fa data
 argument is ignored.
 .It Dv PT_SETGSBASE
-Same as the
+Like the
 .Dv PT_SETFSBASE
-request, but allows sett

Re: svn commit: r285068 - in head/sys: conf modules/agp modules/geom/geom_part/geom_part_apm modules/geom/geom_part/geom_part_bsd modules/geom/geom_part/geom_part_bsd64 modules/geom/geom_part/geom_par

2015-07-03 Thread Roger Pau Monné
El 03/07/15 a les 19.26, Adrian Chadd ha escrit:
> ok, so why's it make NFS builds so slow?

AFAICT it makes the build process spawn a bunch of concurrent "find"
processes that weren't previously there.

Roger.

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


svn commit: r285105 - head/sys/arm/allwinner

2015-07-03 Thread Luiz Otavio O Souza
Author: loos
Date: Fri Jul  3 17:54:41 2015
New Revision: 285105
URL: https://svnweb.freebsd.org/changeset/base/285105

Log:
  Rename a10_emac_gpio_config() to a10_gpio_ethernet_activate() to make the
  change to GMAC easier on A20 SoCs.
  
  On A10 only the EMAC controller is available (fast ethernet), but on A20
  there is also GMAC a high (or better) performant controller (gigabit
  ethernet).
  
  On A20 the both controllers uses the same pins to talk to the ethernet PHY
  (MII or RGMII) and they can be selected by the GPIO pin mux.
  
  There is work in progress to bring in GMAC support.

Modified:
  head/sys/arm/allwinner/a10_gpio.c
  head/sys/arm/allwinner/a10_gpio.h
  head/sys/arm/allwinner/if_emac.c

Modified: head/sys/arm/allwinner/a10_gpio.c
==
--- head/sys/arm/allwinner/a10_gpio.c   Fri Jul  3 17:30:31 2015
(r285104)
+++ head/sys/arm/allwinner/a10_gpio.c   Fri Jul  3 17:54:41 2015
(r285105)
@@ -524,8 +524,9 @@ static driver_t a10_gpio_driver = {
 DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0);
 
 int
-a10_emac_gpio_config(uint32_t pin)
+a10_gpio_ethernet_activate(uint32_t func)
 {
+   int i;
struct a10_gpio_softc *sc = a10_gpio_sc;
 
if (sc == NULL)
@@ -533,7 +534,8 @@ a10_emac_gpio_config(uint32_t pin)
 
/* Configure pin mux settings for MII. */
A10_GPIO_LOCK(sc);
-   a10_gpio_set_function(sc, pin, A10_GPIO_PULLDOWN);
+   for (i = 0; i <= 17; i++)
+   a10_gpio_set_function(sc, i, func);
A10_GPIO_UNLOCK(sc);
 
return (0);

Modified: head/sys/arm/allwinner/a10_gpio.h
==
--- head/sys/arm/allwinner/a10_gpio.h   Fri Jul  3 17:30:31 2015
(r285104)
+++ head/sys/arm/allwinner/a10_gpio.h   Fri Jul  3 17:54:41 2015
(r285105)
@@ -29,6 +29,9 @@
 #ifndef_A10_GPIO_H_
 #define_A10_GPIO_H_
 
-int a10_emac_gpio_config(uint32_t pin);
+#defineA10_GPIO_FUNC_MII   2
+#defineA10_GPIO_FUNC_RGMII 5
+
+int a10_gpio_ethernet_activate(uint32_t);
 
 #endif

Modified: head/sys/arm/allwinner/if_emac.c
==
--- head/sys/arm/allwinner/if_emac.cFri Jul  3 17:30:31 2015
(r285104)
+++ head/sys/arm/allwinner/if_emac.cFri Jul  3 17:54:41 2015
(r285105)
@@ -142,17 +142,12 @@ static intsysctl_hw_emac_proc_limit(SYS
 static void
 emac_sys_setup(void)
 {
-   int i;
 
+   /* Activate EMAC clock. */
a10_clk_emac_activate();
-
-   /*
-* Configure pin mux settings for MII.
-* Pins PA0 from PA17.
-*/
-   for (i = 0; i <= 17; i++)
-   a10_emac_gpio_config(i);
-   /* Map sram */
+   /* Set the pin mux to EMAC (mii). */
+   a10_gpio_ethernet_activate(A10_GPIO_FUNC_MII);
+   /* Map sram. */
a10_map_to_emac();
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285106 - head/sys/arm/allwinner

2015-07-03 Thread Luiz Otavio O Souza
Author: loos
Date: Fri Jul  3 18:39:25 2015
New Revision: 285106
URL: https://svnweb.freebsd.org/changeset/base/285106

Log:
  Add the routines to activate the GMAC clock and setup the GMAC mode.
  
  Tested on Cubieboard 2 and Banana pi.

Modified:
  head/sys/arm/allwinner/a10_clk.c
  head/sys/arm/allwinner/a10_clk.h

Modified: head/sys/arm/allwinner/a10_clk.c
==
--- head/sys/arm/allwinner/a10_clk.cFri Jul  3 17:54:41 2015
(r285105)
+++ head/sys/arm/allwinner/a10_clk.cFri Jul  3 18:39:25 2015
(r285106)
@@ -182,6 +182,38 @@ a10_clk_emac_activate(void)
return (0);
 }
 
+int
+a10_clk_gmac_activate(phandle_t node)
+{
+   char *phy_type;
+   struct a10_ccm_softc *sc;
+   uint32_t reg_value;
+
+   sc = a10_ccm_sc;
+   if (sc == NULL)
+   return (ENXIO);
+
+   /* Gating AHB clock for GMAC */
+   reg_value = ccm_read_4(sc, CCM_AHB_GATING1);
+   reg_value |= CCM_AHB_GATING_GMAC;
+   ccm_write_4(sc, CCM_AHB_GATING1, reg_value);
+
+   /* Set GMAC mode. */
+   reg_value = CCM_GMAC_CLK_MII;
+   if (OF_getprop_alloc(node, "phy-type", 1, (void **)&phy_type) > 0) {
+   if (strcasecmp(phy_type, "rgmii") == 0)
+   reg_value = CCM_GMAC_CLK_RGMII | CCM_GMAC_MODE_RGMII;
+   else if (strcasecmp(phy_type, "rgmii-bpi") == 0) {
+   reg_value = CCM_GMAC_CLK_RGMII | CCM_GMAC_MODE_RGMII;
+   reg_value |= (3 << CCM_GMAC_CLK_DELAY_SHIFT);
+   }
+   free(phy_type, M_OFWPROP);
+   }
+   ccm_write_4(sc, CCM_GMAC_CLK, reg_value);
+
+   return (0);
+}
+
 static void
 a10_clk_pll6_enable(void)
 {

Modified: head/sys/arm/allwinner/a10_clk.h
==
--- head/sys/arm/allwinner/a10_clk.hFri Jul  3 17:54:41 2015
(r285105)
+++ head/sys/arm/allwinner/a10_clk.hFri Jul  3 18:39:25 2015
(r285106)
@@ -97,7 +97,16 @@
 #defineCCM_LVDS_CLK0x014c
 #defineCCM_HDMI_CLK0x0150
 #defineCCM_MALI400_CLK 0x0154
+#defineCCM_GMAC_CLK0x0164
 
+#defineCCM_GMAC_CLK_DELAY_SHIFT10
+#defineCCM_GMAC_CLK_MODE_MASK  0x7
+#defineCCM_GMAC_MODE_RGMII (1 << 2)
+#defineCCM_GMAC_CLK_MII0x0
+#defineCCM_GMAC_CLK_EXT_RGMII  0x1
+#defineCCM_GMAC_CLK_RGMII  0x2
+
+/* AHB_GATING_REG0 */
 #defineCCM_AHB_GATING_USB0 (1 << 0)
 #defineCCM_AHB_GATING_EHCI0(1 << 1)
 #defineCCM_AHB_GATING_EHCI1(1 << 3)
@@ -105,6 +114,9 @@
 #defineCCM_AHB_GATING_EMAC (1 << 17)
 #defineCCM_AHB_GATING_SATA (1 << 25)
 
+/* AHB_GATING_REG1 */
+#defineCCM_AHB_GATING_GMAC (1 << 17)
+
 #defineCCM_USB_PHY (1 << 8)
 #defineCCM_USB0_RESET  (1 << 0)
 #defineCCM_USB1_RESET  (1 << 1)
@@ -139,6 +151,7 @@
 int a10_clk_usb_activate(void);
 int a10_clk_usb_deactivate(void);
 int a10_clk_emac_activate(void);
+int a10_clk_gmac_activate(phandle_t);
 int a10_clk_ahci_activate(void);
 int a10_clk_mmc_activate(int);
 int a10_clk_mmc_cfg(int, int);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285107 - head/sys/netinet6

2015-07-03 Thread Andrey V. Elsukov
Author: ae
Date: Fri Jul  3 19:01:38 2015
New Revision: 285107
URL: https://svnweb.freebsd.org/changeset/base/285107

Log:
  Keep IPv6 address specified by IPV6_PKTINFO socket option in kernel
  internal form to be able handle link-local IPv6 addresses.
  
  Reported by:  kp
  Tested by:kp

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Fri Jul  3 18:39:25 2015
(r285106)
+++ head/sys/netinet6/ip6_output.c  Fri Jul  3 19:01:38 2015
(r285107)
@@ -2189,12 +2189,14 @@ ip6_getpcbopt(struct ip6_pktopts *pktopt
 
switch (optname) {
case IPV6_PKTINFO:
-   if (pktopt && pktopt->ip6po_pktinfo)
-   optdata = (void *)pktopt->ip6po_pktinfo;
-   else {
+   optdata = (void *)&null_pktinfo;
+   if (pktopt && pktopt->ip6po_pktinfo) {
+   bcopy(pktopt->ip6po_pktinfo, &null_pktinfo,
+   sizeof(null_pktinfo));
+   in6_clearscope(&null_pktinfo.ipi6_addr);
+   } else {
/* XXX: we don't have to do this every time... */
bzero(&null_pktinfo, sizeof(null_pktinfo));
-   optdata = (void *)&null_pktinfo;
}
optdatalen = sizeof(struct in6_pktinfo);
break;
@@ -2566,6 +2568,7 @@ ip6_setpktopt(int optname, u_char *buf, 
!IN6_IS_ADDR_UNSPECIFIED(&pktinfo->ipi6_addr)) {
struct in6_ifaddr *ia;
 
+   in6_setscope(&pktinfo->ipi6_addr, ifp, NULL);
ia = in6ifa_ifpwithaddr(ifp, &pktinfo->ipi6_addr);
if (ia == NULL)
return (EADDRNOTAVAIL);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285108 - in head: lib/libipsec sbin/setkey sys/net usr.bin/netstat

2015-07-03 Thread George V. Neville-Neil
Author: gnn
Date: Fri Jul  3 20:09:14 2015
New Revision: 285108
URL: https://svnweb.freebsd.org/changeset/base/285108

Log:
  New AES modes for IPSec, user space components.
  Update setkey and libipsec to understand aes-gcm-16 as an
  encryption method.
  
  A partial commit of the work in review D2936.
  
  Submitted by: eri
  Reviewed by:  jmg
  MFC after:2 weeks
  Sponsored by: Rubicon Communications (Netgate)

Modified:
  head/lib/libipsec/pfkey_dump.c
  head/sbin/setkey/setkey.8
  head/sbin/setkey/token.l
  head/sys/net/pfkeyv2.h
  head/usr.bin/netstat/ipsec.c

Modified: head/lib/libipsec/pfkey_dump.c
==
--- head/lib/libipsec/pfkey_dump.c  Fri Jul  3 19:01:38 2015
(r285107)
+++ head/lib/libipsec/pfkey_dump.c  Fri Jul  3 20:09:14 2015
(r285108)
@@ -187,6 +187,9 @@ static struct val2str str_alg_enc[] = {
 #ifdef SADB_X_EALG_AESCTR
{ SADB_X_EALG_AESCTR, "aes-ctr", },
 #endif
+#ifdef SADB_X_EALG_AESGCM16
+   { SADB_X_EALG_AESGCM16, "aes-gcm-16", },
+#endif
 #ifdef SADB_X_EALG_CAMELLIACBC
{ SADB_X_EALG_CAMELLIACBC, "camellia-cbc", },
 #endif

Modified: head/sbin/setkey/setkey.8
==
--- head/sbin/setkey/setkey.8   Fri Jul  3 19:01:38 2015(r285107)
+++ head/sbin/setkey/setkey.8   Fri Jul  3 20:09:14 2015(r285108)
@@ -627,11 +627,12 @@ des-deriv 64  ipsec-ciph-des-derived-01
 3des-deriv 192 no document
 rijndael-cbc   128/192/256 rfc3602
 aes-ctr160/224/288 draft-ietf-ipsec-ciph-aes-ctr-03
+aes-gcm-16 160/224/288 rfc4106
 camellia-cbc   128/192/256 rfc4312
 .Ed
 .Pp
 Note that the first 128/192/256 bits of a key for
-.Li aes-ctr
+.Li aes-ctr or aes-gcm-16
 will be used as AES key, and remaining 32 bits will be used as nonce.
 .Pp
 The following are the list of compression algorithms that can be used

Modified: head/sbin/setkey/token.l
==
--- head/sbin/setkey/token.lFri Jul  3 19:01:38 2015(r285107)
+++ head/sbin/setkey/token.lFri Jul  3 20:09:14 2015(r285108)
@@ -168,6 +168,7 @@ tcp { yylval.num = 0; return(PR_TCP); }
 rijndael-cbc { yylval.num = SADB_X_EALG_RIJNDAELCBC; BEGIN INITIAL; 
return(ALG_ENC); }
 aes-ctr  { yylval.num = SADB_X_EALG_AESCTR; BEGIN INITIAL; 
return(ALG_ENC); }
 camellia-cbc { yylval.num = SADB_X_EALG_CAMELLIACBC; BEGIN INITIAL; 
return(ALG_ENC); }
+aes-gcm-16   { yylval.num = SADB_X_EALG_AESGCM16; BEGIN INITIAL; 
return(ALG_ENC); }
 
/* compression algorithms */
 {hyphen}C  { return(F_COMP); }

Modified: head/sys/net/pfkeyv2.h
==
--- head/sys/net/pfkeyv2.h  Fri Jul  3 19:01:38 2015(r285107)
+++ head/sys/net/pfkeyv2.h  Fri Jul  3 20:09:14 2015(r285108)
@@ -343,6 +343,9 @@ struct sadb_x_nat_t_frag {
 #define SADB_X_AALG_SHA2_512   7
 #define SADB_X_AALG_RIPEMD160HMAC  8
 #define SADB_X_AALG_AES_XCBC_MAC   9   /* 
draft-ietf-ipsec-ciph-aes-xcbc-mac-04 */
+#define SADB_X_AALG_AES128GMAC 11  /* RFC4543 + Errata1821 */
+#define SADB_X_AALG_AES192GMAC 12
+#define SADB_X_AALG_AES256GMAC 13
 /* private allocations should use 249-255 (RFC2407) */
 #define SADB_X_AALG_MD5249 /* Keyed MD5 */
 #define SADB_X_AALG_SHA250 /* Keyed SHA */
@@ -360,8 +363,12 @@ struct sadb_x_nat_t_frag {
 #define SADB_X_EALG_BLOWFISHCBC7
 #define SADB_X_EALG_RIJNDAELCBC12
 #define SADB_X_EALG_AES12
+#define SADB_X_EALG_AESGCM818  /* RFC4106 */
+#define SADB_X_EALG_AESGCM12   19
+#define SADB_X_EALG_AESGCM16   20
 /* private allocations - based on RFC4312/IANA assignment */
 #define SADB_X_EALG_CAMELLIACBC22
+#defineSADB_X_EALG_AESGMAC 23 /* RFC4543 + Errata1821 */
 /* private allocations should use 249-255 (RFC2407) */
 #define SADB_X_EALG_SKIPJACK   249 /*250*/ /* for IPSEC */
 #define SADB_X_EALG_AESCTR 250 /*249*/ /* 
draft-ietf-ipsec-ciph-aes-ctr-03 */

Modified: head/usr.bin/netstat/ipsec.c
==
--- head/usr.bin/netstat/ipsec.cFri Jul  3 19:01:38 2015
(r285107)
+++ head/usr.bin/netstat/ipsec.cFri Jul  3 20:09:14 2015
(r285108)
@@ -157,6 +157,9 @@ static struct val2str ipsec_espnames[] =
 #ifdef SADB_X_EALG_AESCTR
{ SADB_X_EALG_AESCTR, "aes-ctr", },
 #endif
+#ifdef SADB_X_EALG_AESGCM16
+   { SADB_X_EALG_AESGCM16, "aes-gcm-16", },
+#endif
{ -1, NULL },
 };
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubsc

Re: svn commit: r285068 - in head/sys: conf modules/agp modules/geom/geom_part/geom_part_apm modules/geom/geom_part/geom_part_bsd modules/geom/geom_part/geom_part_bsd64 modules/geom/geom_part/geom_par

2015-07-03 Thread Warner Losh

> On Jul 3, 2015, at 11:35 AM, Roger Pau Monné  wrote:
> 
> El 03/07/15 a les 19.26, Adrian Chadd ha escrit:
>> ok, so why's it make NFS builds so slow?
> 
> AFAICT it makes the build process spawn a bunch of concurrent "find"
> processes that weren't previously there.

OK. I’ll fix it. I knew it might slow things down a little, but this is quite a 
bit more than “a little”.

Warner



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r285111 - head/sbin/setkey

2015-07-03 Thread George V. Neville-Neil
Author: gnn
Date: Fri Jul  3 20:42:31 2015
New Revision: 285111
URL: https://svnweb.freebsd.org/changeset/base/285111

Log:
  Update the date on the manual page.
  
  Noticed by: bz

Modified:
  head/sbin/setkey/setkey.8

Modified: head/sbin/setkey/setkey.8
==
--- head/sbin/setkey/setkey.8   Fri Jul  3 20:31:27 2015(r285110)
+++ head/sbin/setkey/setkey.8   Fri Jul  3 20:42:31 2015(r285111)
@@ -29,7 +29,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 25, 2014
+.Dd July 3, 2015
 .Dt SETKEY 8
 .Os
 .\"
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285113 - head/sys/fs/nfsclient

2015-07-03 Thread Rick Macklem
Author: rmacklem
Date: Fri Jul  3 22:11:07 2015
New Revision: 285113
URL: https://svnweb.freebsd.org/changeset/base/285113

Log:
  If a "principal" argument isn't provided for a Kerberized NFS mount,
  the kernel would generate a bogus one with a ":/" suffix.
  This would only occur for the case where there was no explicit
  "principal" argument and the getaddrinfo() call in mount_nfs.c failed to a
  return a cannonical name for the server.
  This patch fixes this unusual case.
  
  PR:   201073
  Submitted by: mas...@itc.naist.jp
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clvfsops.c

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==
--- head/sys/fs/nfsclient/nfs_clvfsops.cFri Jul  3 20:43:31 2015
(r285112)
+++ head/sys/fs/nfsclient/nfs_clvfsops.cFri Jul  3 22:11:07 2015
(r285113)
@@ -779,7 +779,7 @@ nfs_mount(struct mount *mp)
struct thread *td;
char hst[MNAMELEN];
u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100];
-   char *opt, *name, *secname;
+   char *cp, *opt, *name, *secname;
int nametimeo = NFS_DEFAULT_NAMETIMEO;
int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO;
int minvers = 0;
@@ -1158,8 +1158,12 @@ nfs_mount(struct mount *mp)
 
if (vfs_getopt(mp->mnt_optnew, "principal", (void **)&name, NULL) == 0)
strlcpy(srvkrbname, name, sizeof (srvkrbname));
-   else
+   else {
snprintf(srvkrbname, sizeof (srvkrbname), "nfs@%s", hst);
+   cp = strchr(srvkrbname, ':');
+   if (cp != NULL)
+   *cp = '\0';
+   }
srvkrbnamelen = strlen(srvkrbname);
 
if (vfs_getopt(mp->mnt_optnew, "gssname", (void **)&name, NULL) == 0)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285114 - head/release/tools

2015-07-03 Thread Glen Barber
Author: gjb
Date: Sat Jul  4 00:01:41 2015
New Revision: 285114
URL: https://svnweb.freebsd.org/changeset/base/285114

Log:
  Revert r285018, r285019, r285076, r285078, r285082.
  
  The true cause of the missing UFS/MSDOSFS labels has been
  identified, and only affects stable/10 at the moment.
  
  An request for commit to stable/10 will be pending RE approval
  after this commit.
  
  MFC after:1 day
  X-MFC-Note:   never
  X-MFC-Never:  r285018, r285019, r285076, r285078, r285082
  Sponsored by: The FreeBSD Foundation

Modified:
  head/release/tools/arm.subr

Modified: head/release/tools/arm.subr
==
--- head/release/tools/arm.subr Fri Jul  3 22:11:07 2015(r285113)
+++ head/release/tools/arm.subr Sat Jul  4 00:01:41 2015(r285114)
@@ -128,14 +128,6 @@ arm_install_base() {
echo 'sendmail_msp_queue_enable="NO"' >> 
${CHROOTDIR}/${DESTDIR}/etc/rc.conf
echo 'growfs_enable="YES"' >> ${CHROOTDIR}/${DESTDIR}/etc/rc.conf
 
-   # The fstab(5) above uses UFS/MSDOSFS labels.
-   echo 'geom_label_load="YES"' >> ${CHROOTDIR}/${DESTDIR}/boot/loader.conf
-   # Workaround missing loader.rc if needed.
-   if [ ! -e "${CHROOTDIR}/${DESTDIR}/boot/loader.rc" ]; then
-   chroot ${CHROOTDIR} \
-   ln -s /boot/loader.rc.sample ${DESTDIR}/boot/loader.rc
-   fi
-
sync
umount_loop ${CHROOTDIR}/${DESTDIR}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285117 - head/tests/sys/netinet

2015-07-03 Thread Julio Merino
Author: jmmv
Date: Sat Jul  4 02:22:26 2015
New Revision: 285117
URL: https://svnweb.freebsd.org/changeset/base/285117

Log:
  Make cleanup routines idempotent
  
  cleanup routines can be executed at any point during the execution of the
  body, including even before the body has done any real work.  In those
  cases, cleanup routines should be careful to not raise spurious errors so
  as to not "override" the actual result of the test case.
  
  This is just general good coding style but is not a problem in practice
  for these specific tests.  (The way I discovered the issue, though, was
  due to a regression I introduced in Kyua itself while refactoring some
  internals.)
  
  MFC after:1 week

Modified:
  head/tests/sys/netinet/fibs_test.sh

Modified: head/tests/sys/netinet/fibs_test.sh
==
--- head/tests/sys/netinet/fibs_test.sh Sat Jul  4 01:02:43 2015
(r285116)
+++ head/tests/sys/netinet/fibs_test.sh Sat Jul  4 02:22:26 2015
(r285117)
@@ -98,9 +98,12 @@ arpresolve_checks_interface_fib_body()
 }
 arpresolve_checks_interface_fib_cleanup()
 {
-   for PID in `cat "processes_to_kill"`; do
-   kill $PID
-   done
+   if [ -f processes_to_kill ]; then
+   for pid in $(cat processes_to_kill); do
+   kill "${pid}"
+   done
+   rm -f processes_to_kill
+   fi
cleanup_tap
 }
 
@@ -476,8 +479,10 @@ setup_tap()
 
 cleanup_tap()
 {
-   for TAPD in `cat "tap_devices_to_cleanup"`; do
-   ifconfig ${TAPD} destroy
-   done
-   rm "tap_devices_to_cleanup"
+   if [ -f tap_devices_to_cleanup ]; then
+   for tap_device in $(cat tap_devices_to_cleanup); do
+   ifconfig "${tap_device}" destroy
+   done
+   rm -f tap_devices_to_cleanup
+   fi
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285118 - head/share/examples/tests/tests/plain

2015-07-03 Thread Julio Merino
Author: jmmv
Date: Sat Jul  4 02:24:47 2015
New Revision: 285118
URL: https://svnweb.freebsd.org/changeset/base/285118

Log:
  Add missing shebang
  
  Plain test programs are not preprocessed by the build system (as opposed to
  ATF test cases, which automatically gain a shebang pointing at atf-sh), so
  we must take care of providing the shebang ourselves.
  
  I'm not sure why this was not causing problems with Kyua 0.11, but the
  upcoming 0.12 release chokes on this particular issue.
  
  MFC after:1 week

Modified:
  head/share/examples/tests/tests/plain/cp_test.sh

Modified: head/share/examples/tests/tests/plain/cp_test.sh
==
--- head/share/examples/tests/tests/plain/cp_test.shSat Jul  4 02:22:26 
2015(r285117)
+++ head/share/examples/tests/tests/plain/cp_test.shSat Jul  4 02:24:47 
2015(r285118)
@@ -1,3 +1,4 @@
+#! /bin/sh
 # $FreeBSD$
 #
 # Copyright 2013 Google Inc.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285119 - head/share/mk

2015-07-03 Thread Julio Merino
Author: jmmv
Date: Sat Jul  4 02:37:36 2015
New Revision: 285119
URL: https://svnweb.freebsd.org/changeset/base/285119

Log:
  Add support for TEST_METADATA
  
  Allow Makefiles to define generic metadata settings that apply to all test
  programs defined by a Makefile.  The generic TEST_METADATA variable extends
  the per-test program settings already supported via TEST_METADATA..
  
  This feature will be useful to easily apply some settings to all programs
  in a directory.  In particular, Kyua 0.12 will support parallel execution
  of test programs and a bunch of them will need to be tagged as is_exclusive
  to indicate that they cannot be run in parallel with anything else due to
  their side-effects.  It will be reasonable to set this setting on whole
  directories.
  
  MFC after:1 week

Modified:
  head/share/mk/suite.test.mk

Modified: head/share/mk/suite.test.mk
==
--- head/share/mk/suite.test.mk Sat Jul  4 02:24:47 2015(r285118)
+++ head/share/mk/suite.test.mk Sat Jul  4 02:37:36 2015(r285119)
@@ -34,12 +34,19 @@ KYUAFILE?= auto
 # Kyua as this is later encoded in the Kyuafile test program definitions.
 #TEST_INTERFACE.= interface-name
 
+# Metadata properties applicable to all test programs.
+#
+# All the variables for a test program defined in the Makefile are appended
+# to the test program's definition in the Kyuafile.  This feature can be
+# used to avoid having to explicitly supply a Kyuafile in the source
+# directory, allowing the caller Makefile to rely on the KYUAFILE=auto
+# behavior defined here.
+#TEST_METADATA+= key="value"
+
 # Per-test program metadata properties as a list of key/value pairs.
 #
-# All the variables for a particular program are appended to the program's
-# definition in the Kyuafile.  This feature can be used to avoid having to
-# explicitly supply a Kyuafile in the source directory, allowing the caller
-# Makefile to rely on the KYUAFILE=auto behavior defined here.
+# These per-test program settings _extend_ the values provided in the
+# unqualified TEST_METADATA variable.
 #TEST_METADATA.+= key="value"
 
 # Path to the prefix of the installed Kyua CLI, if any.
@@ -61,6 +68,10 @@ FILESNAME_Kyuafile.auto= Kyuafile
 
 CLEANFILES+= Kyuafile.auto Kyuafile.auto.tmp
 
+.for _T in ${_TESTS}
+_TEST_METADATA.${_T}= ${TEST_METADATA} ${TEST_METADATA.${_T}}
+.endfor
+
 .NOPATH: Kyuafile.auto
 Kyuafile.auto: Makefile
@{ \
@@ -72,7 +83,7 @@ Kyuafile.auto: Makefile
 echo; \
} >Kyuafile.auto.tmp
 .for _T in ${_TESTS}
-   @echo 
'${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${TEST_METADATA.${_T}:C/$/,/:tW:C/^/,
 /W:C/,$//W}}' \
+   @echo 
'${TEST_INTERFACE.${_T}}_test_program{name="${_T}"${_TEST_METADATA.${_T}:C/$/,/:tW:C/^/,
 /W:C/,$//W}}' \
>>Kyuafile.auto.tmp
 .endfor
 .for _T in ${TESTS_SUBDIRS:N.WAIT}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


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

2015-07-03 Thread Adrian Chadd
Author: adrian
Date: Sat Jul  4 02:59:30 2015
New Revision: 285120
URL: https://svnweb.freebsd.org/changeset/base/285120

Log:
  Wake up the hardware before doing anything in sysctl.
  
  This stops the panics that occur on MIPS platforms when doing say,
  'sysctl dev.ath.0' whilst the MAC is asleep.  The MIPS platform is
  rather unforgiving in getting power-save register access wrong and you
  will get all kinds of odd failures if you don't have things woken
  up at the right times.
  
  Tested:
  
  * QCA9558 (TP-Link Archer C7 v2)
  * AR9331 (Carambola 2)
  
  .. with no VAPs configured and ath0 down (thus the MAC is definitely
 asleep.)
  
  PR:   kern/201117

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

Modified: head/sys/dev/ath/if_ath_sysctl.c
==
--- head/sys/dev/ath/if_ath_sysctl.cSat Jul  4 02:37:36 2015
(r285119)
+++ head/sys/dev/ath/if_ath_sysctl.cSat Jul  4 02:59:30 2015
(r285120)
@@ -134,26 +134,52 @@ static int
 ath_sysctl_acktimeout(SYSCTL_HANDLER_ARGS)
 {
struct ath_softc *sc = arg1;
-   u_int acktimeout = ath_hal_getacktimeout(sc->sc_ah);
+   u_int acktimeout;
int error;
 
+   ATH_LOCK(sc);
+   ath_power_set_power_state(sc, HAL_PM_AWAKE);
+   acktimeout = ath_hal_getacktimeout(sc->sc_ah);
+   ATH_UNLOCK(sc);
+
error = sysctl_handle_int(oidp, &acktimeout, 0, req);
if (error || !req->newptr)
-   return error;
-   return !ath_hal_setacktimeout(sc->sc_ah, acktimeout) ? EINVAL : 0;
+   goto finish;
+
+   error = !ath_hal_setacktimeout(sc->sc_ah, acktimeout) ? EINVAL : 0;
+
+finish:
+   ATH_LOCK(sc);
+   ath_power_restore_power_state(sc);
+   ATH_UNLOCK(sc);
+
+   return (error);
 }
 
 static int
 ath_sysctl_ctstimeout(SYSCTL_HANDLER_ARGS)
 {
struct ath_softc *sc = arg1;
-   u_int ctstimeout = ath_hal_getctstimeout(sc->sc_ah);
+   u_int ctstimeout;
int error;
 
+   ATH_LOCK(sc);
+   ath_power_set_power_state(sc, HAL_PM_AWAKE);
+   ctstimeout = ath_hal_getctstimeout(sc->sc_ah);
+   ATH_UNLOCK(sc);
+
error = sysctl_handle_int(oidp, &ctstimeout, 0, req);
if (error || !req->newptr)
-   return error;
-   return !ath_hal_setctstimeout(sc->sc_ah, ctstimeout) ? EINVAL : 0;
+   goto finish;
+
+   error = !ath_hal_setctstimeout(sc->sc_ah, ctstimeout) ? EINVAL : 0;
+
+finish:
+   ATH_LOCK(sc);
+   ath_power_restore_power_state(sc);
+   ATH_UNLOCK(sc);
+
+   return (error);
 }
 
 static int
@@ -221,14 +247,22 @@ static int
 ath_sysctl_txantenna(SYSCTL_HANDLER_ARGS)
 {
struct ath_softc *sc = arg1;
-   u_int txantenna = ath_hal_getantennaswitch(sc->sc_ah);
+   u_int txantenna;
int error;
 
+   ATH_LOCK(sc);
+   ath_power_set_power_state(sc, HAL_PM_AWAKE);
+   ATH_UNLOCK(sc);
+
+   txantenna = ath_hal_getantennaswitch(sc->sc_ah);
+
error = sysctl_handle_int(oidp, &txantenna, 0, req);
if (!error && req->newptr) {
/* XXX assumes 2 antenna ports */
-   if (txantenna < HAL_ANT_VARIABLE || txantenna > HAL_ANT_FIXED_B)
-   return EINVAL;
+   if (txantenna < HAL_ANT_VARIABLE || txantenna > 
HAL_ANT_FIXED_B) {
+   error = EINVAL;
+   goto finish;
+   }
ath_hal_setantennaswitch(sc->sc_ah, txantenna);
/*
 * NB: with the switch locked this isn't meaningful,
@@ -237,36 +271,67 @@ ath_sysctl_txantenna(SYSCTL_HANDLER_ARGS
 */
sc->sc_txantenna = txantenna;
}
-   return error;
+
+finish:
+   ATH_LOCK(sc);
+   ath_power_restore_power_state(sc);
+   ATH_UNLOCK(sc);
+
+   return (error);
 }
 
 static int
 ath_sysctl_rxantenna(SYSCTL_HANDLER_ARGS)
 {
struct ath_softc *sc = arg1;
-   u_int defantenna = ath_hal_getdefantenna(sc->sc_ah);
+   u_int defantenna;
int error;
 
+   ATH_LOCK(sc);
+   ath_power_set_power_state(sc, HAL_PM_AWAKE);
+   defantenna = ath_hal_getdefantenna(sc->sc_ah);
+   ATH_UNLOCK(sc);
+
error = sysctl_handle_int(oidp, &defantenna, 0, req);
if (!error && req->newptr)
ath_hal_setdefantenna(sc->sc_ah, defantenna);
-   return error;
+
+   ATH_LOCK(sc);
+   ath_power_restore_power_state(sc);
+   ATH_UNLOCK(sc);
+
+   return (error);
 }
 
 static int
 ath_sysctl_diversity(SYSCTL_HANDLER_ARGS)
 {
struct ath_softc *sc = arg1;
-   u_int diversity = ath_hal_getdiversity(sc->sc_ah);
+   u_int diversity;
int error;
 
+   ATH_LOCK(sc);
+   ath_power_set_power_state(sc, HAL_PM_AWAKE);
+   ATH_UNLOCK(sc);
+
+   diversity = ath_hal_getdiversity(sc->sc_ah);
+
error = sysctl_handle_int(oidp, &diversity, 

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

2015-07-03 Thread Adrian Chadd
Author: adrian
Date: Sat Jul  4 03:05:57 2015
New Revision: 285121
URL: https://svnweb.freebsd.org/changeset/base/285121

Log:
  Reshuffle all of the DDR flush operations into a single switch/mux,
  and start teaching subsystems about it.
  
  The Atheros MIPS platforms don't guarantee any kind of FIFO consistency
  with interrupts in hardware.  So software needs to do a flush when it
  receives an interrupt and before it calls the interrupt handler.
  
  There are new ones for the QCA934x and QCA955x, so do a few things:
  
  * Get rid of the individual ones (for ethernet and IP2);
  * Create a mux and enum listing all the variations on DDR flushes;
  * replace the uses of IP2 with the relevant one (which will typically
be "PCI" here);
  * call the USB DDR flush before calling the real USB interrupt handlers;
  * call the ethernet one upon receiving an interrupt that's for us,
rather than never calling it during operation.
  
  Tested:
  
  * QCA9558 (TP-Link archer c7 v2)
  * AR9331 (Carambola 2)
  
  TODO:
  
  * PCI, USB, ethernet, etc need to do a double-check to see if the
interrupt was truely for them before doing the DDR.  For now I
prefer "correct" over "fast".

Modified:
  head/sys/mips/atheros/ar71xx_chip.c
  head/sys/mips/atheros/ar71xx_cpudef.h
  head/sys/mips/atheros/ar71xx_ehci.c
  head/sys/mips/atheros/ar71xx_ohci.c
  head/sys/mips/atheros/ar71xx_pci.c
  head/sys/mips/atheros/ar724x_chip.c
  head/sys/mips/atheros/ar724x_pci.c
  head/sys/mips/atheros/ar91xx_chip.c
  head/sys/mips/atheros/ar933x_chip.c
  head/sys/mips/atheros/ar934x_chip.c
  head/sys/mips/atheros/if_arge.c
  head/sys/mips/atheros/qca955x_chip.c
  head/sys/mips/atheros/qca955x_pci.c

Modified: head/sys/mips/atheros/ar71xx_chip.c
==
--- head/sys/mips/atheros/ar71xx_chip.c Sat Jul  4 02:59:30 2015
(r285120)
+++ head/sys/mips/atheros/ar71xx_chip.c Sat Jul  4 03:05:57 2015
(r285121)
@@ -254,29 +254,28 @@ ar71xx_chip_set_pll_ge(int unit, int spe
 }
 
 static void
-ar71xx_chip_ddr_flush_ge(int unit)
+ar71xx_chip_ddr_flush(ar71xx_flush_ddr_id_t id)
 {
 
-   switch (unit) {
-   case 0:
+   switch (id) {
+   case AR71XX_CPU_DDR_FLUSH_GE0:
ar71xx_ddr_flush(AR71XX_WB_FLUSH_GE0);
break;
-   case 1:
+   case AR71XX_CPU_DDR_FLUSH_GE1:
ar71xx_ddr_flush(AR71XX_WB_FLUSH_GE1);
break;
+   case AR71XX_CPU_DDR_FLUSH_USB:
+   ar71xx_ddr_flush(AR71XX_WB_FLUSH_USB);
+   break;
+   case AR71XX_CPU_DDR_FLUSH_PCIE:
+   ar71xx_ddr_flush(AR71XX_WB_FLUSH_PCI);
+   break;
default:
-   printf("%s: invalid DDR flush for arge unit: %d\n",
-   __func__, unit);
-   return;
+   printf("%s: invalid DDR flush id (%d)\n", __func__, id);
+   break;
}
 }
 
-static void
-ar71xx_chip_ddr_flush_ip2(void)
-{
-   ar71xx_ddr_flush(AR71XX_WB_FLUSH_PCI);
-}
-
 static uint32_t
 ar71xx_chip_get_eth_pll(unsigned int mac, int speed)
 {
@@ -334,8 +333,7 @@ struct ar71xx_cpu_def ar71xx_chip_def = 
&ar71xx_chip_set_pll_ge,
&ar71xx_chip_set_mii_speed,
&ar71xx_chip_set_mii_if,
-   &ar71xx_chip_ddr_flush_ge,
&ar71xx_chip_get_eth_pll,
-   &ar71xx_chip_ddr_flush_ip2,
+   &ar71xx_chip_ddr_flush,
&ar71xx_chip_init_usb_peripheral,
 };

Modified: head/sys/mips/atheros/ar71xx_cpudef.h
==
--- head/sys/mips/atheros/ar71xx_cpudef.h   Sat Jul  4 02:59:30 2015
(r285120)
+++ head/sys/mips/atheros/ar71xx_cpudef.h   Sat Jul  4 03:05:57 2015
(r285121)
@@ -29,6 +29,16 @@
 #ifndef__AR71XX_CPUDEF_H__
 #define__AR71XX_CPUDEF_H__
 
+typedef enum {
+   AR71XX_CPU_DDR_FLUSH_GE0,
+   AR71XX_CPU_DDR_FLUSH_GE1,
+   AR71XX_CPU_DDR_FLUSH_USB,
+   AR71XX_CPU_DDR_FLUSH_PCIE,
+   AR71XX_CPU_DDR_FLUSH_WMAC,
+   AR71XX_CPU_DDR_FLUSH_PCIE_EP,
+   AR71XX_CPU_DDR_FLUSH_CHECKSUM,
+} ar71xx_flush_ddr_id_t;
+
 struct ar71xx_cpu_def {
void (* detect_mem_size) (void);
void (* detect_sys_frequency) (void);
@@ -38,7 +48,6 @@ struct ar71xx_cpu_def {
void (* ar71xx_chip_set_pll_ge) (int, int, uint32_t);
void (* ar71xx_chip_set_mii_speed) (uint32_t, uint32_t);
void (* ar71xx_chip_set_mii_if) (uint32_t, ar71xx_mii_mode);
-   void (* ar71xx_chip_ddr_flush_ge) (int);
uint32_t (* ar71xx_chip_get_eth_pll) (unsigned int, int);
 
/*
@@ -51,7 +60,7 @@ struct ar71xx_cpu_def {
 * This flush is done before the IRQ is handled to make
 * sure the driver correctly sees any memory updates.
 */
-   void (* ar71xx_chip_ddr_flush_ip2) (void);
+   void (* ar71xx_chip_ddr_flush) (ar71xx_flush_ddr_id_t id);
/*
 * The USB pe

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

2015-07-03 Thread Adrian Chadd
Author: adrian
Date: Sat Jul  4 03:07:28 2015
New Revision: 285122
URL: https://svnweb.freebsd.org/changeset/base/285122

Log:
  Call the WMAC DDR flush before handling an interrupt for the
  Atheros AHB (internally) connected MAC.
  
  TODO:
  
  * verify the interrupt was for us before doing the DDR flush.

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

Modified: head/sys/dev/ath/if_ath_ahb.c
==
--- head/sys/dev/ath/if_ath_ahb.c   Sat Jul  4 03:05:57 2015
(r285121)
+++ head/sys/dev/ath/if_ath_ahb.c   Sat Jul  4 03:07:28 2015
(r285122)
@@ -117,6 +117,14 @@ ath_ahb_probe(device_t dev)
return ENXIO;
 }
 
+static void
+ath_ahb_intr(void *arg)
+{
+   /* XXX TODO: check if its ours! */
+   ar71xx_device_flush_ddr(AR71XX_CPU_DDR_FLUSH_WMAC);
+   ath_intr(arg);
+}
+
 static int
 ath_ahb_attach(device_t dev)
 {
@@ -212,7 +220,7 @@ ath_ahb_attach(device_t dev)
}
if (bus_setup_intr(dev, psc->sc_irq,
   INTR_TYPE_NET | INTR_MPSAFE,
-  NULL, ath_intr, sc, &psc->sc_ih)) {
+  NULL, ath_ahb_intr, sc, &psc->sc_ih)) {
device_printf(dev, "could not establish interrupt\n");
goto bad2;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285123 - head/sys/contrib/dev/ath/ath_hal/ar9300

2015-07-03 Thread Adrian Chadd
Author: adrian
Date: Sat Jul  4 03:15:42 2015
New Revision: 285123
URL: https://svnweb.freebsd.org/changeset/base/285123

Log:
  Quieten the scorpion SoC/WMAC reset path.  Stuff the non-error stuff
  under HALDEBUG().

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c  Sat Jul  4 
03:07:28 2015(r285122)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c  Sat Jul  4 
03:15:42 2015(r285123)
@@ -1774,12 +1774,12 @@ ar9300_set_reset(struct ath_hal *ah, int
}
 
data = DDR_REG_READ(ah,DDR_CTL_CONFIG_OFFSET);
-   ath_hal_printf(ah, "check DDR Activity - HIGH\n");
+   HALDEBUG(ah, HAL_DEBUG_RESET, "check DDR Activity - 
HIGH\n");
 
count = 0;
while (DDR_CTL_CONFIG_CLIENT_ACTIVITY_GET(data)) {
//  AVE_DEBUG(0,"DDR Activity - HIGH\n");
-   ath_hal_printf(ah, "DDR Activity - HIGH\n");
+   HALDEBUG(ah, HAL_DEBUG_RESET, "DDR Activity - 
HIGH\n");
count++;
OS_DELAY(10);
data = DDR_REG_READ(ah,DDR_CTL_CONFIG_OFFSET);
@@ -1801,7 +1801,7 @@ ar9300_set_reset(struct ath_hal *ah, int
OS_DELAY(10);
OS_REG_WRITE(ah, AR_RTC_RESET, 1);
OS_DELAY(10);
-   ath_hal_printf(ah,"%s: Scorpion SoC RTC reset done.\n", 
__func__);
+   HALDEBUG(ah, HAL_DEBUG_RESET, "%s: Scorpion SoC RTC reset 
done.\n", __func__);
}
 #undef REG_READ
 #undef REG_WRITE
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285124 - head/sys/conf

2015-07-03 Thread Warner Losh
Author: imp
Date: Sat Jul  4 05:43:45 2015
New Revision: 285124
URL: https://svnweb.freebsd.org/changeset/base/285124

Log:
  Cache _MPATH and pass it down into the modules build. Some NFS setups
  make the find it does extremely expensive, so compute it only
  once. Also make sure the 'traditional' module building method works at
  the expense of a bit of duplicated code.

Modified:
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kern.pre.mk
==
--- head/sys/conf/kern.pre.mk   Sat Jul  4 03:15:42 2015(r285123)
+++ head/sys/conf/kern.pre.mk   Sat Jul  4 05:43:45 2015(r285124)
@@ -198,6 +198,12 @@ SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symb
${SIZE} ${.TARGET} ; chmod 755 ${.TARGET}
 SYSTEM_DEP+= ${LDSCRIPT}
 
+# Calculate path for .m files early, if needed.
+.if !defined(_MPATH)
+__MPATH!=find ${S:tA}/ -name \*_if.m
+_MPATH=${__MPATH:H:O:u}
+.endif
+
 # MKMODULESENV is set here so that port makefiles can augment
 # them.
 
@@ -214,6 +220,7 @@ MKMODULESENV+=  MODULES_OVERRIDE="${MODUL
 .if defined(DEBUG)
 MKMODULESENV+= DEBUG_FLAGS="${DEBUG}"
 .endif
+MKMODULESENV+= _MPATH="${_MPATH}"
 
 # Detect kernel config options that force stack frames to be turned on.
 DDB_ENABLED!=  grep DDB opt_ddb.h || true ; echo

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Sat Jul  4 03:15:42 2015(r285123)
+++ head/sys/conf/kmod.mk   Sat Jul  4 05:43:45 2015(r285124)
@@ -355,8 +355,10 @@ vnode_if_typedef.h:
 .endif
 
 # Build _if.[ch] from _if.m, and clean them when we're done.
+.if !defined(_MPATH)
 __MPATH!=find ${SYSDIR:tA}/ -name \*_if.m
 _MPATH=${__MPATH:H:O:u}
+.endif
 .PATH.m: ${_MPATH}
 .for _s in ${SRCS:M*_if.[ch]}
 .if eixsts(${_s:R}.m})
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r285125 - in head/sys: kern sys

2015-07-03 Thread Mateusz Guzik
Author: mjg
Date: Sat Jul  4 06:54:15 2015
New Revision: 285125
URL: https://svnweb.freebsd.org/changeset/base/285125

Log:
  sysctl: switch sysctllock to a sleepable rmlock
  
  The lock is almost never taken for writing.

Modified:
  head/sys/kern/kern_linker.c
  head/sys/kern/kern_sysctl.c
  head/sys/kern/vfs_init.c
  head/sys/sys/sysctl.h

Modified: head/sys/kern/kern_linker.c
==
--- head/sys/kern/kern_linker.c Sat Jul  4 05:43:45 2015(r285124)
+++ head/sys/kern/kern_linker.c Sat Jul  4 06:54:15 2015(r285125)
@@ -292,10 +292,10 @@ linker_file_register_sysctls(linker_file
return;
 
sx_xunlock(&kld_sx);
-   sysctl_xlock();
+   sysctl_wlock();
for (oidp = start; oidp < stop; oidp++)
sysctl_register_oid(*oidp);
-   sysctl_xunlock();
+   sysctl_wunlock();
sx_xlock(&kld_sx);
 }
 
@@ -313,10 +313,10 @@ linker_file_unregister_sysctls(linker_fi
return;
 
sx_xunlock(&kld_sx);
-   sysctl_xlock();
+   sysctl_wlock();
for (oidp = start; oidp < stop; oidp++)
sysctl_unregister_oid(*oidp);
-   sysctl_xunlock();
+   sysctl_wunlock();
sx_xlock(&kld_sx);
 }
 

Modified: head/sys/kern/kern_sysctl.c
==
--- head/sys/kern/kern_sysctl.c Sat Jul  4 05:43:45 2015(r285124)
+++ head/sys/kern/kern_sysctl.c Sat Jul  4 06:54:15 2015(r285125)
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -77,7 +78,7 @@ static MALLOC_DEFINE(M_SYSCTLTMP, "sysct
  * The sysctllock protects the MIB tree.  It also protects sysctl
  * contexts used with dynamic sysctls.  The sysctl_register_oid() and
  * sysctl_unregister_oid() routines require the sysctllock to already
- * be held, so the sysctl_xlock() and sysctl_xunlock() routines are
+ * be held, so the sysctl_wlock() and sysctl_wunlock() routines are
  * provided for the few places in the kernel which need to use that
  * API rather than using the dynamic API.  Use of the dynamic API is
  * strongly encouraged for most code.
@@ -86,20 +87,21 @@ static MALLOC_DEFINE(M_SYSCTLTMP, "sysct
  * sysctl requests.  This is implemented by serializing any userland
  * sysctl requests larger than a single page via an exclusive lock.
  */
-static struct sx sysctllock;
+static struct rmlock sysctllock;
 static struct sx sysctlmemlock;
 
-#defineSYSCTL_XLOCK()  sx_xlock(&sysctllock)
-#defineSYSCTL_XUNLOCK()sx_xunlock(&sysctllock)
-#defineSYSCTL_SLOCK()  sx_slock(&sysctllock)
-#defineSYSCTL_SUNLOCK()sx_sunlock(&sysctllock)
-#defineSYSCTL_XLOCKED()sx_xlocked(&sysctllock)
-#defineSYSCTL_ASSERT_LOCKED()  sx_assert(&sysctllock, SA_LOCKED)
-#defineSYSCTL_ASSERT_XLOCKED() sx_assert(&sysctllock, SA_XLOCKED)
-#defineSYSCTL_ASSERT_SLOCKED() sx_assert(&sysctllock, SA_SLOCKED)
-#defineSYSCTL_INIT()   sx_init(&sysctllock, "sysctl lock")
+#defineSYSCTL_WLOCK()  do { printf("wlocked!\n"); 
rm_wlock(&sysctllock); } while (0)
+#defineSYSCTL_WUNLOCK()rm_wunlock(&sysctllock)
+#defineSYSCTL_RLOCK(tracker)   rm_rlock(&sysctllock, (tracker))
+#defineSYSCTL_RUNLOCK(tracker) rm_runlock(&sysctllock, (tracker))
+#defineSYSCTL_WLOCKED()rm_wowned(&sysctllock)
+#defineSYSCTL_ASSERT_LOCKED()  rm_assert(&sysctllock, RA_LOCKED)
+#defineSYSCTL_ASSERT_WLOCKED() rm_assert(&sysctllock, RA_WLOCKED)
+#defineSYSCTL_ASSERT_RLOCKED() rm_assert(&sysctllock, RA_RLOCKED)
+#defineSYSCTL_INIT()   rm_init_flags(&sysctllock, "sysctl 
lock", \
+   RM_SLEEPABLE)
 #defineSYSCTL_SLEEP(ch, wmesg, timo)   
\
-   sx_sleep(ch, &sysctllock, 0, wmesg, timo)
+   rm_sleep(ch, &sysctllock, 0, wmesg, timo)
 
 static int sysctl_root(SYSCTL_HANDLER_ARGS);
 
@@ -112,26 +114,23 @@ static intsysctl_old_kernel(struct sysc
 static int sysctl_new_kernel(struct sysctl_req *, void *, size_t);
 
 static void
-sysctl_lock(bool xlock)
+sysctl_lock(struct rm_priotracker *tracker)
 {
 
-   if (xlock)
-   SYSCTL_XLOCK();
+   if (tracker != NULL)
+   SYSCTL_RLOCK(tracker);
else
-   SYSCTL_SLOCK();
+   SYSCTL_WLOCK();
 }
 
-static bool
-sysctl_unlock(void)
+static void
+sysctl_unlock(struct rm_priotracker *tracker)
 {
-   bool xlocked;
 
-   xlocked = SYSCTL_XLOCKED();
-   if (xlocked)
-   SYSCTL_XUNLOCK();
+   if (tracker != NULL)
+   SYSCTL_RUNLOCK(tracker);
else
-   SYSCTL_SUNLOCK();
-   return (xlocked);
+