Re: svn commit: r282132 - head/sys/netipsec

2015-05-12 Thread Ermal Luçi
Hello Andrey,

do you plan to MFC this one?

On Tue, Apr 28, 2015 at 11:29 AM, Andrey V. Elsukov  wrote:

> Author: ae
> Date: Tue Apr 28 09:29:28 2015
> New Revision: 282132
> URL: https://svnweb.freebsd.org/changeset/base/282132
>
> Log:
>   Since PFIL can change mbuf pointer, we should update pointers after
>   calling ipsec_filter().
>
>   Sponsored by: Yandex LLC
>
> Modified:
>   head/sys/netipsec/ipsec_input.c
>   head/sys/netipsec/ipsec_output.c
>
> Modified: head/sys/netipsec/ipsec_input.c
>
> ==
> --- head/sys/netipsec/ipsec_input.c Tue Apr 28 09:19:40 2015
> (r282131)
> +++ head/sys/netipsec/ipsec_input.c Tue Apr 28 09:29:28 2015
> (r282132)
> @@ -391,6 +391,7 @@ ipsec4_common_input_cb(struct mbuf *m, s
> ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_BEFORE);
> if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0)
> return (error);
> +   ip = mtod(m, struct ip *);
>  #endif /* DEV_ENC */
>
> /* IP-in-IP encapsulation */
>
> Modified: head/sys/netipsec/ipsec_output.c
>
> ==
> --- head/sys/netipsec/ipsec_output.cTue Apr 28 09:19:40 2015
> (r282131)
> +++ head/sys/netipsec/ipsec_output.cTue Apr 28 09:29:28 2015
> (r282132)
> @@ -578,6 +578,7 @@ ipsec4_process_packet(struct mbuf *m, st
> /* pass the mbuf to enc0 for packet filtering */
> if ((error = ipsec_filter(&m, PFIL_OUT, ENC_OUT|ENC_BEFORE)) != 0)
> goto bad;
> +   ip = mtod(m, struct ip *);
>  #endif
> /* Do the appropriate encapsulation, if necessary */
> if (isr->saidx.mode == IPSEC_MODE_TUNNEL || /* Tunnel requ'd */
> @@ -699,6 +700,7 @@ ipsec6_process_packet(struct mbuf *m, st
> /* pass the mbuf to enc0 for packet filtering */
> if ((error = ipsec_filter(&m, PFIL_OUT, ENC_OUT|ENC_BEFORE)) != 0)
> goto bad;
> +   ip6 = mtod(m, struct ip6_hdr *);
>  #endif /* DEV_ENC */
>
> /* Do the appropriate encapsulation, if necessary */
>
>


-- 
Ermal
___
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: r282809 - in head: sbin/ifconfig sys/net sys/sys

2015-05-12 Thread Andrey V. Elsukov
Author: ae
Date: Tue May 12 07:37:27 2015
New Revision: 282809
URL: https://svnweb.freebsd.org/changeset/base/282809

Log:
  Add new socket ioctls SIOC[SG]TUNFIB to set FIB number of encapsulated
  packets on tunnel interfaces. Add support of these ioctls to gre(4),
  gif(4) and me(4) interfaces. For incoming packets M_SETFIB() should use
  if_fib value from ifnet structure, use proper value in gre(4) and me(4).
  
  Differential Revision:https://reviews.freebsd.org/D2462
  No objection from:#network
  MFC after:2 weeks
  Sponsored by: Yandex LLC

Modified:
  head/sbin/ifconfig/ifconfig.8
  head/sbin/ifconfig/iffib.c
  head/sys/net/if_gif.c
  head/sys/net/if_gre.c
  head/sys/net/if_me.c
  head/sys/sys/sockio.h

Modified: head/sbin/ifconfig/ifconfig.8
==
--- head/sbin/ifconfig/ifconfig.8   Tue May 12 05:42:13 2015
(r282808)
+++ head/sbin/ifconfig/ifconfig.8   Tue May 12 07:37:27 2015
(r282809)
@@ -316,6 +316,14 @@ using the
 kernel configuration option, or the
 .Va net.fibs
 tunable.
+.It Cm tunnelfib Ar fib_number
+Specify tunnel FIB.
+A FIB
+.Ar fib_number
+is assigned to all packets encapsulated by tunnel interface, e.g.,
+.Xr gif 4
+and
+.Xr gre 4 .
 .It Cm maclabel Ar label
 If Mandatory Access Control support is enabled in the kernel,
 set the MAC label to

Modified: head/sbin/ifconfig/iffib.c
==
--- head/sbin/ifconfig/iffib.c  Tue May 12 05:42:13 2015(r282808)
+++ head/sbin/ifconfig/iffib.c  Tue May 12 07:37:27 2015(r282809)
@@ -50,15 +50,15 @@ fib_status(int s)
 
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+   if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) == 0 &&
+   ifr.ifr_fib != RT_DEFAULT_FIB)
+   printf("\tfib: %u\n", ifr.ifr_fib);
 
-   if (ioctl(s, SIOCGIFFIB, (caddr_t)&ifr) < 0)
-   return;
-
-   /* Ignore if it is the default. */
-   if (ifr.ifr_fib == 0)
-   return;
-
-   printf("\tfib: %u\n", ifr.ifr_fib);
+   memset(&ifr, 0, sizeof(ifr));
+   strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+   if (ioctl(s, SIOCGTUNFIB, (caddr_t)&ifr) == 0 &&
+   ifr.ifr_fib != RT_DEFAULT_FIB)
+   printf("\ttunnelfib: %u\n", ifr.ifr_fib);
 }
 
 static void
@@ -80,8 +80,28 @@ setiffib(const char *val, int dummy __un
warn("ioctl (SIOCSIFFIB)");
 }
 
+static void
+settunfib(const char *val, int dummy __unused, int s,
+const struct afswtch *afp)
+{
+   unsigned long fib;
+   char *ep;
+
+   fib = strtoul(val, &ep, 0);
+   if (*ep != '\0' || fib > UINT_MAX) {
+   warn("fib %s not valid", val);
+   return;
+   }
+
+   strncpy(ifr.ifr_name, name, sizeof (ifr.ifr_name));
+   ifr.ifr_fib = fib;
+   if (ioctl(s, SIOCSTUNFIB, (caddr_t)&ifr) < 0)
+   warn("ioctl (SIOCSTUNFIB)");
+}
+
 static struct cmd fib_cmds[] = {
DEF_CMD_ARG("fib", setiffib),
+   DEF_CMD_ARG("tunnelfib", settunfib),
 };
 
 static struct afswtch af_fib = {

Modified: head/sys/net/if_gif.c
==
--- head/sys/net/if_gif.c   Tue May 12 05:42:13 2015(r282808)
+++ head/sys/net/if_gif.c   Tue May 12 07:37:27 2015(r282809)
@@ -920,6 +920,17 @@ gif_ioctl(struct ifnet *ifp, u_long cmd,
 #endif
}
break;
+   case SIOCGTUNFIB:
+   ifr->ifr_fib = sc->gif_fibnum;
+   break;
+   case SIOCSTUNFIB:
+   if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0)
+   break;
+   if (ifr->ifr_fib >= rt_numfibs)
+   error = EINVAL;
+   else
+   sc->gif_fibnum = ifr->ifr_fib;
+   break;
case GIFGOPTS:
options = sc->gif_options;
error = copyout(&options, ifr->ifr_data, sizeof(options));
@@ -935,7 +946,6 @@ gif_ioctl(struct ifnet *ifp, u_long cmd,
else
sc->gif_options = options;
break;
-
default:
error = EINVAL;
break;

Modified: head/sys/net/if_gre.c
==
--- head/sys/net/if_gre.c   Tue May 12 05:42:13 2015(r282808)
+++ head/sys/net/if_gre.c   Tue May 12 07:37:27 2015(r282809)
@@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #ifdef INET
@@ -441,6 +442,17 @@ gre_ioctl(struct ifnet *ifp, u_long cmd,
 #endif
}
break;
+   case SIOCGTUNFIB:
+   ifr->ifr_fib = sc->gre_fibnum;
+   break;
+   case SIOCSTUNFIB:
+   if ((e

Re: svn commit: r282808 - head/lib/liblzma

2015-05-12 Thread Baptiste Daroussin
On Tue, May 12, 2015 at 05:42:13AM +, Xin LI wrote:
> Author: delphij
> Date: Tue May 12 05:42:13 2015
> New Revision: 282808
> URL: https://svnweb.freebsd.org/changeset/base/282808
> 
> Log:
>   Revert r282775 for now.  The added dependency would cause problems for
>   e.g. ports-mgmt/pkg and we would like to do an exp-build.
>   
>   Requested by:   bdrewery
> 
> Modified:
>   head/lib/liblzma/Makefile
>   head/lib/liblzma/Symbol.map
>   head/lib/liblzma/config.h
> 
> Modified: head/lib/liblzma/Makefile
> ==
> --- head/lib/liblzma/Makefile Tue May 12 03:49:18 2015(r282807)
> +++ head/lib/liblzma/Makefile Tue May 12 05:42:13 2015(r282808)
> @@ -77,7 +77,8 @@ SRCS+=  common.c \
>  .PATH: ${LZMADIR}/check
>  SRCS+=   check.c \
>   crc32_table.c \
> - crc64_table.c
> + crc64_table.c \
> + sha256.c
>  .if defined(MACHINE_ARCH) && ${MACHINE_ARCH} == "i386"
>  SRCS+=   crc32_x86.S \
>   crc64_x86.S
> @@ -145,7 +146,7 @@ CFLAGS+=  -DHAVE_CONFIG_H \
>   -I${LZMADIR}/simple \
>   -I${LZMADIR}/../common
>  
> -LIBADD+= md pthread
> +LIBADD+= pthread

If you are on doing that you should at least modify as well the lzma .pc file
to that anything asking for pkg-config --libs will provide -lmd, should be the
Libs.private field

Also note that this will not solve the pkg case :)

Best regards,
Bapt


pgpvdMHxLT208.pgp
Description: PGP signature


svn commit: r282810 - head/sys/netinet

2015-05-12 Thread Michael Tuexen
Author: tuexen
Date: Tue May 12 08:08:16 2015
New Revision: 282810
URL: https://svnweb.freebsd.org/changeset/base/282810

Log:
  Ensure that the COOKIE-ACK can be sent over UDP if the COOKIE-ECHO was
  received over UDP.
  Thanks to Felix Weinrank for makeing me aware of the problem and to
  Irene Ruengeler for providing the fix.
  
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_input.c

Modified: head/sys/netinet/sctp_input.c
==
--- head/sys/netinet/sctp_input.c   Tue May 12 07:37:27 2015
(r282809)
+++ head/sys/netinet/sctp_input.c   Tue May 12 08:08:16 2015
(r282810)
@@ -2325,12 +2325,13 @@ sctp_process_cookie_new(struct mbuf *m, 
sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE)) {
sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb, NULL);
}
-   /* calculate the RTT */
(void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered);
if ((netp) && (*netp)) {
+   /* calculate the RTT and set the encaps port */
(*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp,
&cookie->time_entered, sctp_align_unsafe_makecopy,
SCTP_RTT_FROM_NON_DATA);
+   (*netp)->port = port;
}
/* respond with a COOKIE-ACK */
sctp_send_cookie_ack(stcb);
___
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: r282132 - head/sys/netipsec

2015-05-12 Thread Andrey V. Elsukov
On 12.05.2015 10:25, Ermal Luçi wrote:
> Hello Andrey,
> 
> do you plan to MFC this one?
> 
> On Tue, Apr 28, 2015 at 11:29 AM, Andrey V. Elsukov  > wrote:
> 
> Author: ae
> Date: Tue Apr 28 09:29:28 2015
> New Revision: 282132
> URL: https://svnweb.freebsd.org/changeset/base/282132
> 
> Log:
>   Since PFIL can change mbuf pointer, we should update pointers after
>   calling ipsec_filter().

Hi,

it looks like there are more revisions should be merged before this one.
But probably this will break your IPSec implementation :)

-- 
WBR, Andrey V. Elsukov



signature.asc
Description: OpenPGP digital signature


svn commit: r282812 - head/sys/arm/amlogic/aml8726

2015-05-12 Thread Ganbold Tsagaankhuu
Author: ganbold
Date: Tue May 12 08:53:54 2015
New Revision: 282812
URL: https://svnweb.freebsd.org/changeset/base/282812

Log:
  Disable WPI in case of aml8726-m3.
  The aml8726-m3 SoC is identified as a Cortex A9-r2 rev 4 CPU and
  it hangs sometimes during the boot when WFI is used by the kernel.
  
  Differential Revision:  https://reviews.freebsd.org/D2473
  Submitted by:   John Wehle
  Suggested by:   ian@

Modified:
  head/sys/arm/amlogic/aml8726/aml8726_machdep.c

Modified: head/sys/arm/amlogic/aml8726/aml8726_machdep.c
==
--- head/sys/arm/amlogic/aml8726/aml8726_machdep.c  Tue May 12 08:52:50 
2015(r282811)
+++ head/sys/arm/amlogic/aml8726/aml8726_machdep.c  Tue May 12 08:53:54 
2015(r282812)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -114,6 +115,19 @@ platform_gpio_init(void)
aml8726_identify_soc();
 
/*
+* My aml8726-m3 development box which identifies the CPU as
+* a Cortex A9-r2 rev 4 randomly locks up during boot when WFI
+* is used.
+*/
+   switch (aml8726_soc_hw_rev) {
+   case AML_SOC_HW_REV_M3:
+   cpufuncs.cf_sleep = (void *)cpufunc_nullop;
+   break;
+   default:
+   break;
+   }
+
+   /*
 * This FDT fixup should arguably be called through fdt_fixup_table,
 * however currently there's no mechanism to specify a fixup which
 * should always be invoked.
___
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: r282816 - in head/lib/libc/arm: . aeabi gen

2015-05-12 Thread Andrew Turner
Author: andrew
Date: Tue May 12 10:03:14 2015
New Revision: 282816
URL: https://svnweb.freebsd.org/changeset/base/282816

Log:
  Teach bits of libc about Thumb. This adds the if-then instructions needed
  to handle the ARM conditional execution.
  
  While here fix a bug found by this in the hard-float code, cc is the
  opposite of cs. The former is used for 'less than' in floating-point code
  and is executed when the C (carry) bit is clear, the latter is used when
  greater than, equal, or unordered, and is executed when the C bit is set.

Modified:
  head/lib/libc/arm/SYS.h
  head/lib/libc/arm/aeabi/aeabi_vfp_double.S
  head/lib/libc/arm/aeabi/aeabi_vfp_float.S
  head/lib/libc/arm/gen/_setjmp.S
  head/lib/libc/arm/gen/setjmp.S

Modified: head/lib/libc/arm/SYS.h
==
--- head/lib/libc/arm/SYS.h Tue May 12 09:35:50 2015(r282815)
+++ head/lib/libc/arm/SYS.h Tue May 12 10:03:14 2015(r282816)
@@ -62,6 +62,7 @@
 
 #define _SYSCALL(x)\
_SYSCALL_NOERROR(x);\
+   it  cs; \
bcs PIC_SYM(CERROR, PLT)
 
 #define SYSCALL(x) \
@@ -72,6 +73,7 @@
.weak _C_LABEL(__CONCAT(_,x));  \
.set _C_LABEL(__CONCAT(_,x)),_C_LABEL(__CONCAT(__sys_,x));  \
SYSTRAP(x); \
+   it  cs; \
bcs PIC_SYM(CERROR, PLT);   \
RET
 

Modified: head/lib/libc/arm/aeabi/aeabi_vfp_double.S
==
--- head/lib/libc/arm/aeabi/aeabi_vfp_double.S  Tue May 12 09:35:50 2015
(r282815)
+++ head/lib/libc/arm/aeabi/aeabi_vfp_double.S  Tue May 12 10:03:14 2015
(r282816)
@@ -66,6 +66,7 @@ AEABI_ENTRY(dcmpeq)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+   ite  ne
movner0, #0
moveqr0, #1
RET
@@ -77,8 +78,9 @@ AEABI_ENTRY(dcmplt)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+   ite  cs
movcsr0, #0
-   movltr0, #1
+   movccr0, #1
RET
 AEABI_END(dcmplt)
 
@@ -88,6 +90,7 @@ AEABI_ENTRY(dcmple)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+   ite  hi
movhir0, #0
movlsr0, #1
RET
@@ -99,6 +102,7 @@ AEABI_ENTRY(dcmpge)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+   ite  lt
movltr0, #0
movger0, #1
RET
@@ -110,6 +114,7 @@ AEABI_ENTRY(dcmpgt)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+   ite  le
movler0, #0
movgtr0, #1
RET
@@ -121,6 +126,7 @@ AEABI_ENTRY(dcmpun)
LOAD_DREG(d1, r2, r3)
vcmp.f64 d0, d1
vmrs APSR_nzcv, fpscr
+   ite  vc
movvcr0, #0
movvsr0, #1
RET

Modified: head/lib/libc/arm/aeabi/aeabi_vfp_float.S
==
--- head/lib/libc/arm/aeabi/aeabi_vfp_float.S   Tue May 12 09:35:50 2015
(r282815)
+++ head/lib/libc/arm/aeabi/aeabi_vfp_float.S   Tue May 12 10:03:14 2015
(r282816)
@@ -62,6 +62,7 @@ AEABI_ENTRY(fcmpeq)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+   ite  ne
movner0, #0
moveqr0, #1
RET
@@ -72,8 +73,9 @@ AEABI_ENTRY(fcmplt)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+   ite  cs
movcsr0, #0
-   movltr0, #1
+   movccr0, #1
RET
 AEABI_END(fcmplt)
 
@@ -82,6 +84,7 @@ AEABI_ENTRY(fcmple)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+   ite  hi
movhir0, #0
movlsr0, #1
RET
@@ -92,6 +95,7 @@ AEABI_ENTRY(fcmpge)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+   ite  lt
movltr0, #0
movger0, #1
RET
@@ -102,6 +106,7 @@ AEABI_ENTRY(fcmpgt)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+   ite  le
movler0, #0
movgtr0, #1
RET
@@ -112,6 +117,7 @@ AEABI_ENTRY(fcmpun)
LOAD_SREGS(s0, s1, r0, r1)
vcmp.f32 s0, s1
vmrs APSR_nzcv, fpscr
+   ite  vc
movvcr0, #0
movvsr0, #1
RET

Modified: hea

svn commit: r282817 - head/sys/ofed/drivers/net/mlx4

2015-05-12 Thread Hans Petter Selasky
Author: hselasky
Date: Tue May 12 11:52:34 2015
New Revision: 282817
URL: https://svnweb.freebsd.org/changeset/base/282817

Log:
  Apply proper locking when iterating the multicast addresses and add a
  missing check for NULL from a non-blocking "kzalloc()" function call.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies
  Found by: glebius @

Modified:
  head/sys/ofed/drivers/net/mlx4/en_netdev.c

Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c
==
--- head/sys/ofed/drivers/net/mlx4/en_netdev.c  Tue May 12 10:03:14 2015
(r282816)
+++ head/sys/ofed/drivers/net/mlx4/en_netdev.c  Tue May 12 11:52:34 2015
(r282817)
@@ -650,6 +650,7 @@ static void mlx4_en_cache_mclist(struct 
struct mlx4_en_mc_list *tmp;
struct mlx4_en_priv *priv = netdev_priv(dev);
 
+if_maddr_rlock(dev);
 TAILQ_FOREACH(ifma, &dev->if_multiaddrs, ifma_link) {
 if (ifma->ifma_addr->sa_family != AF_LINK)
 continue;
@@ -658,10 +659,13 @@ static void mlx4_en_cache_mclist(struct 
 continue;
 /* Make sure the list didn't grow. */
tmp = kzalloc(sizeof(struct mlx4_en_mc_list), GFP_ATOMIC);
+   if (tmp == NULL)
+   break;
memcpy(tmp->addr,
LLADDR((struct sockaddr_dl *)ifma->ifma_addr), 
ETH_ALEN);
list_add_tail(&tmp->list, &priv->mc_list);
 }
+if_maddr_runlock(dev);
 }
 
 static void update_mclist_flags(struct mlx4_en_priv *priv,
___
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: r282808 - head/lib/liblzma

2015-05-12 Thread Bryan Drewery
On 5/12/2015 12:42 AM, Xin LI wrote:
> Author: delphij
> Date: Tue May 12 05:42:13 2015
> New Revision: 282808
> URL: https://svnweb.freebsd.org/changeset/base/282808
> 
> Log:
>   Revert r282775 for now.  The added dependency would cause problems for
>   e.g. ports-mgmt/pkg and we would like to do an exp-build.
>   
>   Requested by:   bdrewery
> 
> Modified:
>   head/lib/liblzma/Makefile
>   head/lib/liblzma/Symbol.map
>   head/lib/liblzma/config.h
> 

Thank you.

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r282736 - in head: . lib/libmd

2015-05-12 Thread Thomas Quinot
* Xin Li, 2015-05-12 :

> On 05/11/15 17:23, Bryan Drewery wrote:
> > The libmd changes break pkg - so all packages.
> > 
> > http://beefy6.nyi.freebsd.org/data/head-amd64-default/p386108_s282785/
> logs/pkg-1.5.2.log
> >
> > 
> > 
> >> CCLD pkg-static /usr/lib/liblzma.a(check.o): In function
> >> `lzma_check_init': 
> >> /usr/local/poudriere/jails/head-amd64/usr/src/lib/liblzma/../../contr
> ib/xz/src/liblzma/check/check.c:(.text+0x5e):
> >> undefined reference to `_libmd_SHA256_Init' 
> >> /usr/lib/liblzma.a(check.o): In function `lzma_check_update': 
> >> /usr/local/poudriere/jails/head-amd64/usr/src/lib/liblzma/../../contr
> ib/xz/src/liblzma/check/check.c:(.text+0xbf):
> >> undefined reference to `_libmd_SHA256_Update' 
> >> /usr/lib/liblzma.a(check.o): In function `lzma_check_finish': 
> >> /usr/local/poudriere/jails/head-amd64/usr/src/lib/liblzma/../../contr
> ib/xz/src/liblzma/check/check.c:(.text+0x10d):
> >> undefined reference to `_libmd_SHA256_Final' cc: error: linker
> >> command failed with exit code 1 (use -v to see invocation) ***
> >> [pkg-static] Error code 1
> > 
> > 
> > Can you please just revert this and 282726 until they are working
> > and have a passing exp-run?
> 
> Looks like this is because my change (r282775) which makes libmd a
> dependency of liblzma, while pkg didn't catch up with, and it's
> unrelated to libmd change.
> 
> A quick hack would be:
> 
> - --- src/Makefile.in.orig2015-05-11 17:49:52.690333554 -0700
> +++ src/Makefile.in   2015-05-11 17:50:03.427853585 -0700
> @@ -617,7 +617,7 @@
>   $(top_builddir)/compat/libbsd_compat.la \
>   $(top_builddir)/external/libsbuf_static.la $(pkg_OBJECTS) \
>   @LIBJAIL_LIB@ @LDNS_LIBS@ @OS_LIBS@ -larchive -lz -lutil -lbz2 \
> - -   -llzma -lssl -lcrypto -lm $(am__append_1) $(am__append_2) \
> + -lmd -llzma -lssl -lcrypto -lm $(am__append_1) $(am__append_2) \
>   $(am__append_3)
>  DYNPROG = pkg
>  @BUILD_STATIC_TRUE@pkg_static_LDFLAGS = -all-static
> 
> But it would break earlier FreeBSD.  Should I revert my change and
> request for a exp-run?

Xin,

I'm assuming you are taking the lead on fixing this part. Could you
please let me know if I can contribute, or if any change I made so
far needs to be reverted?

Thanks!
Thomas.

___
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: r282820 - head/sys/net80211

2015-05-12 Thread Adrian Chadd
Author: adrian
Date: Tue May 12 16:55:50 2015
New Revision: 282820
URL: https://svnweb.freebsd.org/changeset/base/282820

Log:
  Do not check sequence number for QoS Null frames; set it for generated QoS 
Null
  frames to 0
  
  From IEEE Std. 802.11-2012, 8.3.2.1 "Data frame format", p. 415 (513):
  "The Sequence Control field for QoS (+)Null frames is ignored by the receiver
  upon reception."
  
  At this moment, any _input() function interprets them as regular QoS 
data
  frames with TID = 0. As a result, stations, that use another TX sequence for
  QoS Null frames (e.g. wpi(4), where (QoS) Null frames are generated by the
  firmware), may experience significant packet loss with any other NIC in hostap
  mode.
  
  Tested:
  
  * wpi(4) (author)
  * iwn(4) - Intel 5100, STA mode (me)
  
  PR:   kern/200128
  Submitted by: Andriy Voskoboinyk 

Modified:
  head/sys/net80211/ieee80211.h
  head/sys/net80211/ieee80211_adhoc.c
  head/sys/net80211/ieee80211_hostap.c
  head/sys/net80211/ieee80211_input.h
  head/sys/net80211/ieee80211_output.c
  head/sys/net80211/ieee80211_sta.c
  head/sys/net80211/ieee80211_wds.c

Modified: head/sys/net80211/ieee80211.h
==
--- head/sys/net80211/ieee80211.h   Tue May 12 16:36:54 2015
(r282819)
+++ head/sys/net80211/ieee80211.h   Tue May 12 16:55:50 2015
(r282820)
@@ -169,6 +169,11 @@ struct ieee80211_qosframe_addr4 {
 #defineIEEE80211_FC1_PROTECTED 0x40
 #defineIEEE80211_FC1_ORDER 0x80
 
+#define IEEE80211_HAS_SEQ(type, subtype) \
+   ((type) != IEEE80211_FC0_TYPE_CTL && \
+   !((type) == IEEE80211_FC0_TYPE_DATA && \
+((subtype) & IEEE80211_FC0_SUBTYPE_QOS_NULL) == \
+ IEEE80211_FC0_SUBTYPE_QOS_NULL))
 #defineIEEE80211_SEQ_FRAG_MASK 0x000f
 #defineIEEE80211_SEQ_FRAG_SHIFT0
 #defineIEEE80211_SEQ_SEQ_MASK  0xfff0

Modified: head/sys/net80211/ieee80211_adhoc.c
==
--- head/sys/net80211/ieee80211_adhoc.c Tue May 12 16:36:54 2015
(r282819)
+++ head/sys/net80211/ieee80211_adhoc.c Tue May 12 16:55:50 2015
(r282820)
@@ -291,7 +291,6 @@ doprint(struct ieee80211vap *vap, int su
 static int
 adhoc_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
 {
-#defineHAS_SEQ(type)   ((type & 0x4) == 0)
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
struct ifnet *ifp = vap->iv_ifp;
@@ -414,7 +413,8 @@ adhoc_input(struct ieee80211_node *ni, s
}
IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
ni->ni_noise = nf;
-   if (HAS_SEQ(type) && IEEE80211_ADDR_EQ(wh->i_addr2, 
ni->ni_macaddr)) {
+   if (IEEE80211_HAS_SEQ(type, subtype) &&
+   IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) {
uint8_t tid = ieee80211_gettid(wh);
if (IEEE80211_QOS_HAS_SEQ(wh) &&
TID_TO_WME_AC(tid) >= WME_AC_VI)

Modified: head/sys/net80211/ieee80211_hostap.c
==
--- head/sys/net80211/ieee80211_hostap.cTue May 12 16:36:54 2015
(r282819)
+++ head/sys/net80211/ieee80211_hostap.cTue May 12 16:55:50 2015
(r282820)
@@ -478,7 +478,6 @@ doprint(struct ieee80211vap *vap, int su
 static int
 hostap_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
 {
-#defineHAS_SEQ(type)   ((type & 0x4) == 0)
struct ieee80211vap *vap = ni->ni_vap;
struct ieee80211com *ic = ni->ni_ic;
struct ifnet *ifp = vap->iv_ifp;
@@ -571,7 +570,7 @@ hostap_input(struct ieee80211_node *ni, 
 
IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
ni->ni_noise = nf;
-   if (HAS_SEQ(type)) {
+   if (IEEE80211_HAS_SEQ(type, subtype)) {
uint8_t tid = ieee80211_gettid(wh);
if (IEEE80211_QOS_HAS_SEQ(wh) &&
TID_TO_WME_AC(tid) >= WME_AC_VI)

Modified: head/sys/net80211/ieee80211_input.h
==
--- head/sys/net80211/ieee80211_input.h Tue May 12 16:36:54 2015
(r282819)
+++ head/sys/net80211/ieee80211_input.h Tue May 12 16:55:50 2015
(r282820)
@@ -168,19 +168,22 @@ ieee80211_check_rxseq(struct ieee80211_n
 {
 #defineSEQ_LEQ(a,b)((int)((a)-(b)) <= 0)
 #defineSEQ_EQ(a,b) ((int)((a)-(b)) == 0)
-#defineHAS_SEQ(type)   ((type & 0x4) == 0)
 #defineSEQNO(a)((a) >> IEEE80211_SEQ_SEQ_SHIFT)
 #defineFRAGNO(a)   ((a) & IEEE80211_SEQ_FRAG_MASK)
uint16_t rxseq;
-   uint8_t type;
+

svn commit: r282821 - in head: . lib

2015-05-12 Thread Ed Maste
Author: emaste
Date: Tue May 12 17:53:22 2015
New Revision: 282821
URL: https://svnweb.freebsd.org/changeset/base/282821

Log:
  Remove redundant csu subdir logic
  
  The appropriate subdirectories are handled by lib/csu/Makefile. There's
  no need to duplicate this logic in Makefile.inc1 and lib/Makefile.
  
  Reviewed by:  imp
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D2523

Modified:
  head/Makefile.inc1
  head/lib/Makefile

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue May 12 16:55:50 2015(r282820)
+++ head/Makefile.inc1  Tue May 12 17:53:22 2015(r282821)
@@ -1660,13 +1660,7 @@ _prereq_libs= gnu/lib/libssp/libssp_nons
 # all shared libraries for ELF.
 #
 _startup_libs= gnu/lib/csu
-.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
-_startup_libs+=lib/csu/${MACHINE_ARCH}-elf
-.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
-_startup_libs+=lib/csu/${MACHINE_ARCH}
-.else
-_startup_libs+=lib/csu/${MACHINE_CPUARCH}
-.endif
+_startup_libs+=lib/csu
 _startup_libs+=gnu/lib/libgcc
 _startup_libs+=lib/libcompiler_rt
 _startup_libs+=lib/libc

Modified: head/lib/Makefile
==
--- head/lib/Makefile   Tue May 12 16:55:50 2015(r282820)
+++ head/lib/Makefile   Tue May 12 17:53:22 2015(r282821)
@@ -8,7 +8,7 @@
 # and the main list to avoid needing a SUBDIR_DEPEND line on every library
 # naming just these few items.
 
-SUBDIR_ORDERED=${_csu} \
+SUBDIR_ORDERED=csu \
.WAIT \
libc \
libc_nonshared \
@@ -156,16 +156,6 @@ SUBDIR_DEPEND_libulog= libmd
 SUBDIR_DEPEND_libunbound= ${_libldns}
 SUBDIR_DEPEND_liblzma= ${_libthr}
 
-.if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf)
-_csu=csu/${MACHINE_ARCH}-elf
-.elif exists(${.CURDIR}/csu/${MACHINE_ARCH})
-_csu=csu/${MACHINE_ARCH}
-.elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile)
-_csu=csu/${MACHINE_CPUARCH}
-.else
-_csu=csu
-.endif
-
 # NB: keep these sorted by MK_* knobs
 
 .if ${MK_ATM} != "no"
___
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: r282824 - head/usr.sbin/crunch/crunchide

2015-05-12 Thread Ed Maste
Author: emaste
Date: Tue May 12 20:04:17 2015
New Revision: 282824
URL: https://svnweb.freebsd.org/changeset/base/282824

Log:
  crunchide: remove EOL whitespace

Modified:
  head/usr.sbin/crunch/crunchide/exec_elf32.c

Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c
==
--- head/usr.sbin/crunch/crunchide/exec_elf32.c Tue May 12 18:09:54 2015
(r282823)
+++ head/usr.sbin/crunch/crunchide/exec_elf32.c Tue May 12 20:04:17 2015
(r282824)
@@ -35,7 +35,7 @@ __RCSID("$NetBSD: exec_elf32.c,v 1.6 199
 #endif
 #endif
 __FBSDID("$FreeBSD$");
- 
+
 #ifndef ELFSIZE
 #define ELFSIZE 32
 #endif
@@ -142,7 +142,7 @@ static void *
 xrealloc(void *ptr, size_t size, const char *fn, const char *use)
 {
void *rv;
-   
+
rv = realloc(ptr, size);
if (rv == NULL) {
free(ptr);
@@ -150,7 +150,7 @@ xrealloc(void *ptr, size_t size, const c
fn, use);
}
return (rv);
-} 
+}
 
 int
 ELFNAMEEND(check)(int fd, const char *fn)
___
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: r282825 - head/sys/netpfil/ipfw

2015-05-12 Thread Alexander V. Chernikov
Author: melifaro
Date: Tue May 12 20:42:42 2015
New Revision: 282825
URL: https://svnweb.freebsd.org/changeset/base/282825

Log:
  Remove ptei->value check from ipfw_link_table_values():
even if there was non-zero number of restarts, we would unref/clear
all value references and start ipfw_link_table_values() once again
with (mostly) cleared "tei" buffer.
   Additionally, ptei->ptv stores only to-be-added values, not existing ones.
   This is a forgotten piece of previous value refconting implementation,
and now it is simply incorrect.

Modified:
  head/sys/netpfil/ipfw/ip_fw_table_value.c

Modified: head/sys/netpfil/ipfw/ip_fw_table_value.c
==
--- head/sys/netpfil/ipfw/ip_fw_table_value.c   Tue May 12 20:04:17 2015
(r282824)
+++ head/sys/netpfil/ipfw/ip_fw_table_value.c   Tue May 12 20:42:42 2015
(r282825)
@@ -563,17 +563,6 @@ ipfw_link_table_values(struct ip_fw_chai
/* Let's try to link values */
for (i = 0; i < count; i++) {
ptei = &tei[i];
-   if (ptei->value != 0) {
-
-   /*
-* We may be here after several process restarts,
-* so we need to update all fields that might
-* have changed.
-*/
-   ptv = (struct table_val_link *)ptei->ptv;
-   ptv->pval = &pval[i];
-   continue;
-   }
 
/* Check if record has appeared */
mask_table_value(ptei->pvalue, &tval, ts->vmask);
___
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: r281838 - head/sys/dev/e1000

2015-05-12 Thread Hiren Panchasara
On 04/22/15 at 12:36P, Hiren Panchasara wrote:
> On 04/21/15 at 03:05P, Hiren Panchasara wrote:
> > On 04/21/15 at 08:24P, Hiren Panchasara wrote:
> > > Author: hiren
> > > Date: Tue Apr 21 20:24:15 2015
> > > New Revision: 281838
> > > URL: https://svnweb.freebsd.org/changeset/base/281838
> > > 
> > > Log:
> > >   For igb(4), when we are doing multiqueue, we are all setup to have full 
> > > 32bit
> > >   RSS hash from the card. We do not need to hide that under "ifdef RSS" 
> > > and should
> > >   expose that by default so others like lagg(4) can use that and avoid 
> > > hashing the
> > >   traffic by themselves.
> > >   While here, improve comments and get rid of hidden/unimplemented RSS 
> > > support
> > >   code for UDP.
> > >   
> > >   Differential Revision:  https://reviews.freebsd.org/D2296
> > >   Reviewed by:jfv, erj
> > >   Discussed with: adrian
> > >   Sponsored by:   Limelight Networks
> > > 
> > > Modified:
> > >   head/sys/dev/e1000/if_igb.c
> > 
> > I intend to MFC this in a week or so. But for that, I'd have to first
> > MFC a part of https://svnweb.freebsd.org/base?view=revision&revision=268028
> > which sets rss hash types.
> 
> Apparently another missing MFC is r275358. I'll work on them.

So, here is the patch that I intend to commit to stable/10:
https://people.freebsd.org/~hiren/patches/igb_flowid_mfc.patch

RSS is not (yet) ready to be brought back into stable/10 so for now I am
only exposing full 32bit flowid and we will still return flowtype
OPAQUE.

cheers,
Hiren


pgp1HDT8LVCIM.pgp
Description: PGP signature


svn commit: r282827 - in head/sys: arm/ti/am335x boot/fdt/dts/arm

2015-05-12 Thread Luiz Otavio O Souza
Author: loos
Date: Wed May 13 01:10:28 2015
New Revision: 282827
URL: https://svnweb.freebsd.org/changeset/base/282827

Log:
  Add support for the power button on BeagleBone Black.
  
  Shutdown and turn off the board when the power button is pressed.
  
  Submitted by: Michal Meloun 
  Relnotes: yes

Modified:
  head/sys/arm/ti/am335x/am335x_pmic.c
  head/sys/boot/fdt/dts/arm/beaglebone-black.dts

Modified: head/sys/arm/ti/am335x/am335x_pmic.c
==
--- head/sys/arm/ti/am335x/am335x_pmic.cWed May 13 00:28:36 2015
(r282826)
+++ head/sys/arm/ti/am335x/am335x_pmic.cWed May 13 01:10:28 2015
(r282827)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -58,12 +59,20 @@ __FBSDID("$FreeBSD$");
 #define TPS65217D  0x6
 
 /* TPS65217 Reisters */
-#define TPS65217_CHIPID_REG0x00
-#define TPS65217_STATUS_REG0x0A
-#defineTPS65217_STATUS_OFF (1U << 7)
-#defineTPS65217_STATUS_ACPWR   (1U << 3)
-#defineTPS65217_STATUS_USBPWR  (1U << 2)
-#defineTPS65217_STATUS_BT  (1U << 0)
+#defineTPS65217_CHIPID_REG 0x00
+#defineTPS65217_INT_REG0x02
+#define TPS65217_INT_PBM   (1U << 6)
+#define TPS65217_INT_ACM   (1U << 5)
+#define TPS65217_INT_USBM  (1U << 4)
+#define TPS65217_INT_PBI   (1U << 2)
+#define TPS65217_INT_ACI   (1U << 1)
+#define TPS65217_INT_USBI  (1U << 0)
+
+#defineTPS65217_STATUS_REG 0x0A
+#define TPS65217_STATUS_OFF(1U << 7)
+#define TPS65217_STATUS_ACPWR  (1U << 3)
+#define TPS65217_STATUS_USBPWR (1U << 2)
+#define TPS65217_STATUS_BT (1U << 0)
 
 #define MAX_IIC_DATA_SIZE  2
 
@@ -72,6 +81,8 @@ struct am335x_pmic_softc {
device_tsc_dev;
uint32_tsc_addr;
struct intr_config_hook enum_hook;
+   struct resource *sc_irq_res;
+   void*sc_intrhand;
 };
 
 static void am335x_pmic_shutdown(void *, int);
@@ -105,6 +116,38 @@ am335x_pmic_write(device_t dev, uint8_t 
return (iicbus_transfer(dev, msg, 1));
 }
 
+static void
+am335x_pmic_intr(void *arg)
+{
+   struct am335x_pmic_softc *sc = (struct am335x_pmic_softc *)arg;
+   uint8_t int_reg, status_reg;
+   int rv;
+   char notify_buf[16];
+
+   THREAD_SLEEPING_OK();
+   rv = am335x_pmic_read(sc->sc_dev, TPS65217_INT_REG, &int_reg, 1);
+   if (rv != 0) {
+   device_printf(sc->sc_dev, "Cannot read interrupt register\n");
+   THREAD_NO_SLEEPING();
+   return;
+   }
+   rv = am335x_pmic_read(sc->sc_dev, TPS65217_STATUS_REG, &status_reg, 1);
+   if (rv != 0) {
+   device_printf(sc->sc_dev, "Cannot read status register\n");
+   THREAD_NO_SLEEPING();
+   return;
+   }
+   THREAD_NO_SLEEPING();
+
+   if ((int_reg & TPS65217_INT_PBI) && (status_reg & TPS65217_STATUS_BT))
+   shutdown_nice(RB_POWEROFF);
+   if (int_reg & TPS65217_INT_ACI) {
+   snprintf(notify_buf, sizeof(notify_buf), "notify=0x%02x",
+   (status_reg & TPS65217_STATUS_ACPWR) ? 1 : 0);
+   devctl_notify_f("ACPI", "ACAD", "power", notify_buf, M_NOWAIT);
+   }
+}
+
 static int
 am335x_pmic_probe(device_t dev)
 {
@@ -130,6 +173,7 @@ am335x_pmic_start(void *xdev)
uint8_t reg;
char name[20];
char pwr[4][11] = {"Unknown", "USB", "AC", "USB and AC"};
+   int rv;
 
sc = device_get_softc(dev);
 
@@ -158,15 +202,38 @@ am335x_pmic_start(void *xdev)
SHUTDOWN_PRI_LAST);
 
config_intrhook_disestablish(&sc->enum_hook);
+
+   /* Unmask all interrupts and clear pending status */
+   reg = 0;
+   am335x_pmic_write(dev, TPS65217_INT_REG, ®, 1);
+   am335x_pmic_read(dev, TPS65217_INT_REG, ®, 1);
+
+   if (sc->sc_irq_res != NULL) {
+   rv = bus_setup_intr(dev, sc->sc_irq_res,
+   INTR_TYPE_MISC | INTR_MPSAFE, NULL, am335x_pmic_intr,
+   sc, &sc->sc_intrhand);
+   if (rv != 0)
+   device_printf(dev,
+   "Unable to setup the irq handler.\n");
+   }
 }
 
 static int
 am335x_pmic_attach(device_t dev)
 {
struct am335x_pmic_softc *sc;
+   int rid;
 
sc = device_get_softc(dev);
 
+   rid = 0;
+   sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+   RF_ACTIVE);
+   if (!sc->sc_irq_res) {
+   device_printf(dev, "cannot allocate interrupt\n");
+   /* return (ENXIO); */
+   }
+
sc->enum_hook.ich_func = am335x_p

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

2015-05-12 Thread Luiz Otavio O Souza
Author: loos
Date: Wed May 13 01:48:47 2015
New Revision: 282828
URL: https://svnweb.freebsd.org/changeset/base/282828

Log:
  Fix the SMP initialization on RPi 2 (BCM2836).
  
  Invalidate the CPU cache before start the others CPUs.
  
  Submitted by: Michal Meloun 

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

Modified: head/sys/arm/broadcom/bcm2835/bcm2836_mp.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2836_mp.c  Wed May 13 01:10:28 2015
(r282827)
+++ head/sys/arm/broadcom/bcm2835/bcm2836_mp.c  Wed May 13 01:48:47 2015
(r282828)
@@ -123,6 +123,8 @@ platform_mp_start_ap(void)
BSWR4(MBOX3CLR_CORE(i), 0x);
}
wmb();
+   cpu_idcache_wbinv_all();
+   cpu_l2cache_wbinv_all();
 
/* boot secondary CPUs */
for (i = 1; i < mp_ncpus; i++) {
@@ -152,9 +154,6 @@ platform_mp_start_ap(void)
/* recode AP in CPU map */
CPU_SET(i, &all_cpus);
}
-
-   cpu_idcache_wbinv_all();
-   cpu_l2cache_wbinv_all();
 }
 
 void
___
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: r282829 - head/sys/arm/arm

2015-05-12 Thread Luiz Otavio O Souza
Author: loos
Date: Wed May 13 02:25:54 2015
New Revision: 282829
URL: https://svnweb.freebsd.org/changeset/base/282829

Log:
  Fix the vmstat -i output on ARM.
  
  The consumers of hw.intrnames expect a NULL byte at end of the string
  containing the interrupt names.
  
  On ARM all the interrupt name slots are initialized and this leave no room
  for the terminating NULL byte, which makes vmstat read beyond the end of
  intrnames.
  
  PR:   199891
  Tested on:RPi 2 and BeagleBone Black

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

Modified: head/sys/arm/arm/intr.c
==
--- head/sys/arm/arm/intr.c Wed May 13 01:48:47 2015(r282828)
+++ head/sys/arm/arm/intr.c Wed May 13 02:25:54 2015(r282829)
@@ -78,7 +78,7 @@ int (*arm_config_irq)(int irq, enum intr
 
 /* Data for statistics reporting. */
 u_long intrcnt[NIRQ];
-char intrnames[NIRQ * INTRNAME_LEN];
+char intrnames[(NIRQ * INTRNAME_LEN) + 1];
 size_t sintrcnt = sizeof(intrcnt);
 size_t sintrnames = sizeof(intrnames);
 
___
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: r282827 - in head/sys: arm/ti/am335x boot/fdt/dts/arm

2015-05-12 Thread Rui Paulo
On Wednesday 13 May 2015 01:10:28 Luiz Otavio O Souza wrote:
> Author: loos
> Date: Wed May 13 01:10:28 2015
> New Revision: 282827
> URL: https://svnweb.freebsd.org/changeset/base/282827
> 
> Log:
>   Add support for the power button on BeagleBone Black.
> 
>   Shutdown and turn off the board when the power button is pressed.
> 
>   Submitted by:   Michal Meloun 
>   Relnotes:   yes

Cool! But...

> 
> Modified:
>   head/sys/arm/ti/am335x/am335x_pmic.c
>   head/sys/boot/fdt/dts/arm/beaglebone-black.dts
> 
> Modified: head/sys/arm/ti/am335x/am335x_pmic.c
> 
> == --- head/sys/arm/ti/am335x/am335x_pmic.c   Wed May 13 00:28:36
> 2015  (r282826) +++ head/sys/arm/ti/am335x/am335x_pmic.c  Wed May 13 
01:10:28
> 2015  (r282827) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -58,12 +59,20 @@ __FBSDID("$FreeBSD$");
>  #define TPS65217D0x6
> 
>  /* TPS65217 Reisters */
> -#define TPS65217_CHIPID_REG  0x00
> -#define TPS65217_STATUS_REG  0x0A
> -#define  TPS65217_STATUS_OFF (1U << 7)
> -#define  TPS65217_STATUS_ACPWR   (1U << 3)
> -#define  TPS65217_STATUS_USBPWR  (1U << 2)
> -#define  TPS65217_STATUS_BT  (1U << 0)
> +#define  TPS65217_CHIPID_REG 0x00
> +#define  TPS65217_INT_REG0x02
> +#define   TPS65217_INT_PBM   (1U << 6)
> +#define   TPS65217_INT_ACM   (1U << 5)
> +#define   TPS65217_INT_USBM  (1U << 4)
> +#define   TPS65217_INT_PBI   (1U << 2)
> +#define   TPS65217_INT_ACI   (1U << 1)
> +#define   TPS65217_INT_USBI  (1U << 0)
> +
> +#define  TPS65217_STATUS_REG 0x0A
> +#define   TPS65217_STATUS_OFF(1U << 7)
> +#define   TPS65217_STATUS_ACPWR  (1U << 3)
> +#define   TPS65217_STATUS_USBPWR (1U << 2)
> +#define   TPS65217_STATUS_BT (1U << 0)
> 
>  #define MAX_IIC_DATA_SIZE2
> 
> @@ -72,6 +81,8 @@ struct am335x_pmic_softc {
>   device_tsc_dev;
>   uint32_tsc_addr;
>   struct intr_config_hook enum_hook;
> + struct resource *sc_irq_res;
> + void*sc_intrhand;
>  };
> 
>  static void am335x_pmic_shutdown(void *, int);
> @@ -105,6 +116,38 @@ am335x_pmic_write(device_t dev, uint8_t
>   return (iicbus_transfer(dev, msg, 1));
>  }
> 
> +static void
> +am335x_pmic_intr(void *arg)
> +{
> + struct am335x_pmic_softc *sc = (struct am335x_pmic_softc *)arg;
> + uint8_t int_reg, status_reg;
> + int rv;
> + char notify_buf[16];
> +
> + THREAD_SLEEPING_OK();
> + rv = am335x_pmic_read(sc->sc_dev, TPS65217_INT_REG, &int_reg, 1);

Scary!  The correct way to handle this case is to start a task(9).  Why wasn't 
that done here?

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


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

2015-05-12 Thread Ganbold Tsagaankhuu
Author: ganbold
Date: Wed May 13 05:46:04 2015
New Revision: 282830
URL: https://svnweb.freebsd.org/changeset/base/282830

Log:
  Delete cpu_do_powersave which is set but never used/tested
  serving no useful purpose.
  
  Differential Revision:https://reviews.freebsd.org/D2516
  Submitted by: John Wehle
  Reviewed by:  ian@

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

Modified: head/sys/arm/arm/cpufunc.c
==
--- head/sys/arm/arm/cpufunc.c  Wed May 13 02:25:54 2015(r282829)
+++ head/sys/arm/arm/cpufunc.c  Wed May 13 05:46:04 2015(r282830)
@@ -99,8 +99,6 @@ u_int arm_cache_level;
 u_int  arm_cache_type[14];
 u_int  arm_cache_loc;
 
-/* 1 == use cpu_sleep(), 0 == don't */
-int cpu_do_powersave;
 int ctrl;
 
 #ifdef CPU_ARM9
@@ -838,11 +836,6 @@ set_cpufuncs()
cputype = cpufunc_id();
cputype &= CPU_ID_CPU_MASK;
 
-   /*
-* NOTE: cpu_do_powersave defaults to off.  If we encounter a
-* CPU type where we want to use it by default, then we set it.
-*/
-
 #ifdef CPU_ARM9
if (((cputype & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_ARM_LTD ||
 (cputype & CPU_ID_IMPLEMENTOR_MASK) == CPU_ID_TI) &&
@@ -922,8 +915,6 @@ set_cpufuncs()
get_cachetype_cp15();

pmap_pte_init_mmu_v6();
-   /* Use powersave on this CPU. */
-   cpu_do_powersave = 1;
goto out;
}
 #endif /* CPU_CORTEXA */
@@ -946,9 +937,6 @@ set_cpufuncs()
get_cachetype_cp15();
pmap_pte_init_generic();
 
-   /* Use powersave on this CPU. */
-   cpu_do_powersave = 1;
-
goto out;
}
 #endif /* CPU_FA526 */
@@ -985,9 +973,6 @@ set_cpufuncs()
get_cachetype_cp15();
pmap_pte_init_xscale();
 
-   /* Use powersave on this CPU. */
-   cpu_do_powersave = 1;
-
goto out;
}
 #endif /* CPU_XSCALE_PXA2X0 */
___
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"