Re: svn commit: r287204 - head/usr.bin/vi/catalog

2015-08-27 Thread Baptiste Daroussin
On Thu, Aug 27, 2015 at 02:00:17PM +, Alexander Kabaev wrote:
 Author: kan
 Date: Thu Aug 27 14:00:16 2015
 New Revision: 287204
 URL: https://svnweb.freebsd.org/changeset/base/287204
 
 Log:
   Unbreak nvi message catalog generation for 8 bit locales.
   
   Feeding any file encoded in 8 bit locales such as KOI8-RU
   to sort utility running under UTF-8 locale produces astonishing
   result of recoding the output to UTF-8. To counter that, just
   run sort under 'C' locale for now.

That is because FreeBSD is missing multibyte collation support. and it solved by
using LC_COLLATE=C which is enforced by login.conf in head.

Best regards,
Bapt


pgp8oWtsQTsVd.pgp
Description: PGP signature


svn commit: r287205 - head/contrib/ncurses/ncurses/base

2015-08-27 Thread Alexander Kabaev
Author: kan
Date: Thu Aug 27 14:00:20 2015
New Revision: 287205
URL: https://svnweb.freebsd.org/changeset/base/287205

Log:
  Make ncurses build with GCC 5.0 and up
  
  Merge the end result of two upstream changes:
  
  Original fix from 20141206:
+ modify MKlib_gen.sh to work around change in development version of
  gcc introduced here:
  https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
  https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html
  (reports by Marcus Shawcroft, Maohui Lei).
  
  Later fixed in different manner in 20150725:
+ use alternate workaround for gcc 5.x feature (adapted from patch by
  Mikhail Peselnik).

Modified:
  head/contrib/ncurses/ncurses/base/MKlib_gen.sh

Modified: head/contrib/ncurses/ncurses/base/MKlib_gen.sh
==
--- head/contrib/ncurses/ncurses/base/MKlib_gen.sh  Thu Aug 27 14:00:16 
2015(r287204)
+++ head/contrib/ncurses/ncurses/base/MKlib_gen.sh  Thu Aug 27 14:00:20 
2015(r287205)
@@ -2,10 +2,10 @@
 #
 # MKlib_gen.sh -- generate sources from curses.h macro definitions
 #
-# ($Id: MKlib_gen.sh,v 1.46 2011/06/04 19:14:08 tom Exp $)
+# ($Id: MKlib_gen.sh,v 1.50 2015/08/07 00:48:24 tom Exp $)
 #
 ##
-# Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.#
+# Copyright (c) 1998-2014,2015 Free Software Foundation, Inc.#
 ##
 # Permission is hereby granted, free of charge, to any person obtaining a#
 # copy of this software and associated documentation files (the Software), #
@@ -66,6 +66,23 @@ preprocessor=$1 -DNCURSES_INTERNALS -I.
 AWK=$2
 USE=$3
 
+# A patch discussed here:
+#  https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html
+# introduces spurious #line markers into the preprocessor output.  The result
+# appears in gcc 5.0 and (with modification) in 5.1, making it necessary to
+# determine if we are using gcc, and if so, what version because the proposed
+# solution uses a nonstandard option.
+PRG=`echo $1 | $AWK '{ sub(/^[[:space:]]*/,); sub(/[[:space:]].*$/, ); 
print; }' || exit 0`
+FSF=`$PRG --version 2/dev/null || exit 0 | fgrep Free Software Foundation 
| head -n 1`
+ALL=`$PRG -dumpversion 2/dev/null || exit 0`
+ONE=`echo $ALL | sed -e 's/\..*$//'`
+if test -n $FSF  test -n $ALL  test -n $ONE ; then
+   if test $ONE -ge 5 ; then
+   echo .. adding -P option to work around $PRG $ALL 2
+   preprocessor=$preprocessor -P
+   fi
+fi
+
 PID=$$
 ED1=sed1_${PID}.sed
 ED2=sed2_${PID}.sed
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287204 - head/usr.bin/vi/catalog

2015-08-27 Thread Alexander Kabaev
Author: kan
Date: Thu Aug 27 14:00:16 2015
New Revision: 287204
URL: https://svnweb.freebsd.org/changeset/base/287204

Log:
  Unbreak nvi message catalog generation for 8 bit locales.
  
  Feeding any file encoded in 8 bit locales such as KOI8-RU
  to sort utility running under UTF-8 locale produces astonishing
  result of recoding the output to UTF-8. To counter that, just
  run sort under 'C' locale for now.

Modified:
  head/usr.bin/vi/catalog/Makefile

Modified: head/usr.bin/vi/catalog/Makefile
==
--- head/usr.bin/vi/catalog/MakefileThu Aug 27 13:17:05 2015
(r287203)
+++ head/usr.bin/vi/catalog/MakefileThu Aug 27 14:00:16 2015
(r287204)
@@ -32,9 +32,9 @@ CAT+= $c.UTF-8
 
 .for c in ${CAT}
 ${c}:  ${c}.base 
-   @echo ... $c; \
+   echo ... $c;  \
rm -f $c;   \
-   sort -u ${.ALLSRC} |\
+   env LANG=C sort -u ${.ALLSRC} | \
awk '{  \
if ($$1 == 1) { \
print \nMESSAGE NUMBER 1 IS NOT LEGAL;\
@@ -44,7 +44,7 @@ ${c}: ${c}.base 
print DUPLICATE MESSAGE NUMBER  $$1;  \
exit 1; \
}   \
-   print $0;   \
+   print $$0;  \
}' |\
sed -e '1s/^/$$set 1~$$quote ~/; 1y/~/\n/' |   \
gencat $c /dev/stdin;   \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287206 - head/sys/sys

2015-08-27 Thread Alexander Kabaev
Author: kan
Date: Thu Aug 27 14:00:23 2015
New Revision: 287206
URL: https://svnweb.freebsd.org/changeset/base/287206

Log:
  Repair sys/cdefs.h enough to be usable with GCC 5.x
  
  The __alloc_size and __alloc_align need to be defined to
  nothingness for lint, but the existing check is deficient
  and allows attributes with working __has_attrubute() to
  slip through.

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hThu Aug 27 14:00:20 2015(r287205)
+++ head/sys/sys/cdefs.hThu Aug 27 14:00:23 2015(r287206)
@@ -39,7 +39,6 @@
 /*
  * Testing against Clang-specific extensions.
  */
-
 #ifndef__has_attribute
 #define__has_attribute(x)  0
 #endif
@@ -212,6 +211,8 @@
 #define__unused
 #define__packed
 #define__aligned(x)
+#define__alloc_align(x)
+#define__alloc_size(x)
 #define__section(x)
 #define__weak_symbol
 #else
@@ -236,6 +237,16 @@
 #define__aligned(x)__attribute__((__aligned__(x)))
 #define__section(x)__attribute__((__section__(x)))
 #endif
+#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
+#define__alloc_size(x) __attribute__((__alloc_size__(x)))
+#else
+#define__alloc_size(x)
+#endif
+#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9)
+#define__alloc_align(x)__attribute__((__alloc_align__(x)))
+#else
+#define__alloc_align(x)
+#endif
 #endif /* lint */
 
 #if !__GNUC_PREREQ__(2, 95)
@@ -371,24 +382,12 @@
 #define__returns_twice
 #endif
 
-#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
-#define__alloc_size(x) __attribute__((__alloc_size__(x)))
-#else
-#define__alloc_size(x)
-#endif
-
 #if __has_builtin(__builtin_unreachable) || __GNUC_PREREQ__(4, 6)
 #define__unreachable() __builtin_unreachable()
 #else
 #define__unreachable() ((void)0)
 #endif
 
-#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9)
-#define__alloc_align(x)__attribute__((__alloc_align__(x)))
-#else
-#define__alloc_align(x)
-#endif
-
 /* XXX: should use `#if __STDC_VERSION__  199901'. */
 #if !__GNUC_PREREQ__(2, 7)  !defined(__INTEL_COMPILER)
 #define__func__NULL
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287202 - head/sys/dev/mmc/host

2015-08-27 Thread Andrew Turner
Author: andrew
Date: Thu Aug 27 13:08:45 2015
New Revision: 287202
URL: https://svnweb.freebsd.org/changeset/base/287202

Log:
  Allow us to select the transfer count. This allows us to work with hardware
  that seems to only work with a single block at a time.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Thu Aug 27 11:21:34 2015
(r287201)
+++ head/sys/dev/mmc/host/dwmmc.c   Thu Aug 27 13:08:45 2015
(r287202)
@@ -111,8 +111,8 @@ struct idmac_desc {
uint32_tdes3;   /* buf2 phys addr or next descr */
 };
 
-#defineDESC_COUNT  256
-#defineDESC_SIZE   (sizeof(struct idmac_desc) * DESC_COUNT)
+#defineDESC_MAX256
+#defineDESC_SIZE   (sizeof(struct idmac_desc) * DESC_MAX)
 #defineDEF_MSIZE   0x2 /* Burst size of multiple transaction */
 
 struct dwmmc_softc {
@@ -130,6 +130,7 @@ struct dwmmc_softc {
uint32_tuse_auto_stop;
uint32_tuse_pio;
uint32_tpwren_inverted;
+   u_int   desc_count;
 
bus_dma_tag_t   desc_tag;
bus_dmamap_tdesc_map;
@@ -283,10 +284,10 @@ dma_setup(struct dwmmc_softc *sc)
return (1);
}
 
-   for (idx = 0; idx  DESC_COUNT; idx++) {
+   for (idx = 0; idx  sc-desc_count; idx++) {
sc-desc_ring[idx].des0 = DES0_CH;
sc-desc_ring[idx].des1 = 0;
-   nidx = (idx + 1) % DESC_COUNT;
+   nidx = (idx + 1) % sc-desc_count;
sc-desc_ring[idx].des3 = sc-desc_ring_paddr + \
(nidx * sizeof(struct idmac_desc));
}
@@ -297,8 +298,8 @@ dma_setup(struct dwmmc_softc *sc)
BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
BUS_SPACE_MAXADDR,  /* highaddr */
NULL, NULL, /* filter, filterarg */
-   DESC_COUNT*MMC_SECTOR_SIZE, /* maxsize */
-   DESC_COUNT, /* nsegments */
+   sc-desc_count * MMC_SECTOR_SIZE, /* maxsize */
+   sc-desc_count, /* nsegments */
MMC_SECTOR_SIZE,/* maxsegsize */
0,  /* flags */
NULL, NULL, /* lockfunc, lockarg */
@@ -578,6 +579,7 @@ dwmmc_attach(device_t dev)
 
sc-use_pio = 0;
sc-pwren_inverted = 0;
+   sc-desc_count = DESC_MAX;
 
if ((sc-hwtype  HWTYPE_MASK) == HWTYPE_ROCKCHIP) {
sc-use_pio = 1;
@@ -1131,7 +1133,7 @@ dwmmc_read_ivar(device_t bus, device_t c
*(int *)result = sc-host.caps;
break;
case MMCBR_IVAR_MAX_DATA:
-   *(int *)result = DESC_COUNT;
+   *(int *)result = sc-desc_count;
}
return (0);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r287206 - head/sys/sys

2015-08-27 Thread Alexander Kabaev
On Thu, Aug 27, 2015 at 12:04 PM, Pedro Giffuni p...@freebsd.org wrote:

 Hello kan;

 On 08/27/15 09:00, Alexander Kabaev wrote:

 Author: kan
 Date: Thu Aug 27 14:00:23 2015
 New Revision: 287206
 URL: https://svnweb.freebsd.org/changeset/base/287206

 Log:
Repair sys/cdefs.h enough to be usable with GCC 5.x

The __alloc_size and __alloc_align need to be defined to
nothingness for lint, but the existing check is deficient
and allows attributes with working __has_attrubute() to
slip through.


 AFAICT GCC hasn't added __has_attribute(), but if they did recently
 that is great news.



Actually I do not know if they did and I do not think it even matters that
much.
The existing conditional is not working for lint and I had to shuffle it
under bigger
'#ifdef lint' protection. Nor is the condition even well formed enough to
work with any
recent GCC and using __has_attribute in naked form is a mistake:

% cat t.c
#if __has_attribute(alloc_size)
# error Has attribute
#endif

% mips-portbld-freebsd11.0-gcc --version
mips-portbld-freebsd11.0-gcc (FreeBSD Ports Collection for mips) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% mips-portbld-freebsd11.0-gcc -E t.c
# 1 t.c
# 1 built-in
# 1 command-line
# 1 t.c
t.c:2:3: error: #error Has attribute
 # error Has attribute
   ^

% gcc48 --version
gcc48 (FreeBSD Ports Collection) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% gcc48 -E t.c
# 1 t.c
# 1 built-in
# 1 command-line
# 1 t.c
t.c:1:20: error: missing binary operator before token (
 #if __has_attribute(alloc_size)



 Modified:
head/sys/sys/cdefs.h

 ..


   #if !__GNUC_PREREQ__(2, 95)
 @@ -371,24 +382,12 @@
   #define   __returns_twice
   #endif

 -#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
 -#define__alloc_size(x) __attribute__((__alloc_size__(x)))
 -#else
 -#define__alloc_size(x)
 -#endif
 -


 This surely got through in GCC's case through the __GNUC_PREREQ__.
 Of course gcc 4.2 has neither attribute but clang has alloc_size
 so I wonder why it hasn't affected the lint builds.

 Just curiosity, the change is OK but it will be getting ugly if we
 have to add all the new attributes in the !lint section.

 Regards,

 Pedro.


clang in tree does not have the slightest idea about the alloc_size
attribute, and that is why it worked, as demonstrated by the test below:

% cc --version
FreeBSD clang version 3.6.1 (tags/RELEASE_361/final 237755) 20150525
Target: x86_64-unknown-freebsd11.0
Thread model: posix

% cc -E t.c
# 1 t.c
# 1 built-in 1
# 1 built-in 3
# 311 built-in 3
# 1 command line 1
# 1 built-in 2
# 1 t.c 2

The original change to cdefs.h appears to be plain wrong.

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


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

2015-08-27 Thread Konstantin Belousov
On Thu, Aug 27, 2015 at 06:28:03PM +0200, Julien Charbon wrote:
 
  Hi Konstantin,
 
 On 27/08/15 12:49, Konstantin Belousov wrote:
  On Wed, Aug 26, 2015 at 08:14:15PM +0200, Julien Charbon wrote:
   As I said, I am not opposed to back out this change, callout(9) API in
  mpsafe mode is a already complex/subtle API, it won't change too much
  the current complexity.
 
   Let say that if nobody screams until Friday 8/28, I will put back
  r284245 and revert this change _and_ I will make this case clear in the
  man page.
  
  [Replying to a random message in the whole set of conversations]
  
  There is one more case, besides TCP timers, which is equially, of not
  more, critical and sensitive WRT to the callout_stop().  Look at the
  sys/kern/subr_sleepqueue.c:sleepq_check_timeout().  Stray return of
  the false result from callout_stop() causes creation of the non-killable
  processes:  the callout fired, we missed the wakeup and went to sleep
  by manually doing the context switch.  Such thread cannot be woken up.
  
  I suspect that your fix is a better approach than my attempt to look
  at something similar at PR 200992 (may be not).
 
  This change (r286880) won't improve the PR 200992:
 
  r286880 only addresses a case where callout_stop() returns 1 instead of
 0.  Thus the only thing that can do r286880 to PR 200992:
 
  - Don't change anything the issues
  - Worsen the issue
 
  Sorry to kill your hope of a simple and elegant fix for PR 200992.

Well, not that I am frustrated much.  Thank you for taking a look.
Did you read the patch attached to the PR ?
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287216 - in head/kerberos5: . libexec/digest-service libexec/kdc usr.bin/kpasswd usr.sbin/iprop-log

2015-08-27 Thread Hajimu UMEMOTO
Author: ume
Date: Thu Aug 27 17:16:18 2015
New Revision: 287216
URL: https://svnweb.freebsd.org/changeset/base/287216

Log:
  Move setting of LDFLAGS to the modules which require it actually, as
  other kerberos5 modules do so.

Modified:
  head/kerberos5/Makefile.inc
  head/kerberos5/libexec/digest-service/Makefile
  head/kerberos5/libexec/kdc/Makefile
  head/kerberos5/usr.bin/kpasswd/Makefile
  head/kerberos5/usr.sbin/iprop-log/Makefile

Modified: head/kerberos5/Makefile.inc
==
--- head/kerberos5/Makefile.inc Thu Aug 27 16:36:39 2015(r287215)
+++ head/kerberos5/Makefile.inc Thu Aug 27 17:16:18 2015(r287216)
@@ -14,7 +14,6 @@ LDAPLDADD=-lldap -llber
 LDAPDPADD= ${LDAPLDADD:C;^-l(.*)$;${OPENLDAPBASE}/lib/lib\1.a;}
 LDAPCFLAGS=-I${OPENLDAPBASE}/include -DOPENLDAP=1 -DLDAP_DEPRECATED=1
 LDAPLDFLAGS=   -L${OPENLDAPBASE}/lib -rpath ${OPENLDAPBASE}/lib
-LDFLAGS+=  ${LDAPLDFLAGS}
 .endif
 
 .if defined(SRCS)

Modified: head/kerberos5/libexec/digest-service/Makefile
==
--- head/kerberos5/libexec/digest-service/Makefile  Thu Aug 27 16:36:39 
2015(r287215)
+++ head/kerberos5/libexec/digest-service/Makefile  Thu Aug 27 17:16:18 
2015(r287216)
@@ -9,6 +9,7 @@ CFLAGS+=-I${KRB5DIR}/kdc \
-I${KRB5DIR}/lib/wind \
-I${KRB5DIR}/lib/roken
 LIBADD=hdb kdc heimipcs krb5 roken asn1 crypto vers heimntlm
+LDFLAGS=${LDAPLDFLAGS}
 
 .include bsd.prog.mk
 

Modified: head/kerberos5/libexec/kdc/Makefile
==
--- head/kerberos5/libexec/kdc/Makefile Thu Aug 27 16:36:39 2015
(r287215)
+++ head/kerberos5/libexec/kdc/Makefile Thu Aug 27 17:16:18 2015
(r287216)
@@ -11,6 +11,7 @@ SRCS= config.c \
 CFLAGS+=-I${KRB5DIR}/lib/krb5 -I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \
-I${KRB5DIR}/kdc ${LDAPCFLAGS}
 LIBADD=kdc hdb krb5 roken crypt vers
+LDFLAGS=${LDAPLDFLAGS}
 
 .include bsd.prog.mk
 

Modified: head/kerberos5/usr.bin/kpasswd/Makefile
==
--- head/kerberos5/usr.bin/kpasswd/Makefile Thu Aug 27 16:36:39 2015
(r287215)
+++ head/kerberos5/usr.bin/kpasswd/Makefile Thu Aug 27 17:16:18 2015
(r287216)
@@ -3,6 +3,7 @@
 PROG=  kpasswd
 CFLAGS+=-I${KRB5DIR}/lib/roken
 LIBADD=hdb krb5 roken vers crypto
+LDFLAGS=${LDAPLDFLAGS}
 
 .include bsd.prog.mk
 

Modified: head/kerberos5/usr.sbin/iprop-log/Makefile
==
--- head/kerberos5/usr.sbin/iprop-log/Makefile  Thu Aug 27 16:36:39 2015
(r287215)
+++ head/kerberos5/usr.sbin/iprop-log/Makefile  Thu Aug 27 17:16:18 2015
(r287216)
@@ -9,6 +9,7 @@ CFLAGS+=-I${KRB5DIR}/lib/kadm5 \
-I${KRB5DIR}/lib/sl \
-I.
 LIBADD=kadm5srv hdb krb5 roken edit sl vers
+LDFLAGS=${LDAPLDFLAGS}
 
 iprop-commands.h: iprop-commands.in
${SLC} ${.ALLSRC:M*.in}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287217 - head/usr.sbin/syslogd

2015-08-27 Thread Xin LI
Author: delphij
Date: Thu Aug 27 18:11:00 2015
New Revision: 287217
URL: https://svnweb.freebsd.org/changeset/base/287217

Log:
  die() would never return, mark it as so.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/syslogd/syslogd.c

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Thu Aug 27 17:16:18 2015
(r287216)
+++ head/usr.sbin/syslogd/syslogd.c Thu Aug 27 18:11:00 2015
(r287217)
@@ -324,7 +324,7 @@ static const char *cvthname(struct socka
 static voiddeadq_enter(pid_t, const char *);
 static int deadq_remove(pid_t);
 static int decode(const char *, const CODE *);
-static voiddie(int);
+static voiddie(int) __dead2;
 static voiddodie(int);
 static voiddofsync(void);
 static voiddomark(int);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287211 - in head/sys: netinet netinet6

2015-08-27 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Aug 27 15:27:41 2015
New Revision: 287211
URL: https://svnweb.freebsd.org/changeset/base/287211

Log:
  get_inpcbinfo() and get_pcblist() are UDP local functions and
  do not do what one would expect by name. Prefix them with udp_
  to at least obviously limit the scope.
  
  This is a non-functional change.
  
  Reviewed by:  gnn, rwatson
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D3505

Modified:
  head/sys/netinet/udp_usrreq.c
  head/sys/netinet/udp_var.h
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==
--- head/sys/netinet/udp_usrreq.c   Thu Aug 27 15:21:58 2015
(r287210)
+++ head/sys/netinet/udp_usrreq.c   Thu Aug 27 15:27:41 2015
(r287211)
@@ -520,7 +520,7 @@ udp_input(struct mbuf **mp, int *offp, i
}
}
 
-   pcbinfo = get_inpcbinfo(proto);
+   pcbinfo = udp_get_inpcbinfo(proto);
if (IN_MULTICAST(ntohl(ip-ip_dst.s_addr)) ||
in_broadcast(ip-ip_dst, ifp)) {
struct inpcb *last;
@@ -528,7 +528,7 @@ udp_input(struct mbuf **mp, int *offp, i
struct ip_moptions *imo;
 
INP_INFO_RLOCK(pcbinfo);
-   pcblist = get_pcblist(proto);
+   pcblist = udp_get_pcblist(proto);
last = NULL;
LIST_FOREACH(inp, pcblist, inp_list) {
if (inp-inp_lport != uh-uh_dport)
@@ -1243,7 +1243,7 @@ udp_output(struct inpcb *inp, struct mbu
 * XXXRW: Check that hash locking update here is correct.
 */
pr = inp-inp_socket-so_proto-pr_protocol;
-   pcbinfo = get_inpcbinfo(pr);
+   pcbinfo = udp_get_inpcbinfo(pr);
sin = (struct sockaddr_in *)addr;
if (sin != NULL 
(inp-inp_laddr.s_addr == INADDR_ANY  inp-inp_lport == 0)) {
@@ -1678,7 +1678,7 @@ udp_abort(struct socket *so)
struct inpcb *inp;
struct inpcbinfo *pcbinfo;
 
-   pcbinfo = get_inpcbinfo(so-so_proto-pr_protocol);
+   pcbinfo = udp_get_inpcbinfo(so-so_proto-pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, (udp_abort: inp == NULL));
INP_WLOCK(inp);
@@ -1699,7 +1699,7 @@ udp_attach(struct socket *so, int proto,
struct inpcbinfo *pcbinfo;
int error;
 
-   pcbinfo = get_inpcbinfo(so-so_proto-pr_protocol);
+   pcbinfo = udp_get_inpcbinfo(so-so_proto-pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp == NULL, (udp_attach: inp != NULL));
error = soreserve(so, udp_sendspace, udp_recvspace);
@@ -1760,7 +1760,7 @@ udp_bind(struct socket *so, struct socka
struct inpcbinfo *pcbinfo;
int error;
 
-   pcbinfo = get_inpcbinfo(so-so_proto-pr_protocol);
+   pcbinfo = udp_get_inpcbinfo(so-so_proto-pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, (udp_bind: inp == NULL));
INP_WLOCK(inp);
@@ -1777,7 +1777,7 @@ udp_close(struct socket *so)
struct inpcb *inp;
struct inpcbinfo *pcbinfo;
 
-   pcbinfo = get_inpcbinfo(so-so_proto-pr_protocol);
+   pcbinfo = udp_get_inpcbinfo(so-so_proto-pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, (udp_close: inp == NULL));
INP_WLOCK(inp);
@@ -1799,7 +1799,7 @@ udp_connect(struct socket *so, struct so
struct sockaddr_in *sin;
int error;
 
-   pcbinfo = get_inpcbinfo(so-so_proto-pr_protocol);
+   pcbinfo = udp_get_inpcbinfo(so-so_proto-pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, (udp_connect: inp == NULL));
INP_WLOCK(inp);
@@ -1829,7 +1829,7 @@ udp_detach(struct socket *so)
struct inpcbinfo *pcbinfo;
struct udpcb *up;
 
-   pcbinfo = get_inpcbinfo(so-so_proto-pr_protocol);
+   pcbinfo = udp_get_inpcbinfo(so-so_proto-pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, (udp_detach: inp == NULL));
KASSERT(inp-inp_faddr.s_addr == INADDR_ANY,
@@ -1851,7 +1851,7 @@ udp_disconnect(struct socket *so)
struct inpcb *inp;
struct inpcbinfo *pcbinfo;
 
-   pcbinfo = get_inpcbinfo(so-so_proto-pr_protocol);
+   pcbinfo = udp_get_inpcbinfo(so-so_proto-pr_protocol);
inp = sotoinpcb(so);
KASSERT(inp != NULL, (udp_disconnect: inp == NULL));
INP_WLOCK(inp);

Modified: head/sys/netinet/udp_var.h
==
--- head/sys/netinet/udp_var.h  Thu Aug 27 15:21:58 2015(r287210)
+++ head/sys/netinet/udp_var.h  Thu Aug 27 15:27:41 2015(r287211)
@@ -150,13 +150,13 @@ VNET_DECLARE(int, udp_blackhole);
 extern int udp_log_in_vain;
 
 static __inline struct inpcbinfo *
-get_inpcbinfo(int protocol)
+udp_get_inpcbinfo(int protocol)
 {
return (protocol == IPPROTO_UDP) ? V_udbinfo : V_ulitecbinfo;

svn commit: r287208 - in head/kerberos5: . lib/libhdb

2015-08-27 Thread Hajimu UMEMOTO
Author: ume
Date: Thu Aug 27 15:03:34 2015
New Revision: 287208
URL: https://svnweb.freebsd.org/changeset/base/287208

Log:
  Make it buildable with WITH_OPENLDAP, again.
  
  MFC after:1 week

Modified:
  head/kerberos5/Makefile.inc
  head/kerberos5/lib/libhdb/Makefile

Modified: head/kerberos5/Makefile.inc
==
--- head/kerberos5/Makefile.inc Thu Aug 27 14:07:28 2015(r287207)
+++ head/kerberos5/Makefile.inc Thu Aug 27 15:03:34 2015(r287208)
@@ -13,7 +13,8 @@ OPENLDAPBASE?=/usr/local
 LDAPLDADD= -lldap -llber
 LDAPDPADD= ${LDAPLDADD:C;^-l(.*)$;${OPENLDAPBASE}/lib/lib\1.a;}
 LDAPCFLAGS=-I${OPENLDAPBASE}/include -DOPENLDAP=1 -DLDAP_DEPRECATED=1
-LDAPLDFLAGS=   -L${OPENLDAPBASE}/lib -Wl,-rpath,${OPENLDAPBASE}/lib
+LDAPLDFLAGS=   -L${OPENLDAPBASE}/lib -rpath ${OPENLDAPBASE}/lib
+LDFLAGS+=  ${LDAPLDFLAGS}
 .endif
 
 .if defined(SRCS)

Modified: head/kerberos5/lib/libhdb/Makefile
==
--- head/kerberos5/lib/libhdb/Makefile  Thu Aug 27 14:07:28 2015
(r287207)
+++ head/kerberos5/lib/libhdb/Makefile  Thu Aug 27 15:03:34 2015
(r287208)
@@ -1,9 +1,10 @@
 # $FreeBSD$
 
 LIB=   hdb
-LDFLAGS=   -Wl,--no-undefined
+LDFLAGS=   -Wl,--no-undefined ${LDAPLDFLAGS}
 VERSION_MAP=   ${KRB5DIR}/lib/hdb/version-script.map
 LIBADD=asn1 com_err krb5 roken sqlite3
+LDADD= ${LDAPLDADD}
 DPADD= ${LDAPDPADD}
 
 MAN=   HDB.3 hdb_entry_ex.3
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287209 - in head: share/man/man4 sys/compat/cloudabi sys/kern sys/sys usr.bin/procstat

2015-08-27 Thread Ed Schouten
Author: ed
Date: Thu Aug 27 15:16:41 2015
New Revision: 287209
URL: https://svnweb.freebsd.org/changeset/base/287209

Log:
  Decompose linkat()/renameat() rights to source and target.
  
  To make it easier to understand how Capsicum interacts with linkat() and
  renameat(), rename the rights to CAP_{LINK,RENAME}AT_{SOURCE,TARGET}.
  
  This also addresses a shortcoming in Capsicum, where it isn't possible
  to disable linking to files stored in a directory. Creating hardlinks
  essentially makes it possible to access files with additional rights.
  
  Reviewed by:  rwatson, wblock
  Differential Revision:https://reviews.freebsd.org/D3411

Modified:
  head/share/man/man4/rights.4
  head/sys/compat/cloudabi/cloudabi_fd.c
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/capsicum.h
  head/usr.bin/procstat/procstat_files.c

Modified: head/share/man/man4/rights.4
==
--- head/share/man/man4/rights.4Thu Aug 27 15:03:34 2015
(r287208)
+++ head/share/man/man4/rights.4Thu Aug 27 15:16:41 2015
(r287209)
@@ -32,7 +32,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd January 23, 2015
+.Dd August 27, 2015
 .Dt RIGHTS 4
 .Os
 .Sh NAME
@@ -71,7 +71,7 @@ The
 family of functions should be used to manage the structure.
 .Sh RIGHTS
 The following rights may be specified in a rights mask:
-.Bl -tag -width CAP_EXTATTR_DELETE
+.Bl -tag -width CAP_RENAMEAT_SOURCE
 .It Dv CAP_ACCEPT
 Permit
 .Xr accept 2
@@ -328,12 +328,28 @@ argument is non-NULL).
 .Dv CAP_EVENT
 is also required on file descriptors that will be monitored using
 .Xr kevent 2 .
-.It Dv CAP_LINKAT
+.It Dv CAP_LINKAT_SOURCE
 Permit
 .Xr linkat 2
-and
-.Xr renameat 2
-on the destination directory descriptor.
+on the source directory descriptor.
+This right includes the
+.Dv CAP_LOOKUP
+right.
+.Pp
+Warning:
+.Dv CAP_LINKAT_SOURCE
+makes it possible to link files in a directory for which file
+descriptors exist that have additional rights.
+For example,
+a file stored in a directory that does not allow
+.Dv CAP_READ
+may be linked in another directory that does allow
+.Dv CAP_READ ,
+thereby granting read access to a file that is otherwise unreadable.
+.It Dv CAP_LINKAT_TARGET
+Permit
+.Xr linkat 2
+on the target directory descriptor.
 This right includes the
 .Dv CAP_LOOKUP
 right.
@@ -474,10 +490,28 @@ is also required) and related system cal
 .It Dv CAP_RECV
 An alias to
 .Dv CAP_READ .
-.It Dv CAP_RENAMEAT
+.It Dv CAP_RENAMEAT_SOURCE
 Permit
-.Xr renameat 2 .
-This right is required on the source directory descriptor.
+.Xr renameat 2
+on the source directory descriptor.
+This right includes the
+.Dv CAP_LOOKUP
+right.
+.Pp
+Warning:
+.Dv CAP_RENAMEAT_SOURCE
+makes it possible to move files to a directory for which file
+descriptors exist that have additional rights.
+For example,
+a file stored in a directory that does not allow
+.Dv CAP_READ
+may be moved to another directory that does allow
+.Dv CAP_READ ,
+thereby granting read access to a file that is otherwise unreadable.
+.It Dv CAP_RENAMEAT_TARGET
+Permit
+.Xr renameat 2
+on the target directory descriptor.
 This right includes the
 .Dv CAP_LOOKUP
 right.

Modified: head/sys/compat/cloudabi/cloudabi_fd.c
==
--- head/sys/compat/cloudabi/cloudabi_fd.c  Thu Aug 27 15:03:34 2015
(r287208)
+++ head/sys/compat/cloudabi/cloudabi_fd.c  Thu Aug 27 15:16:41 2015
(r287209)
@@ -56,13 +56,13 @@ __FBSDID($FreeBSD$);
MAPPING(CLOUDABI_RIGHT_FILE_CREATE_DIRECTORY, CAP_MKDIRAT)  \
MAPPING(CLOUDABI_RIGHT_FILE_CREATE_FILE, CAP_CREATE)\
MAPPING(CLOUDABI_RIGHT_FILE_CREATE_FIFO, CAP_MKFIFOAT)  \
-   MAPPING(CLOUDABI_RIGHT_FILE_LINK_SOURCE, CAP_LOOKUP)\
-   MAPPING(CLOUDABI_RIGHT_FILE_LINK_TARGET, CAP_LINKAT)\
+   MAPPING(CLOUDABI_RIGHT_FILE_LINK_SOURCE, CAP_LINKAT_SOURCE) \
+   MAPPING(CLOUDABI_RIGHT_FILE_LINK_TARGET, CAP_LINKAT_TARGET) \
MAPPING(CLOUDABI_RIGHT_FILE_OPEN, CAP_LOOKUP)   \
MAPPING(CLOUDABI_RIGHT_FILE_READDIR, CAP_READ)  \
MAPPING(CLOUDABI_RIGHT_FILE_READLINK, CAP_LOOKUP)   \
-   MAPPING(CLOUDABI_RIGHT_FILE_RENAME_SOURCE, CAP_RENAMEAT)\
-   MAPPING(CLOUDABI_RIGHT_FILE_RENAME_TARGET, CAP_LINKAT)  \
+   MAPPING(CLOUDABI_RIGHT_FILE_RENAME_SOURCE, CAP_RENAMEAT_SOURCE) \
+   MAPPING(CLOUDABI_RIGHT_FILE_RENAME_TARGET, CAP_RENAMEAT_TARGET) \
MAPPING(CLOUDABI_RIGHT_FILE_STAT_FGET, CAP_FSTAT)   \
MAPPING(CLOUDABI_RIGHT_FILE_STAT_FPUT_SIZE, CAP_FTRUNCATE)  \
MAPPING(CLOUDABI_RIGHT_FILE_STAT_FPUT_TIMES, CAP_FUTIMES)   \

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cThu Aug 27 15:03:34 

svn commit: r287213 - head/sys/dev/mmc/host

2015-08-27 Thread Andrew Turner
Author: andrew
Date: Thu Aug 27 16:24:30 2015
New Revision: 287213
URL: https://svnweb.freebsd.org/changeset/base/287213

Log:
  Limit the speed to the bus frequency.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Thu Aug 27 16:18:22 2015
(r287212)
+++ head/sys/dev/mmc/host/dwmmc.c   Thu Aug 27 16:24:30 2015
(r287213)
@@ -651,7 +651,7 @@ dwmmc_attach(device_t dev)
WRITE4(sc, SDMMC_CTRL, SDMMC_CTRL_INT_ENABLE);
 
sc-host.f_min = 40;
-   sc-host.f_max = 2;
+   sc-host.f_max = min(2, sc-bus_hz);
sc-host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340;
sc-host.caps = MMC_CAP_4_BIT_DATA;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287214 - head/sys/dev/mmc/host

2015-08-27 Thread Andrew Turner
Author: andrew
Date: Thu Aug 27 16:27:51 2015
New Revision: 287214
URL: https://svnweb.freebsd.org/changeset/base/287214

Log:
  There is no need to get the bus tag or handle.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Thu Aug 27 16:24:30 2015
(r287213)
+++ head/sys/dev/mmc/host/dwmmc.c   Thu Aug 27 16:27:51 2015
(r287214)
@@ -117,8 +117,6 @@ struct idmac_desc {
 
 struct dwmmc_softc {
struct resource *res[2];
-   bus_space_tag_t bst;
-   bus_space_handle_t  bsh;
device_tdev;
void*intr_cookie;
struct mmc_host host;
@@ -563,10 +561,6 @@ dwmmc_attach(device_t dev)
return (ENXIO);
}
 
-   /* Memory interface */
-   sc-bst = rman_get_bustag(sc-res[0]);
-   sc-bsh = rman_get_bushandle(sc-res[0]);
-
/* Setup interrupt handler. */
error = bus_setup_intr(dev, sc-res[1], INTR_TYPE_NET | INTR_MPSAFE,
NULL, dwmmc_intr, sc, sc-intr_cookie);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2015-08-27 Thread Julien Charbon

 Hi Konstantin,

On 27/08/15 12:49, Konstantin Belousov wrote:
 On Wed, Aug 26, 2015 at 08:14:15PM +0200, Julien Charbon wrote:
  As I said, I am not opposed to back out this change, callout(9) API in
 mpsafe mode is a already complex/subtle API, it won't change too much
 the current complexity.

  Let say that if nobody screams until Friday 8/28, I will put back
 r284245 and revert this change _and_ I will make this case clear in the
 man page.
 
 [Replying to a random message in the whole set of conversations]
 
 There is one more case, besides TCP timers, which is equially, of not
 more, critical and sensitive WRT to the callout_stop().  Look at the
 sys/kern/subr_sleepqueue.c:sleepq_check_timeout().  Stray return of
 the false result from callout_stop() causes creation of the non-killable
 processes:  the callout fired, we missed the wakeup and went to sleep
 by manually doing the context switch.  Such thread cannot be woken up.
 
 I suspect that your fix is a better approach than my attempt to look
 at something similar at PR 200992 (may be not).

 This change (r286880) won't improve the PR 200992:

 r286880 only addresses a case where callout_stop() returns 1 instead of
0.  Thus the only thing that can do r286880 to PR 200992:

 - Don't change anything the issues
 - Worsen the issue

 Sorry to kill your hope of a simple and elegant fix for PR 200992.

--
Julien



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r287206 - head/sys/sys

2015-08-27 Thread Pedro Giffuni

Hello kan;

On 08/27/15 09:00, Alexander Kabaev wrote:

Author: kan
Date: Thu Aug 27 14:00:23 2015
New Revision: 287206
URL: https://svnweb.freebsd.org/changeset/base/287206

Log:
   Repair sys/cdefs.h enough to be usable with GCC 5.x

   The __alloc_size and __alloc_align need to be defined to
   nothingness for lint, but the existing check is deficient
   and allows attributes with working __has_attrubute() to
   slip through.



AFAICT GCC hasn't added __has_attribute(), but if they did recently
that is great news.


Modified:
   head/sys/sys/cdefs.h


..



  #if !__GNUC_PREREQ__(2, 95)
@@ -371,24 +382,12 @@
  #define   __returns_twice
  #endif

-#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
-#define__alloc_size(x) __attribute__((__alloc_size__(x)))
-#else
-#define__alloc_size(x)
-#endif
-


This surely got through in GCC's case through the __GNUC_PREREQ__.
Of course gcc 4.2 has neither attribute but clang has alloc_size
so I wonder why it hasn't affected the lint builds.

Just curiosity, the change is OK but it will be getting ugly if we
have to add all the new attributes in the !lint section.

Regards,

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


svn commit: r287212 - head/sys/dev/mmc/host

2015-08-27 Thread Andrew Turner
Author: andrew
Date: Thu Aug 27 16:18:22 2015
New Revision: 287212
URL: https://svnweb.freebsd.org/changeset/base/287212

Log:
  Allow the fifo-depth and num-slots to be missing. For the former we read
  the value from the hardware, for the latter assume a single slot.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/dev/mmc/host/dwmmc.c

Modified: head/sys/dev/mmc/host/dwmmc.c
==
--- head/sys/dev/mmc/host/dwmmc.c   Thu Aug 27 15:27:41 2015
(r287211)
+++ head/sys/dev/mmc/host/dwmmc.c   Thu Aug 27 16:18:22 2015
(r287212)
@@ -466,16 +466,17 @@ parse_fdt(struct dwmmc_softc *sc)
return (ENXIO);
 
/* fifo-depth */
-   if ((len = OF_getproplen(node, fifo-depth)) = 0)
-   return (ENXIO);
-   OF_getencprop(node, fifo-depth, dts_value, len);
-   sc-fifo_depth = dts_value[0];
+   if ((len = OF_getproplen(node, fifo-depth))  0) {
+   OF_getencprop(node, fifo-depth, dts_value, len);
+   sc-fifo_depth = dts_value[0];
+   }
 
/* num-slots */
-   if ((len = OF_getproplen(node, num-slots)) = 0)
-   return (ENXIO);
-   OF_getencprop(node, num-slots, dts_value, len);
-   sc-num_slots = dts_value[0];
+   sc-num_slots = 1;
+   if ((len = OF_getproplen(node, num-slots))  0) {
+   OF_getencprop(node, num-slots, dts_value, len);
+   sc-num_slots = dts_value[0];
+   }
 
/*
 * We need some platform-specific code to know
@@ -610,6 +611,13 @@ dwmmc_attach(device_t dev)
 
dwmmc_setup_bus(sc, sc-host.f_min);
 
+   if (sc-fifo_depth == 0) {
+   sc-fifo_depth = 1 +
+   ((READ4(sc, SDMMC_FIFOTH)  SDMMC_FIFOTH_RXWMARK_S)  
0xfff);
+   device_printf(dev, No fifo-depth, using FIFOTH %x\n,
+   sc-fifo_depth);
+   }
+
if (!sc-use_pio) {
if (dma_setup(sc))
return (ENXIO);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287218 - head/usr.bin/netstat

2015-08-27 Thread John-Mark Gurney
Author: jmg
Date: Thu Aug 27 19:12:42 2015
New Revision: 287218
URL: https://svnweb.freebsd.org/changeset/base/287218

Log:
  add documentation for timers that silby added in r197244, almost 6 years
  ago...

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

Modified: head/usr.bin/netstat/netstat.1
==
--- head/usr.bin/netstat/netstat.1  Thu Aug 27 18:11:00 2015
(r287217)
+++ head/usr.bin/netstat/netstat.1  Thu Aug 27 19:12:42 2015
(r287218)
@@ -28,7 +28,7 @@
 .\@(#)netstat.1   8.8 (Berkeley) 4/18/94
 .\ $FreeBSD$
 .\
-.Dd April 7, 2015
+.Dd August 27, 2015
 .Dt NETSTAT 1
 .Os
 .Sh NAME
@@ -217,6 +217,12 @@ queue.
 .It Li S-BCNT Ta Send buffer byte count.
 .It Li R-BMAX Ta Maximum bytes that can be used in the receive buffer.
 .It Li S-BMAX Ta Maximum bytes that can be used in the send buffer.
+.It Li rexmt Ta Time, in seconds, to fire Retransmit Timer, or 0 if not armed.
+.It Li persist Ta Time, in seconds, to fire Retransmit Persistence, or 0 if 
not armed.
+.It Li keep Ta Time, in seconds, to fire Keep Alive, or 0 if not armed.
+.It Li 2msl Ta Time, in seconds, to fire 2*msl TIME_WAIT Timer, or 0 if not 
armed.
+.It Li delack Ta Time, in seconds, to fire Delayed ACK Timer, or 0 if not 
armed.
+.It Li rcvtime Ta Time, in seconds, since last packet received.
 .El
 .It Fl f Ar protocol_family
 Filter by
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287219 - head/sys/vm

2015-08-27 Thread Alan Cox
Author: alc
Date: Thu Aug 27 20:38:45 2015
New Revision: 287219
URL: https://svnweb.freebsd.org/changeset/base/287219

Log:
  In vm_pageout_scan(), simplify the logic for determining if a page can be
  paged out and apply some nearby style fixes.
  
  In collaboration with:kib
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation, EMC / Isilon Storage Division

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cThu Aug 27 19:12:42 2015(r287218)
+++ head/sys/vm/vm_pageout.cThu Aug 27 20:38:45 2015(r287219)
@@ -1029,10 +1029,9 @@ vm_pageout_scan(struct vm_domain *vmd, i
struct vm_pagequeue *pq;
vm_object_t object;
long min_scan;
-   int act_delta, addl_page_shortage, deficit, maxscan, page_shortage;
-   int vnodes_skipped = 0;
-   int maxlaunder, scan_tick, scanned;
-   boolean_t queues_locked;
+   int act_delta, addl_page_shortage, deficit, error, maxlaunder, maxscan;
+   int page_shortage, scan_tick, scanned, vnodes_skipped;
+   boolean_t pageout_ok, queues_locked;
 
/*
 * If we need to reclaim memory ask kernel caches to return
@@ -1086,6 +1085,8 @@ vm_pageout_scan(struct vm_domain *vmd, i
if (pass  1)
maxlaunder = 1;
 
+   vnodes_skipped = 0;
+
/*
 * Start scanning the inactive queue for pages we can move to the
 * cache or free.  The scan will stop when the target is reached or
@@ -1265,23 +1266,22 @@ vm_pageout_scan(struct vm_domain *vmd, i
 * pressure where there are insufficient clean pages
 * on the inactive queue, we may have to go all out.
 */
-   int swap_pageouts_ok;
-   int error;
 
-   if ((object-type != OBJT_SWAP)  (object-type != 
OBJT_DEFAULT)) {
-   swap_pageouts_ok = 1;
-   } else {
-   swap_pageouts_ok = !(defer_swap_pageouts || 
disable_swap_pageouts);
-   swap_pageouts_ok |= (!disable_swap_pageouts  
defer_swap_pageouts 
-   vm_page_count_min());
-   
-   }
+   if (object-type != OBJT_SWAP 
+   object-type != OBJT_DEFAULT)
+   pageout_ok = TRUE;
+   else if (disable_swap_pageouts)
+   pageout_ok = FALSE;
+   else if (defer_swap_pageouts)
+   pageout_ok = vm_page_count_min();
+   else
+   pageout_ok = TRUE;
 
/*
 * We don't bother paging objects that are dead.  
 * Those objects are in a rundown state.
 */
-   if (!swap_pageouts_ok || (object-flags  OBJ_DEAD)) {
+   if (!pageout_ok || (object-flags  OBJ_DEAD) != 0) {
vm_pagequeue_lock(pq);
vm_page_unlock(m);
VM_OBJECT_WUNLOCK(object);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287220 - head/etc/rc.d

2015-08-27 Thread Peter Wemm
Author: peter
Date: Thu Aug 27 20:52:41 2015
New Revision: 287220
URL: https://svnweb.freebsd.org/changeset/base/287220

Log:
  Fix a conversion error in rc.d/jail

Modified:
  head/etc/rc.d/jail

Modified: head/etc/rc.d/jail
==
--- head/etc/rc.d/jail  Thu Aug 27 20:38:45 2015(r287219)
+++ head/etc/rc.d/jail  Thu Aug 27 20:52:41 2015(r287220)
@@ -238,7 +238,7 @@ parse_options()
 
eval : \${jail_${_j}_mount_enable:=${jail_mount_enable:-NO}}
if checkyesno jail_${_j}_mount_enable; then
-   echo   allow.mount;  $_conf
+   echo   allow.mount;
fi
 
extract_var $_j set_hostname_allow allow.set_hostname YN NO
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r287206 - head/sys/sys

2015-08-27 Thread Pedro Giffuni



On 08/27/15 12:41, Alexander Kabaev wrote:
...


The existing conditional is not working for lint and I had to shuffle it
under bigger
'#ifdef lint' protection.


And other BSDs are just getting rid of lint. I have no opinion on that
though.


 ... Nor is the condition even well formed enough
to work with any
recent GCC and using __has_attribute in naked form is a mistake:

% cat t.c
#if __has_attribute(alloc_size)
# error Has attribute
#endif



We are not really using __has_attribute() in it's naked form: we are
following the official clang procedure:

http://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros

In cdefs.h that corresponds to lines 42-44.

...


% mips-portbld-freebsd11.0-gcc --version
mips-portbld-freebsd11.0-gcc (FreeBSD Ports Collection for mips) 5.2.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% mips-portbld-freebsd11.0-gcc -E t.c
# 1 t.c
# 1 built-in
# 1 command-line
# 1 t.c
t.c:2:3: error: #error Has attribute
  # error Has attribute
^

% gcc48 --version
gcc48 (FreeBSD Ports Collection) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

% gcc48 -E t.c
# 1 t.c
# 1 built-in
# 1 command-line
# 1 t.c
t.c:1:20: error: missing binary operator before token (
  #if __has_attribute(alloc_size)

Modified:
head/sys/sys/cdefs.h

..


   #if !__GNUC_PREREQ__(2, 95)
@@ -371,24 +382,12 @@
   #define   __returns_twice
   #endif

-#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3)
-#define__alloc_size(x) __attribute__((__alloc_size__(x)))
-#else
-#define__alloc_size(x)
-#endif
-


This surely got through in GCC's case through the __GNUC_PREREQ__.
Of course gcc 4.2 has neither attribute but clang has alloc_size
so I wonder why it hasn't affected the lint builds.

Just curiosity, the change is OK but it will be getting ugly if we
have to add all the new attributes in the !lint section.

Regards,

Pedro.


clang in tree does not have the slightest idea about the alloc_size
attribute, and that is why it worked, as demonstrated by the test below:



Ugh yes, it appears it's unsupported still. I though I had seen a bug 
report with a patch but I can't find it anymore. Grepping it in contrib

doesn't show anything.

...


The original change to cdefs.h appears to be plain wrong.



Not really, it may appear some day.

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


svn commit: r287221 - head/sys/cam/ctl

2015-08-27 Thread Alexander Motin
Author: mav
Date: Thu Aug 27 21:16:24 2015
New Revision: 287221
URL: https://svnweb.freebsd.org/changeset/base/287221

Log:
  Fix type bug introduced at r286811.

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

Modified: head/sys/cam/ctl/ctl_backend_block.c
==
--- head/sys/cam/ctl/ctl_backend_block.cThu Aug 27 20:52:41 2015
(r287220)
+++ head/sys/cam/ctl/ctl_backend_block.cThu Aug 27 21:16:24 2015
(r287221)
@@ -1861,8 +1861,8 @@ ctl_be_block_open_dev(struct ctl_be_bloc
struct cdev  *dev;
struct cdevsw*devsw;
char *value;
-   int   error, atomic, maxio, unmap;
-   off_t ps, pss, po, pos, us, uss, uo, uos, tmp;
+   int   error, atomic, maxio, unmap, tmp;
+   off_t ps, pss, po, pos, us, uss, uo, uos, otmp;
 
params = be_lun-params;
 
@@ -1928,21 +1928,19 @@ ctl_be_block_open_dev(struct ctl_be_bloc
snprintf(req-error_str, sizeof(req-error_str),
 requested blocksize %u is not an even 
 multiple of backing device blocksize %u,
-params-blocksize_bytes,
-be_lun-blocksize);
+params-blocksize_bytes, tmp);
return (EINVAL);

}
} else if (params-blocksize_bytes != 0) {
snprintf(req-error_str, sizeof(req-error_str),
 requested blocksize %u  backing device 
-blocksize %u, params-blocksize_bytes,
-be_lun-blocksize);
+blocksize %u, params-blocksize_bytes, tmp);
return (EINVAL);
} else
be_lun-blocksize = tmp;
 
-   error = devsw-d_ioctl(dev, DIOCGMEDIASIZE, (caddr_t)tmp, FREAD,
+   error = devsw-d_ioctl(dev, DIOCGMEDIASIZE, (caddr_t)otmp, FREAD,
   curthread);
if (error) {
snprintf(req-error_str, sizeof(req-error_str),
@@ -1953,18 +1951,18 @@ ctl_be_block_open_dev(struct ctl_be_bloc
}
 
if (params-lun_size_bytes != 0) {
-   if (params-lun_size_bytes  tmp) {
+   if (params-lun_size_bytes  otmp) {
snprintf(req-error_str, sizeof(req-error_str),
 requested LUN size %ju  backing device 
 size %ju,
 (uintmax_t)params-lun_size_bytes,
-(uintmax_t)be_lun-size_bytes);
+(uintmax_t)otmp);
return (EINVAL);
}
 
be_lun-size_bytes = params-lun_size_bytes;
} else
-   be_lun-size_bytes = tmp;
+   be_lun-size_bytes = otmp;
 
error = devsw-d_ioctl(dev, DIOCGSTRIPESIZE,
   (caddr_t)ps, FREAD, curthread);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287222 - in head: . sbin/pfctl share/man/man5 sys/net sys/netpfil/pf

2015-08-27 Thread Kristof Provost
Author: kp
Date: Thu Aug 27 21:27:47 2015
New Revision: 287222
URL: https://svnweb.freebsd.org/changeset/base/287222

Log:
  pf: Remove support for 'scrub fragment crop|drop-ovl'
  
  The crop/drop-ovl fragment scrub modes are not very useful and likely to 
confuse
  users into making poor choices.
  It's also a fairly large amount of complex code, so just remove the support
  altogether.
  
  Users who have 'scrub fragment crop|drop-ovl' in their pf configuration will 
be
  implicitly converted to 'scrub fragment reassemble'.
  
  Reviewed by:  gnn, eri
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D3466

Modified:
  head/UPDATING
  head/sbin/pfctl/parse.y
  head/sbin/pfctl/pfctl_parser.c
  head/share/man/man5/pf.conf.5
  head/sys/net/pfvar.h
  head/sys/netpfil/pf/pf_norm.c

Modified: head/UPDATING
==
--- head/UPDATING   Thu Aug 27 21:16:24 2015(r287221)
+++ head/UPDATING   Thu Aug 27 21:27:47 2015(r287222)
@@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
ln -s 'abort:false,junk:false' /etc/malloc.conf.)
 
+20150827:
+   pf no longer supports 'scrub fragment crop' or 'scrub fragment drop-ovl'
+   These configurations are now automatically interpreted as
+   'scrub fragment reassemble'.
+
 20150817:
Kernel-loadable modules for the random(4) device are back. To use
them, the kernel must have

Modified: head/sbin/pfctl/parse.y
==
--- head/sbin/pfctl/parse.y Thu Aug 27 21:16:24 2015(r287221)
+++ head/sbin/pfctl/parse.y Thu Aug 27 21:27:47 2015(r287222)
@@ -1197,8 +1197,8 @@ scrub_opt : NODF  {
;
 
 fragcache  : FRAGMENT REASSEMBLE   { $$ = 0; /* default */ }
-   | FRAGMENT FRAGCROP { $$ = PFRULE_FRAGCROP; }
-   | FRAGMENT FRAGDROP { $$ = PFRULE_FRAGDROP; }
+   | FRAGMENT FRAGCROP { $$ = 0; }
+   | FRAGMENT FRAGDROP { $$ = 0; }
;
 
 antispoof  : ANTISPOOF logquick antispoof_ifspc af antispoof_opts {

Modified: head/sbin/pfctl/pfctl_parser.c
==
--- head/sbin/pfctl/pfctl_parser.c  Thu Aug 27 21:16:24 2015
(r287221)
+++ head/sbin/pfctl/pfctl_parser.c  Thu Aug 27 21:27:47 2015
(r287222)
@@ -990,12 +990,7 @@ print_rule(struct pf_rule *r, const char
if (r-rule_flag  PFRULE_REASSEMBLE_TCP)
printf( reassemble tcp);
 
-   if (r-rule_flag  PFRULE_FRAGDROP)
-   printf( fragment drop-ovl);
-   else if (r-rule_flag  PFRULE_FRAGCROP)
-   printf( fragment crop);
-   else
-   printf( fragment reassemble);
+   printf( fragment reassemble);
}
if (r-label[0])
printf( label \%s\, r-label);

Modified: head/share/man/man5/pf.conf.5
==
--- head/share/man/man5/pf.conf.5   Thu Aug 27 21:16:24 2015
(r287221)
+++ head/share/man/man5/pf.conf.5   Thu Aug 27 21:27:47 2015
(r287222)
@@ -666,33 +666,6 @@ packet, and only the completed packet is
 The advantage is that filter rules have to deal only with complete
 packets, and can ignore fragments.
 The drawback of caching fragments is the additional memory cost.
-But the full reassembly method is the only method that currently works
-with NAT.
-This is the default behavior of a
-.Ar scrub
-rule if no fragmentation modifier is supplied.
-.It Ar fragment crop
-The default fragment reassembly method is expensive, hence the option
-to crop is provided.
-In this case,
-.Xr pf 4
-will track the fragments and cache a small range descriptor.
-Duplicate fragments are dropped and overlaps are cropped.
-Thus data will only occur once on the wire with ambiguities resolving to
-the first occurrence.
-Unlike the
-.Ar fragment reassemble
-modifier, fragments are not buffered, they are passed as soon as they
-are received.
-The
-.Ar fragment crop
-reassembly mechanism does not yet work with NAT.
-.It Ar fragment drop-ovl
-This option is similar to the
-.Ar fragment crop
-modifier except that all overlapping or duplicate fragments will be
-dropped, and all further corresponding fragments will be
-dropped as well.
 .It Ar reassemble tcp
 Statefully normalizes TCP connections.
 .Ar scrub reassemble tcp
@@ -2987,8 +2960,7 @@ state-opt  = ( max number | no-sy
  overload \*(Lt string \*(Gt [ flush ] |
  if-bound | floating )
 
-fragmentation  = [ fragment reassemble | fragment crop |
- fragment drop-ovl ]
+fragmentation  = [ fragment reassemble

Re: svn commit: r287206 - head/sys/sys

2015-08-27 Thread Pedro Giffuni



On 08/27/15 16:15, Pedro Giffuni wrote:

...



...


The original change to cdefs.h appears to be plain wrong.



Not really, it may appear some day.




I take that back, there is something wrong:

#ifndef __has_feature
#define __has_feature(x) (0)
#endif

#if __has_attribute(alloc_size)
#error Has attribute
#endif

$ cc -E attr-text.c
# 1 attr-text.c
# 1 built-in
# 1 command-line
# 1 attr-text.c
attr-text.c:5:20: error: missing binary operator before token (

$ cc --version
cc (GCC) 4.2.1 20070831 patched [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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


svn commit: r287225 - in head: share/man/man4 share/man/man9 sys/conf sys/dev/ow sys/modules sys/modules/ow sys/modules/ow/ow sys/modules/ow/ow_temp sys/modules/ow/owc

2015-08-27 Thread Warner Losh
Author: imp
Date: Thu Aug 27 23:33:38 2015
New Revision: 287225
URL: https://svnweb.freebsd.org/changeset/base/287225

Log:
  New 1-Wire bus implementation. 1-Wire controller is abstracted, though
  only gpiobus configured via FDT is supported. Bus enumeration is
  supported. Devices are created for each device found. 1-Wire
  temperature controllers are supported, but other drivers could be
  written. Temperatures are polled and reported via a sysctl.  Errors
  are reported via sysctl counters. Mis-wired bus detection is included
  for more trouble shooting. See ow(4), owc(4) and ow_temp(4) for
  details of what's supported and known issues.
  
  This has been tested on Raspberry Pi-B, Pi2 and Beagle Bone Black
  with up to 7 devices.
  
  Differential Revision: https://reviews.freebsd.org/D2956
  Relnotes: yes
  MFC after: 2 weeks
  Reviewed by: loos@ (with many insightful comments)

Added:
  head/share/man/man4/ow.4   (contents, props changed)
  head/share/man/man4/ow_temp.4   (contents, props changed)
  head/share/man/man4/owc.4   (contents, props changed)
  head/share/man/man9/owll.9   (contents, props changed)
  head/share/man/man9/own.9   (contents, props changed)
  head/sys/dev/ow/
  head/sys/dev/ow/README.txt   (contents, props changed)
  head/sys/dev/ow/ow.c   (contents, props changed)
  head/sys/dev/ow/ow.h   (contents, props changed)
  head/sys/dev/ow/ow_temp.c   (contents, props changed)
  head/sys/dev/ow/owc_gpiobus.c   (contents, props changed)
  head/sys/dev/ow/owll.h   (contents, props changed)
  head/sys/dev/ow/owll_if.m   (contents, props changed)
  head/sys/dev/ow/own.h   (contents, props changed)
  head/sys/dev/ow/own_if.m   (contents, props changed)
  head/sys/modules/ow/
  head/sys/modules/ow/Makefile   (contents, props changed)
  head/sys/modules/ow/ow/
  head/sys/modules/ow/ow/Makefile   (contents, props changed)
  head/sys/modules/ow/ow_temp/
  head/sys/modules/ow/ow_temp/Makefile   (contents, props changed)
  head/sys/modules/ow/owc/
  head/sys/modules/ow/owc/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/share/man/man9/Makefile
  head/sys/conf/files
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileThu Aug 27 22:42:02 2015
(r287224)
+++ head/share/man/man4/MakefileThu Aug 27 23:33:38 2015
(r287225)
@@ -379,6 +379,9 @@ MAN=aac.4 \
oce.4 \
ohci.4 \
orm.4 \
+   ow.4 \
+   ow_temp.4 \
+   owc.4 \
${_padlock.4} \
pass.4 \
patm.4 \
@@ -667,6 +670,7 @@ MLINKS+=nge.4 if_nge.4
 MLINKS+=${_ntb.4} ${_if_ntb.4} \
${_ntb.4} ${_ntb_hw.4}
 MLINKS+=${_nxge.4} ${_if_nxge.4}
+MLINKS+=ow.4 onewire.4
 MLINKS+=patm.4 if_patm.4
 MLINKS+=pccbb.4 cbb.4
 MLINKS+=pcm.4 snd.4 \

Added: head/share/man/man4/ow.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/ow.4Thu Aug 27 23:33:38 2015(r287225)
@@ -0,0 +1,60 @@
+.\
+.\ Copyright (c) 2015 M. Warner Losh
+.\ 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. The name of the author may not be used to endorse or promote products
+.\derived from this software without specific prior written permission.
+.\
+.\ 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.
+.\
+.\ $FreeBSD$
+.\
+.Dd July 20, 2015
+.Dt OW 4
+.Os
+.Sh NAME
+.Nm ow
+.Nd Dallas Semiconductor 1-Wire bus
+.Sh SYNOPSIS
+.Cd device ow
+.Sh DESCRIPTION
+The
+.Nm
+module implements the Dallas Semiconductor 1-Wire bus.
+It attaches to the
+.Xr owc 4
+driver, which implements the low-level signaling of the
+1-Wire bus.
+.Sh SEE ALSO
+.Xr ow_temp 4 ,
+.Xr owc 4 ,
+.Xr owll 9 ,
+.Xr own 9
+.Sh LEGAL
+.Tn 1-Wire
+is a registered trademark of Maxim Integrated Products, Inc.
+.Sh HISTORY
+The
+.Nm
+driver first 

svn commit: r287224 - head/share/mk

2015-08-27 Thread Warner Losh
Author: imp
Date: Thu Aug 27 22:42:02 2015
New Revision: 287224
URL: https://svnweb.freebsd.org/changeset/base/287224

Log:
  Document bsd.endian.mk.

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEThu Aug 27 21:52:09 2015(r287223)
+++ head/share/mk/bsd.READMEThu Aug 27 22:42:02 2015(r287224)
@@ -21,6 +21,7 @@ bsd.compiler.mk   - defined based on curr
 bsd.cpu.mk - sets CPU/arch-related variables (included from sys.mk)
 bsd.dep.mk - handle Makefile dependencies
 bsd.doc.mk - building troff system documents
+bsd.endian.mk  - TARGET_ENDIAN=1234(little) or 4321 (big) for target
 bsd.files.mk   - install of general purpose files
 bsd.incs.mk- install of include files
 bsd.info.mk- building GNU Info hypertext system (deprecated)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287227 - in head: lib/libstand share/mk sys/boot/efi sys/boot/ficl sys/boot/i386 sys/boot/libstand32 sys/boot/pc98 sys/boot/userboot/ficl sys/boot/userboot/libstand sys/boot/zfs

2015-08-27 Thread Warner Losh
Author: imp
Date: Thu Aug 27 23:46:42 2015
New Revision: 287227
URL: https://svnweb.freebsd.org/changeset/base/287227

Log:
  Use CFLAGS_NO_SIMD in preference to varying lists of -mno- flags.
  Go ahead and defined -D_STANDALONE for all targets (only strictly
  needed for some architecture, but harmless on those it isn't required
  for). Also add -msoft-float to all architectures uniformly rather
  that higgley piggley like it is today.
  
  Differential Revision: https://reviews.freebsd.org/D3496

Added:
  head/share/mk/bsd.stand.mk   (contents, props changed)
Modified:
  head/lib/libstand/Makefile
  head/sys/boot/efi/Makefile.inc
  head/sys/boot/ficl/Makefile
  head/sys/boot/i386/Makefile.inc
  head/sys/boot/libstand32/Makefile
  head/sys/boot/pc98/Makefile.inc
  head/sys/boot/userboot/ficl/Makefile
  head/sys/boot/userboot/libstand/Makefile
  head/sys/boot/zfs/Makefile

Modified: head/lib/libstand/Makefile
==
--- head/lib/libstand/Makefile  Thu Aug 27 23:46:11 2015(r287226)
+++ head/lib/libstand/Makefile  Thu Aug 27 23:46:42 2015(r287227)
@@ -21,34 +21,8 @@ MAN= libstand.3
 
 WARNS?=0
 
-CFLAGS+= -ffreestanding -Wformat
 CFLAGS+= -I${LIBSTAND_SRC}
 
-.if ${MACHINE_CPUARCH} == i386 || ${MACHINE_CPUARCH} == amd64
-CFLAGS+=   -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
-.endif
-.if ${MACHINE_CPUARCH} == i386
-CFLAGS.gcc+=   -mpreferred-stack-boundary=2
-.endif
-.if ${MACHINE_CPUARCH} == amd64
-CFLAGS+=   -fPIC -mno-red-zone
-.endif
-.if ${MACHINE} == pc98
-CFLAGS+=   -Os
-.endif
-.if ${MACHINE_CPUARCH} == powerpc
-CFLAGS+=   -msoft-float -D_STANDALONE -DNETIF_DEBUG
-.endif
-.if ${MACHINE_CPUARCH} == arm
-CFLAGS+=   -msoft-float -D_STANDALONE
-.endif
-.if ${MACHINE_CPUARCH} == aarch64
-CFLAGS+=   -D_STANDALONE -mgeneral-regs-only
-.endif
-.if ${MACHINE_CPUARCH} == mips
-CFLAGS+=   -G0 -fno-pic -mno-abicalls
-.endif
-
 # standalone components and stuff we have modified locally
 SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c bswap.c environment.c getopt.c 
gets.c \
globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c 
random.c \
@@ -168,4 +142,5 @@ SRCS+=  pkgfs.c
 SRCS+= nandfs.c
 .endif
 
+.include bsd.stand.mk
 .include bsd.lib.mk

Added: head/share/mk/bsd.stand.mk
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/mk/bsd.stand.mk  Thu Aug 27 23:46:42 2015(r287227)
@@ -0,0 +1,24 @@
+# $FreeBSD$
+#
+# Common definitons for programs building in the stand-alone environment
+# and/or using libstand.
+#
+
+CFLAGS+= -ffreestanding -Wformat
+CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -D_STANDALONE
+
+.if ${MACHINE_CPUARCH} == i386
+CFLAGS.gcc+=   -mpreferred-stack-boundary=2
+.endif
+.if ${MACHINE_CPUARCH} == amd64
+CFLAGS+=   -fPIC -mno-red-zone
+.endif
+.if ${MACHINE} == pc98
+CFLAGS+=   -Os
+.endif
+.if ${MACHINE_CPUARCH} == aarch64
+CFLAGS+=   -mgeneral-regs-only
+.endif
+.if ${MACHINE_CPUARCH} == mips
+CFLAGS+=   -G0 -fno-pic -mno-abicalls
+.endif

Modified: head/sys/boot/efi/Makefile.inc
==
--- head/sys/boot/efi/Makefile.inc  Thu Aug 27 23:46:11 2015
(r287226)
+++ head/sys/boot/efi/Makefile.inc  Thu Aug 27 23:46:42 2015
(r287227)
@@ -4,19 +4,18 @@ BINDIR?=  /boot
 
 .if ${MACHINE_CPUARCH} == i386
 CFLAGS+=-march=i386
+CFLAGS+=   -mno-aes
 .endif
 
 # Options used when building app-specific efi components
 # See conf/kern.mk for the correct set of these
-CFLAGS+=   -ffreestanding -Wformat -msoft-float
+CFLAGS+=   -ffreestanding -Wformat -msoft-float ${CFLAGS_NO_SIMD}
 LDFLAGS+=  -nostdlib
 
 .if ${MACHINE_CPUARCH} == amd64
 CFLAGS+=   -fshort-wchar
 CFLAGS+=   -mno-red-zone
-CFLAGS+=   -mno-mmx -mno-sse
-CFLAGS.clang+= -mno-aes -mno-avx
+CFLAGS+=   -mno-aes
 .endif
 
-
 .include ../Makefile.inc

Modified: head/sys/boot/ficl/Makefile
==
--- head/sys/boot/ficl/Makefile Thu Aug 27 23:46:11 2015(r287226)
+++ head/sys/boot/ficl/Makefile Thu Aug 27 23:46:42 2015(r287227)
@@ -15,30 +15,14 @@ BASE_SRCS=  dict.c ficl.c fileaccess.c fl
 
 SRCS=  ${BASE_SRCS} sysdep.c softcore.c
 CLEANFILES=softcore.c testmain testmain.o
-CFLAGS+=   -ffreestanding
 .if ${MACHINE_CPUARCH} == i386 || \
 (${MACHINE_CPUARCH} == amd64  defined(FICL32))
 CFLAGS+=   -march=i386
-CFLAGS.gcc+=   -mpreferred-stack-boundary=2
-.endif
-.if ${MACHINE_CPUARCH} == amd64
-CFLAGS+=   -mno-red-zone
-.endif
-.if ${MACHINE_CPUARCH} == i386 || ${MACHINE_CPUARCH} == amd64
-CFLAGS+=   -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
-.endif
-.if 

svn commit: r287241 - head/gnu/usr.bin/binutils

2015-08-27 Thread Warner Losh
Author: imp
Date: Fri Aug 28 04:32:43 2015
New Revision: 287241
URL: https://svnweb.freebsd.org/changeset/base/287241

Log:
  Add another .WAIT since sometimes we lose the race.

Modified:
  head/gnu/usr.bin/binutils/Makefile

Modified: head/gnu/usr.bin/binutils/Makefile
==
--- head/gnu/usr.bin/binutils/Makefile  Fri Aug 28 03:03:09 2015
(r287240)
+++ head/gnu/usr.bin/binutils/Makefile  Fri Aug 28 04:32:43 2015
(r287241)
@@ -5,6 +5,7 @@
 SUBDIR=doc\
libiberty \
libbfd \
+   .WAIT \
libopcodes \
libbinutils \
.WAIT \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r287241 - head/gnu/usr.bin/binutils

2015-08-27 Thread Warner Losh
Yes. This fix was easy. That fix is a little harder, so I pushed this
inquickly while I do the harder fix after a good night's sleep (it isn't
that much harder, but it's been a long day).

Warner

On Thu, Aug 27, 2015 at 10:45 PM, Alexey Dokuchaev da...@freebsd.org
wrote:

 On Fri, Aug 28, 2015 at 04:32:43AM +, Warner Losh wrote:
  New Revision: 287241
  URL: https://svnweb.freebsd.org/changeset/base/287241
 
  Log:
Add another .WAIT since sometimes we lose the race.

 Is there a way to actually correctly specify dependencies between targets
 instead?

 ./danfe

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


Re: svn commit: r287236 - head/bin/df

2015-08-27 Thread Alexey Dokuchaev
On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
 New Revision: 287236
 URL: https://svnweb.freebsd.org/changeset/base/287236
 
 Log:
   Use exit() instead of return in main().

Because?..

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


svn commit: r287240 - in head/sys/powerpc: booke include

2015-08-27 Thread Justin Hibbits
Author: jhibbits
Date: Fri Aug 28 03:03:09 2015
New Revision: 287240
URL: https://svnweb.freebsd.org/changeset/base/287240

Log:
  Extend pmap to support e500mc and e5500.
  
  As part of this, clean up tlb1_init(), since bootinfo is always NULL here just
  eliminate the loop altogether.
  
  Also, fix a bug in mmu_booke_mapdev_attr() where it's possible to map a larger
  immediately following a smaller page, causing the mappings to overlap.  
Instead,
  break up the new mapping into smaller chunks.  The downside to this is that it
  uses more precious TLB1 entries, which, on smaller chips (e500v2) it could 
cause
  problems with TLB1 being out of space (e500v2 only has 16 TLB1 entries).
  
  Obtained from:Semihalf (partial)
  Sponsored by: Alex Perez/Inertial Computing

Modified:
  head/sys/powerpc/booke/pmap.c
  head/sys/powerpc/booke/trap_subr.S
  head/sys/powerpc/include/tlb.h

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Fri Aug 28 02:29:31 2015
(r287239)
+++ head/sys/powerpc/booke/pmap.c   Fri Aug 28 03:03:09 2015
(r287240)
@@ -178,15 +178,17 @@ static volatile pmap_t tidbusy[MAXCPU][T
 uint32_t tlb0_entries;
 uint32_t tlb0_ways;
 uint32_t tlb0_entries_per_way;
+uint32_t tlb1_entries;
 
 #define TLB0_ENTRIES   (tlb0_entries)
 #define TLB0_WAYS  (tlb0_ways)
 #define TLB0_ENTRIES_PER_WAY   (tlb0_entries_per_way)
 
-#define TLB1_ENTRIES 16
+#define TLB1_ENTRIES (tlb1_entries)
+#define TLB1_MAXENTRIES64
 
 /* In-ram copy of the TLB1 */
-static tlb_entry_t tlb1[TLB1_ENTRIES];
+static tlb_entry_t tlb1[TLB1_MAXENTRIES];
 
 /* Next free entry in the TLB1 */
 static unsigned int tlb1_idx;
@@ -495,6 +497,16 @@ tlb0_get_tlbconf(void)
tlb0_entries_per_way = tlb0_entries / tlb0_ways;
 }
 
+/* Return number of entries in TLB1. */
+static __inline void
+tlb1_get_tlbconf(void)
+{
+   uint32_t tlb1_cfg;
+
+   tlb1_cfg = mfspr(SPR_TLB1CFG);
+   tlb1_entries = tlb1_cfg  TLBCFG_NENTRY_MASK;
+}
+
 /* Initialize pool of kva ptbl buffers. */
 static void
 ptbl_init(void)
@@ -1224,7 +1236,7 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset
debugf(fill in phys_avail:\n);
for (i = 0, j = 0; i  availmem_regions_sz; i++, j += 2) {
 
-   debugf( region: 0x%08x - 0x%08x (0x%08x)\n,
+   debugf( region: 0x%jx - 0x%jx (0x%jx)\n,
availmem_regions[i].mr_start,
availmem_regions[i].mr_start +
availmem_regions[i].mr_size,
@@ -2803,6 +2815,11 @@ mmu_booke_mapdev_attr(mmu_t mmu, vm_padd
 
do {
sz = 1  (ilog2(size)  ~1);
+   if (va % sz != 0) {
+   do {
+   sz = 1;
+   } while (va % sz != 0);
+   }
if (bootverbose)
printf(Wiring VA=%x to PA=%llx (size=%x), 
using TLB1[%d]\n, va, pa, sz, tlb1_idx);
@@ -3042,8 +3059,21 @@ tlb1_write_entry(unsigned int idx)
__asm __volatile(isync);
mtspr(SPR_MAS3, tlb1[idx].mas3);
__asm __volatile(isync);
-   mtspr(SPR_MAS7, tlb1[idx].mas7);
-   __asm __volatile(isync; tlbwe; isync; msync);
+   switch ((mfpvr()  16)  0x) {
+   case FSL_E500mc:
+   case FSL_E5500:
+   mtspr(SPR_MAS8, 0);
+   __asm __volatile(isync);
+   /* FALLTHROUGH */
+   case FSL_E500v2:
+   mtspr(SPR_MAS7, tlb1[idx].mas7);
+   __asm __volatile(isync);
+   break;
+   default:
+   break;
+   }
+
+   __asm __volatile(tlbwe; isync; msync);
 
//debugf(tlb1_write_entry: e\n);
 }
@@ -3210,42 +3240,34 @@ tlb1_init()
 {
uint32_t mas0, mas1, mas2, mas3, mas7;
uint32_t tsz;
-   u_int i;
+   int i;
 
-   if (bootinfo != NULL  bootinfo[0] != 1) {
-   tlb1_idx = *((uint16_t *)(bootinfo + 8));
-   } else
-   tlb1_idx = 1;
+   tlb1_idx = 1;
 
-   /* The first entry/entries are used to map the kernel. */
-   for (i = 0; i  tlb1_idx; i++) {
-   mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(i);
-   mtspr(SPR_MAS0, mas0);
-   __asm __volatile(isync; tlbre);
-
-   mas1 = mfspr(SPR_MAS1);
-   if ((mas1  MAS1_VALID) == 0)
-   continue;
+   tlb1_get_tlbconf();
 
-   mas2 = mfspr(SPR_MAS2);
-   mas3 = mfspr(SPR_MAS3);
-   mas7 = mfspr(SPR_MAS7);
+   mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(0);
+   mtspr(SPR_MAS0, mas0);
+   __asm __volatile(isync; tlbre);
 
-   tlb1[i].mas1 = mas1;
-   tlb1[i].mas2 = mfspr(SPR_MAS2);
-   tlb1[i].mas3 = mas3;
-   tlb1[i].mas7 = mas7;
-   tlb1[i].virt = mas2  MAS2_EPN_MASK;
- 

Re: svn commit: r287241 - head/gnu/usr.bin/binutils

2015-08-27 Thread Alexey Dokuchaev
On Fri, Aug 28, 2015 at 04:32:43AM +, Warner Losh wrote:
 New Revision: 287241
 URL: https://svnweb.freebsd.org/changeset/base/287241
 
 Log:
   Add another .WAIT since sometimes we lose the race.

Is there a way to actually correctly specify dependencies between targets
instead?

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


svn commit: r287239 - head/sys/dev/ow

2015-08-27 Thread Warner Losh
Author: imp
Date: Fri Aug 28 02:29:31 2015
New Revision: 287239
URL: https://svnweb.freebsd.org/changeset/base/287239

Log:
  Simply to appease gcc's warnings.

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

Modified: head/sys/dev/ow/ow.c
==
--- head/sys/dev/ow/ow.cFri Aug 28 01:32:42 2015(r287238)
+++ head/sys/dev/ow/ow.cFri Aug 28 02:29:31 2015(r287239)
@@ -491,7 +491,7 @@ ow_child_location_str(device_t dev, devi
 size_t buflen)
 {
 
-   snprintf(buf, buflen, );
+   *buf = '\0';
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r287241 - head/gnu/usr.bin/binutils

2015-08-27 Thread Alexey Dokuchaev
On Thu, Aug 27, 2015 at 10:48:00PM -0600, Warner Losh wrote:
 Yes. This fix was easy. That fix is a little harder, so I pushed this
 inquickly while I do the harder fix after a good night's sleep (it isn't
 that much harder, but it's been a long day).

Awesome to hear that, thanks Warner and have a good sleep. :)

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


Re: svn commit: r287241 - head/gnu/usr.bin/binutils

2015-08-27 Thread Warner Losh
I have something I'm testing now, but it's tricky enough that I want to
look at it again in the morning...

Warner


On Thu, Aug 27, 2015 at 10:59 PM, Alexey Dokuchaev da...@freebsd.org
wrote:

 On Thu, Aug 27, 2015 at 10:48:00PM -0600, Warner Losh wrote:
  Yes. This fix was easy. That fix is a little harder, so I pushed this
  inquickly while I do the harder fix after a good night's sleep (it isn't
  that much harder, but it's been a long day).

 Awesome to hear that, thanks Warner and have a good sleep. :)

 ./danfe

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


svn commit: r287242 - head/sys/powerpc/powerpc

2015-08-27 Thread Justin Hibbits
Author: jhibbits
Date: Fri Aug 28 05:20:31 2015
New Revision: 287242
URL: https://svnweb.freebsd.org/changeset/base/287242

Log:
  Fix text alignment.  mcsr was indented one too many spaces.

Modified:
  head/sys/powerpc/powerpc/trap.c

Modified: head/sys/powerpc/powerpc/trap.c
==
--- head/sys/powerpc/powerpc/trap.c Fri Aug 28 04:32:43 2015
(r287241)
+++ head/sys/powerpc/powerpc/trap.c Fri Aug 28 05:20:31 2015
(r287242)
@@ -429,7 +429,7 @@ printtrap(u_int vector, struct trapframe
printf(msssr0 = 0x%lx\n,
(u_long)mfspr(SPR_MSSSR0));
 #elif defined(BOOKE)
-   printf(mcsr   = 0x%lx\n, (u_long)mfspr(SPR_MCSR));
+   printf(   mcsr   = 0x%lx\n, (u_long)mfspr(SPR_MCSR));
 #endif
break;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287245 - in head/sys: net netinet netinet6

2015-08-27 Thread Adrian Chadd
Author: adrian
Date: Fri Aug 28 05:58:16 2015
New Revision: 287245
URL: https://svnweb.freebsd.org/changeset/base/287245

Log:
  Replace the printf()s with optional rate limited debugging for RSS.
  
  Submitted by: Tiwei Bie b...@mail.ustc.edu.cn
  Differential Revision:https://reviews.freebsd.org/D3471

Modified:
  head/sys/net/rss_config.c
  head/sys/net/rss_config.h
  head/sys/netinet/in_rss.c
  head/sys/netinet6/in6_rss.c

Modified: head/sys/net/rss_config.c
==
--- head/sys/net/rss_config.c   Fri Aug 28 05:29:52 2015(r287244)
+++ head/sys/net/rss_config.c   Fri Aug 28 05:58:16 2015(r287245)
@@ -152,6 +152,15 @@ SYSCTL_INT(_net_inet_rss, OID_AUTO, base
 __DECONST(int *, rss_basecpu), 0, RSS base CPU);
 
 /*
+ * Print verbose debugging messages.
+ * 0 - disable
+ * non-zero - enable
+ */
+intrss_debug = 0;
+SYSCTL_INT(_net_inet_rss, OID_AUTO, debug, CTLFLAG_RWTUN, rss_debug, 0,
+RSS debug level);
+
+/*
  * RSS secret key, intended to prevent attacks on load-balancing.  Its
  * effectiveness may be limited by algorithm choice and available entropy
  * during the boot.
@@ -194,8 +203,8 @@ rss_init(__unused void *arg)
break;
 
default:
-   printf(%s: invalid RSS hashalgo %u, coercing to %u,
-   __func__, rss_hashalgo, RSS_HASH_TOEPLITZ);
+   RSS_DEBUG(invalid RSS hashalgo %u, coercing to %u\n,
+   rss_hashalgo, RSS_HASH_TOEPLITZ);
rss_hashalgo = RSS_HASH_TOEPLITZ;
}
 
@@ -229,8 +238,8 @@ rss_init(__unused void *arg)
 * ones.
 */
if (rss_bits == 0 || rss_bits  RSS_MAXBITS) {
-   printf(%s: RSS bits %u not valid, coercing to  %u,
-   __func__, rss_bits, RSS_MAXBITS);
+   RSS_DEBUG(RSS bits %u not valid, coercing to %u\n,
+   rss_bits, RSS_MAXBITS);
rss_bits = RSS_MAXBITS;
}
 
@@ -241,9 +250,8 @@ rss_init(__unused void *arg)
 */
rss_buckets = (1  rss_bits);
if (rss_buckets  rss_ncpus)
-   printf(%s: WARNING: rss_buckets (%u) less than 
-   rss_ncpus (%u)\n, __func__, rss_buckets,
-   rss_ncpus);
+   RSS_DEBUG(WARNING: rss_buckets (%u) less than 
+   rss_ncpus (%u)\n, rss_buckets, rss_ncpus);
rss_mask = rss_buckets - 1;
} else {
rss_bits = 0;

Modified: head/sys/net/rss_config.h
==
--- head/sys/net/rss_config.h   Fri Aug 28 05:29:52 2015(r287244)
+++ head/sys/net/rss_config.h   Fri Aug 28 05:58:16 2015(r287245)
@@ -93,6 +93,21 @@
 #defineRSS_HASH_PKT_EGRESS 1
 
 /*
+ * Rate limited debugging routines.
+ */
+#defineRSS_DEBUG(format, ...)  do {
\
+   if (rss_debug) {\
+   static struct timeval lastfail; \
+   static int curfail; \
+   if (ppsratecheck(lastfail, curfail, 5))   \
+   printf(RSS (%s:%u):  format, __func__, __LINE__,\
+   ##__VA_ARGS__); \
+   }   \
+} while (0)
+
+extern int rss_debug;
+
+/*
  * Device driver interfaces to query RSS properties that must be programmed
  * into hardware.
  */

Modified: head/sys/netinet/in_rss.c
==
--- head/sys/netinet/in_rss.c   Fri Aug 28 05:29:52 2015(r287244)
+++ head/sys/netinet/in_rss.c   Fri Aug 28 05:58:16 2015(r287245)
@@ -147,7 +147,7 @@ rss_proto_software_hash_v4(struct in_add
}
 
/* No configured available hashtypes! */
-   printf(%s: no available hashtypes!\n, __func__);
+   RSS_DEBUG(no available hashtypes!\n);
return (-1);
 }
 
@@ -183,7 +183,7 @@ rss_mbuf_software_hash_v4(const struct m
 * XXX For now this only handles hashing on incoming mbufs.
 */
if (dir != RSS_HASH_PKT_INGRESS) {
-   printf(%s: called on EGRESS packet!\n, __func__);
+   RSS_DEBUG(called on EGRESS packet!\n);
return (-1);
}
 
@@ -192,11 +192,11 @@ rss_mbuf_software_hash_v4(const struct m
 * to have an IPv4 header in it.
 */
if (m-m_pkthdr.len  (sizeof(struct ip))) {
-   printf(%s: short mbuf pkthdr\n, __func__);
+   RSS_DEBUG(short mbuf pkthdr\n);
return (-1);
}
if (m-m_len  (sizeof(struct 

svn commit: r287238 - head/sys/dev/msk

2015-08-27 Thread Pyun YongHyeon
Author: yongari
Date: Fri Aug 28 01:32:42 2015
New Revision: 287238
URL: https://svnweb.freebsd.org/changeset/base/287238

Log:
  Set DMA alignment constraint of status, TX and RX LEs(List Elements
  in Marvell terms) to 32768.  32768 looks overkill but it will
  ensure correct DMAed update.  This change addresses occasional
  watchdog timeouts reported on 10.2-RELEASE.
  
  Tested by:Johann Hugo jh...@meraka.csir.co.za
  MFC after:2 weeks

Modified:
  head/sys/dev/msk/if_mskreg.h

Modified: head/sys/dev/msk/if_mskreg.h
==
--- head/sys/dev/msk/if_mskreg.hFri Aug 28 00:49:30 2015
(r287237)
+++ head/sys/dev/msk/if_mskreg.hFri Aug 28 01:32:42 2015
(r287238)
@@ -2175,13 +2175,8 @@
 #define MSK_ADDR_LO(x) ((uint64_t) (x)  0xUL)
 #define MSK_ADDR_HI(x) ((uint64_t) (x)  32)
 
-/*
- * At first I guessed 8 bytes, the size of a single descriptor, would be
- * required alignment constraints. But, it seems that Yukon II have 4096
- * bytes boundary alignment constraints.
- */
-#define MSK_RING_ALIGN 4096
-#defineMSK_STAT_ALIGN  4096
+#defineMSK_RING_ALIGN  32768
+#defineMSK_STAT_ALIGN  32768
 
 /* Rx descriptor data structure */
 struct msk_rx_desc {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r287236 - head/bin/df

2015-08-27 Thread NGie Cooper
On Thu, Aug 27, 2015 at 9:43 PM, Alexey Dokuchaev da...@freebsd.org wrote:
 On Fri, Aug 28, 2015 at 12:44:59AM +, Xin LI wrote:
 New Revision: 287236
 URL: https://svnweb.freebsd.org/changeset/base/287236

 Log:
   Use exit() instead of return in main().

 Because?..

Probably because of libxo...
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287193 - head/usr.sbin/pkg

2015-08-27 Thread Xin LI
Author: delphij
Date: Thu Aug 27 06:28:42 2015
New Revision: 287193
URL: https://svnweb.freebsd.org/changeset/base/287193

Log:
  Plug a possible memory leak.
  
  MFC after:2 weeks

Modified:
  head/usr.sbin/pkg/dns_utils.c

Modified: head/usr.sbin/pkg/dns_utils.c
==
--- head/usr.sbin/pkg/dns_utils.c   Thu Aug 27 05:39:32 2015
(r287192)
+++ head/usr.sbin/pkg/dns_utils.c   Thu Aug 27 06:28:42 2015
(r287193)
@@ -84,7 +84,6 @@ compute_weight(struct dns_srvinfo **d, i
int i, j, totalweight;
int *chosen;
 
-   chosen = malloc(sizeof(int) * (last - first + 1));
totalweight = 0;

for (i = 0; i = last; i++)
@@ -93,6 +92,8 @@ compute_weight(struct dns_srvinfo **d, i
if (totalweight == 0)
return;
 
+   chosen = malloc(sizeof(int) * (last - first + 1));
+
for (i = 0; i = last; i++) {
for (;;) {
chosen[i] = random() % (d[i]-weight * 100 / 
totalweight);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287200 - head/sys/kern

2015-08-27 Thread Julien Charbon
Author: jch
Date: Thu Aug 27 10:43:35 2015
New Revision: 287200
URL: https://svnweb.freebsd.org/changeset/base/287200

Log:
  Silent a compilation warning on callout_stop()

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cThu Aug 27 09:06:14 2015
(r287199)
+++ head/sys/kern/kern_timeout.cThu Aug 27 10:43:35 2015
(r287200)
@@ -1150,7 +1150,8 @@ _callout_stop_safe(struct callout *c, in
struct callout_cpu *cc, *old_cc;
struct lock_class *class;
int direct, sq_locked, use_lock;
-   int not_on_a_list, not_running;
+   int not_on_a_list;
+   int not_running = 1;
 
if (safe)
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c-c_lock,
@@ -1385,8 +1386,7 @@ again:
 * and indeed impossible to stop then return 0.
 */
not_running = !(cc_exec_curr(cc, direct) == c);
-   } else
-   not_running = 1;
+   }
 
CC_UNLOCK(cc);
return (not_running);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2015-08-27 Thread Konstantin Belousov
On Wed, Aug 26, 2015 at 08:14:15PM +0200, Julien Charbon wrote:
  As I said, I am not opposed to back out this change, callout(9) API in
 mpsafe mode is a already complex/subtle API, it won't change too much
 the current complexity.
 
  Let say that if nobody screams until Friday 8/28, I will put back
 r284245 and revert this change _and_ I will make this case clear in the
 man page.

[Replying to a random message in the whole set of conversations]

There is one more case, besides TCP timers, which is equially, of not
more, critical and sensitive WRT to the callout_stop().  Look at the
sys/kern/subr_sleepqueue.c:sleepq_check_timeout().  Stray return of
the false result from callout_stop() causes creation of the non-killable
processes:  the callout fired, we missed the wakeup and went to sleep
by manually doing the context switch.  Such thread cannot be woken up.

I suspect that your fix is a better approach than my attempt to look
at something similar at PR 200992 (may be not).
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287196 - head/sys/kern

2015-08-27 Thread Julien Charbon
Author: jch
Date: Thu Aug 27 08:15:32 2015
New Revision: 287196
URL: https://svnweb.freebsd.org/changeset/base/287196

Log:
  In callout_stop(), if a callout is both pending and currently
  being serviced return 0 (fail) but it is applicable only
  mpsafe callouts.  Thanks to hselasky for finding this.
  
  Differential Revision:https://reviews.freebsd.org/D3078 (Updated)
  Submitted by: hselasky
  Reviewed by:  jch

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cThu Aug 27 07:53:58 2015
(r287195)
+++ head/sys/kern/kern_timeout.cThu Aug 27 08:15:32 2015
(r287196)
@@ -1379,11 +1379,13 @@ again:
}
callout_cc_del(c, cc);
 
-   /*
-* If we are asked to stop a callout which is currently in progress
-* and indeed impossible to stop then return 0.
-*/
-   not_running = !(cc_exec_curr(cc, direct) == c);
+   if (!use_lock) {
+   /*
+* If we are asked to stop a callout which is currently in 
progress
+* and indeed impossible to stop then return 0.
+*/
+   not_running = !(cc_exec_curr(cc, direct) == c);
+   }
 
CC_UNLOCK(cc);
return (not_running);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287195 - head/sys/netpfil/ipfw

2015-08-27 Thread Alexander V. Chernikov
Author: melifaro
Date: Thu Aug 27 07:53:58 2015
New Revision: 287195
URL: https://svnweb.freebsd.org/changeset/base/287195

Log:
  Fix packets/bytes accounting on i386.
  
  Spotted by:   julian

Modified:
  head/sys/netpfil/ipfw/ip_fw_private.h

Modified: head/sys/netpfil/ipfw/ip_fw_private.h
==
--- head/sys/netpfil/ipfw/ip_fw_private.h   Thu Aug 27 07:43:29 2015
(r287194)
+++ head/sys/netpfil/ipfw/ip_fw_private.h   Thu Aug 27 07:53:58 2015
(r287195)
@@ -256,7 +256,7 @@ struct ip_fw {
ipfw_insn   cmd[1]; /* storage for commands */
 };
 
-#defineIPFW_RULE_CNTR_SIZE (2 * sizeof(counter_u64_t))
+#defineIPFW_RULE_CNTR_SIZE (2 * sizeof(uint64_t))
 
 #endif
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2015-08-27 Thread Julien Charbon

 Hi Hans,

On 26/08/15 18:31, Julien Charbon wrote:
 On 26/08/15 09:25, Hans Petter Selasky wrote:
 On 08/18/15 12:15, Julien Charbon wrote:
 Author: jch
 Date: Tue Aug 18 10:15:09 2015
 New Revision: 286880
 URL: https://svnweb.freebsd.org/changeset/base/286880

 Log:
callout_stop() should return 0 (fail) when the callout is currently
being serviced and indeed unstoppable.

A scenario to reproduce this case is:

- the callout is being serviced and at same time,
- callout_reset() is called on this callout that sets
  the CALLOUT_PENDING flag and at same time,
- callout_stop() is called on this callout and returns 1 (success)
  even if the callout is indeed currently running and unstoppable.

This issue was caught up while making r284245 (D2763) workaround, and
was discussed at BSDCan 2015.  Once applied the r284245 workaround
is not needed anymore and will be reverted.

Differential Revision:https://reviews.freebsd.org/D3078
Reviewed by:jhb
Sponsored by:Verisign, Inc.

 Modified:
head/sys/kern/kern_timeout.c

 Modified: head/sys/kern/kern_timeout.c
 ==

 --- head/sys/kern/kern_timeout.cTue Aug 18 10:07:03 2015(r286879)
 +++ head/sys/kern/kern_timeout.cTue Aug 18 10:15:09 2015(r286880)
 @@ -1150,7 +1150,7 @@ _callout_stop_safe(struct callout *c, in
   struct callout_cpu *cc, *old_cc;
   struct lock_class *class;
   int direct, sq_locked, use_lock;
 -int not_on_a_list;
 +int not_on_a_list, not_running;

   if (safe)
   WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c-c_lock,
 @@ -1378,8 +1378,15 @@ again:
   }
   }
   callout_cc_del(c, cc);
 +
 +/*
 + * If we are asked to stop a callout which is currently in progress
 + * and indeed impossible to stop then return 0.
 + */
 +not_running = !(cc_exec_curr(cc, direct) == c);
 +
   CC_UNLOCK(cc);
 -return (1);
 +return (not_running);
   }

   void

 I think this patch is incomplete and can break the return value for
 non-MPSAFE callouts. I think the correct statement should check the
 value of use_lock too:

 not_running = !(cc_exec_curr(cc, direct) == c  use_lock == 0);

 Because if the callback process waits for lock c_lock in the callback
 process then we have above cc_exec_curr(cc, direct) == c is satisfied
 too, and non-MPSAFE callouts are always cancelable, via
 cc_exec_cancel(cc, direct) = true;
 
  Hum, interesting let me double check that.

 After checking the non-mpsafe callout cases, you are completely right,
this test makes sense only in mpsafe callout case.

 Fixed in r287196:

https://svnweb.freebsd.org/base?view=revisionrevision=287196

 Thanks a lot for your time.

--
Julien



signature.asc
Description: OpenPGP digital signature


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

2015-08-27 Thread Hans Petter Selasky

Hi Julien,

On 08/27/15 10:17, Julien Charbon wrote:


  Hi Hans,


  After checking the non-mpsafe callout cases, you are completely right,
this test makes sense only in mpsafe callout case.




  Fixed in r287196:

https://svnweb.freebsd.org/base?view=revisionrevision=287196

  Thanks a lot for your time.


Possibly you'll need to add an:

else
  not_running = 1;

To restore the old behaviour for non-MPSAFE callouts, because the 
variable is not initialized at top of the function.


--HPS

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


svn commit: r287197 - in head: etc etc/rc.d sys/dev/ath sys/dev/ath/ath_rate/sample sys/dev/bwi sys/dev/bwn sys/dev/if_ndis sys/dev/ipw sys/dev/iwi sys/dev/iwm sys/dev/iwn sys/dev/malo sys/dev/mwl ...

2015-08-27 Thread Gleb Smirnoff
Author: glebius
Date: Thu Aug 27 08:56:39 2015
New Revision: 287197
URL: https://svnweb.freebsd.org/changeset/base/287197

Log:
  Replay r286410. Change KPI of how device drivers that provide wireless
  connectivity interact with the net80211 stack.
  
  Historical background: originally wireless devices created an interface,
  just like Ethernet devices do. Name of an interface matched the name of
  the driver that created. Later, wlan(4) layer was introduced, and the
  wlanX interfaces become the actual interface, leaving original ones as
  a parent interface of wlanX. Kernelwise, the KPI between net80211 layer
  and a driver became a mix of methods that pass a pointer to struct ifnet
  as identifier and methods that pass pointer to struct ieee80211com. From
  user point of view, the parent interface just hangs on in the ifconfig
  list, and user can't do anything useful with it.
  
  Now, the struct ifnet goes away. The struct ieee80211com is the only
  KPI between a device driver and net80211. Details:
  
  - The struct ieee80211com is embedded into drivers softc.
  - Packets are sent via new ic_transmit method, which is very much like
the previous if_transmit.
  - Bringing parent up/down is done via new ic_parent method, which notifies
driver about any changes: number of wlan(4) interfaces, number of them
in promisc or allmulti state.
  - Device specific ioctls (if any) are received on new ic_ioctl method.
  - Packets/errors accounting are done by the stack. In certain cases, when
driver experiences errors and can not attribute them to any specific
interface, driver updates ic_oerrors or ic_ierrors counters.
  
  Details on interface configuration with new world order:
  - A sequence of commands needed to bring up wireless DOESNT change.
  - /etc/rc.conf parameters DON'T change.
  - List of devices that can be used to create wlan(4) interfaces is
now provided by net.wlan.devices sysctl.
  
  Most drivers in this change were converted by me, except of wpi(4),
  that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing
  changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann,
  Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in
  testing.
  
  Reviewed by:  adrian
  Sponsored by: Netflix
  Sponsored by: Nginx, Inc.

Modified:
  head/etc/network.subr
  head/etc/rc.d/netif
  head/sys/dev/ath/ath_rate/sample/sample.c
  head/sys/dev/ath/ath_rate/sample/sample.h
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_beacon.c
  head/sys/dev/ath/if_ath_debug.h
  head/sys/dev/ath/if_ath_misc.h
  head/sys/dev/ath/if_ath_rx.c
  head/sys/dev/ath/if_ath_rx_edma.c
  head/sys/dev/ath/if_ath_sysctl.c
  head/sys/dev/ath/if_ath_tdma.c
  head/sys/dev/ath/if_ath_tx.c
  head/sys/dev/ath/if_ath_tx_edma.c
  head/sys/dev/ath/if_athvar.h
  head/sys/dev/bwi/bwimac.c
  head/sys/dev/bwi/bwiphy.c
  head/sys/dev/bwi/bwirf.c
  head/sys/dev/bwi/if_bwi.c
  head/sys/dev/bwi/if_bwivar.h
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bwn/if_bwnvar.h
  head/sys/dev/if_ndis/if_ndis.c
  head/sys/dev/if_ndis/if_ndisvar.h
  head/sys/dev/ipw/if_ipw.c
  head/sys/dev/ipw/if_ipwvar.h
  head/sys/dev/iwi/if_iwi.c
  head/sys/dev/iwi/if_iwivar.h
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_mac_ctxt.c
  head/sys/dev/iwm/if_iwm_phy_ctxt.c
  head/sys/dev/iwm/if_iwm_power.c
  head/sys/dev/iwm/if_iwm_scan.c
  head/sys/dev/iwm/if_iwmvar.h
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnvar.h
  head/sys/dev/malo/if_malo.c
  head/sys/dev/malo/if_malo.h
  head/sys/dev/mwl/if_mwl.c
  head/sys/dev/mwl/if_mwl_pci.c
  head/sys/dev/mwl/if_mwlvar.h
  head/sys/dev/ral/if_ral_pci.c
  head/sys/dev/ral/rt2560.c
  head/sys/dev/ral/rt2560var.h
  head/sys/dev/ral/rt2661.c
  head/sys/dev/ral/rt2661var.h
  head/sys/dev/ral/rt2860.c
  head/sys/dev/ral/rt2860var.h
  head/sys/dev/usb/wlan/if_rsu.c
  head/sys/dev/usb/wlan/if_rsureg.h
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_rumvar.h
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_runvar.h
  head/sys/dev/usb/wlan/if_uath.c
  head/sys/dev/usb/wlan/if_uathvar.h
  head/sys/dev/usb/wlan/if_upgt.c
  head/sys/dev/usb/wlan/if_upgtvar.h
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_uralvar.h
  head/sys/dev/usb/wlan/if_urtw.c
  head/sys/dev/usb/wlan/if_urtwn.c
  head/sys/dev/usb/wlan/if_urtwnreg.h
  head/sys/dev/usb/wlan/if_urtwvar.h
  head/sys/dev/usb/wlan/if_zyd.c
  head/sys/dev/usb/wlan/if_zydreg.h
  head/sys/dev/wi/if_wi.c
  head/sys/dev/wi/if_wi_macio.c
  head/sys/dev/wi/if_wi_pccard.c
  head/sys/dev/wi/if_wi_pci.c
  head/sys/dev/wi/if_wivar.h
  head/sys/dev/wpi/if_wpi.c
  head/sys/dev/wpi/if_wpivar.h
  head/sys/dev/wtap/if_wtap.c
  head/sys/dev/wtap/if_wtapvar.h
  head/sys/net80211/ieee80211.c
  head/sys/net80211/ieee80211_ddb.c
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/net80211/ieee80211_ioctl.c
  head/sys/net80211/ieee80211_output.c
  head/sys/net80211/ieee80211_power.c
  

svn commit: r287198 - head/sys/kern

2015-08-27 Thread Julien Charbon
Author: jch
Date: Thu Aug 27 08:58:03 2015
New Revision: 287198
URL: https://svnweb.freebsd.org/changeset/base/287198

Log:
  In callout_stop(), do not forget to initialize not_running variable.
  Thanks to hselasky for noticing that.
  
  Differential Revision:https://reviews.freebsd.org/D3078 (Updated)
  Submitted by: hselasky
  Pointy hat to:jch

Modified:
  head/sys/kern/kern_timeout.c

Modified: head/sys/kern/kern_timeout.c
==
--- head/sys/kern/kern_timeout.cThu Aug 27 08:56:39 2015
(r287197)
+++ head/sys/kern/kern_timeout.cThu Aug 27 08:58:03 2015
(r287198)
@@ -1385,7 +1385,8 @@ again:
 * and indeed impossible to stop then return 0.
 */
not_running = !(cc_exec_curr(cc, direct) == c);
-   }
+   } else
+   not_running = 1;
 
CC_UNLOCK(cc);
return (not_running);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2015-08-27 Thread Julien Charbon

 Hi Hans,

On 26/08/15 20:31, Hans Petter Selasky wrote:
 On 08/26/15 20:14, Julien Charbon wrote:
   Let say that if nobody screams until Friday 8/28, I will put back
 r284245 and revert this change_and_  I will make this case clear in the
 man page.
 
 If you can update the manual page about this special case for MPSAFE
 callouts only I presume, then its totally fine.

 Good idea, I am going to update the callout(9) man page to make clear
that in mpsafe case if a callout is pending and currently being serviced
callout_stop() returns 0 (fail).

 Then I can update my projects/hps_head to follow that new change,
 which now is a bit broken. You might also want to check existing
 MPSAFE consumers in the kernel, if this API change makes any
 difference.

 I checked all the mpsafe callouts that check callout_stop() return
value (actually only a few are testing callout_stop() return value), and
none relies on the old behavior (i.e. before r286880).

 I was thinking if user-space TCP might be affected by this. CC'ing Adrian.

 Interesting.

--
Julien



signature.asc
Description: OpenPGP digital signature


svn commit: r287232 - head/share/man/man9

2015-08-27 Thread Mark Johnston
Author: markj
Date: Fri Aug 28 00:12:59 2015
New Revision: 287232
URL: https://svnweb.freebsd.org/changeset/base/287232

Log:
  nv.h lives in sys/ as of r279439.

Modified:
  head/share/man/man9/nv.9

Modified: head/share/man/man9/nv.9
==
--- head/share/man/man9/nv.9Fri Aug 28 00:06:31 2015(r287231)
+++ head/share/man/man9/nv.9Fri Aug 28 00:12:59 2015(r287232)
@@ -60,7 +60,7 @@
 .Sh LIBRARY
 .Lb libnv
 .Sh SYNOPSIS
-.In nv.h
+.In sys/nv.h
 .Ft nvlist_t *
 .Fn nvlist_create int flags
 .Ft void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2015-08-27 Thread Mark Johnston
Author: markj
Date: Fri Aug 28 00:17:21 2015
New Revision: 287233
URL: https://svnweb.freebsd.org/changeset/base/287233

Log:
  Remove an unneeded instruction.
  
  MFC after:1 week

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

Modified: head/sys/amd64/amd64/exception.S
==
--- head/sys/amd64/amd64/exception.SFri Aug 28 00:12:59 2015
(r287232)
+++ head/sys/amd64/amd64/exception.SFri Aug 28 00:17:21 2015
(r287233)
@@ -225,7 +225,6 @@ alltraps_pushregs_no_rdi:
movq$calltrap,dtrace_invop_calltrap_addr(%rip)
 
/* Jump to the code hooked in by DTrace. */
-   movqdtrace_invop_jump_addr,%rax
jmpq*dtrace_invop_jump_addr
 #endif
.globl  calltrap
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287234 - head/cddl/contrib/opensolaris/tools/ctf/cvt

2015-08-27 Thread Mark Johnston
Author: markj
Date: Fri Aug 28 00:38:18 2015
New Revision: 287234
URL: https://svnweb.freebsd.org/changeset/base/287234

Log:
  Re-apply r274569. It was reverted in r276848 since that appeared to fix
  some ctfmerge crashes that started to occur on i386 weeks after r274569 was
  committed. Some later investigation indicated that the crashes were caused
  by malformed CTF info that led to a stack overflow. The issue with CTF
  info in i386 kernels seems to have been resolved by r261246, which updated
  libdwarf and libelf.
  
  r274569 fixes a bug which caused duplicate types to appear in the kernel's
  CTF info. This duplication generally does not cause problems when using
  DTrace, but makes it easier to hit the limit of 2^15 - 1 distinct type
  definitions in a CTF container.
  
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c
==
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Fri Aug 28 00:17:21 
2015(r287233)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c Fri Aug 28 00:38:18 
2015(r287234)
@@ -349,7 +349,7 @@ equiv_node(tdesc_t *ctdp, tdesc_t *mtdp,
int (*equiv)(tdesc_t *, tdesc_t *, equiv_data_t *);
int mapping;
 
-   if (ctdp-t_emark  ed-ed_clear_mark ||
+   if (ctdp-t_emark  ed-ed_clear_mark 
mtdp-t_emark  ed-ed_clear_mark)
return (ctdp-t_emark == mtdp-t_emark);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287235 - in head/sys: sys vm

2015-08-27 Thread Mark Johnston
Author: markj
Date: Fri Aug 28 00:44:17 2015
New Revision: 287235
URL: https://svnweb.freebsd.org/changeset/base/287235

Log:
  Remove weighted page handling from vm_page_advise().
  
  This was added in r51337 as part of the implementation of
  madvise(MADV_DONTNEED).  Its objective was to ensure that the page daemon
  would eventually reclaim other unreferenced pages (i.e., unreferenced pages
  not touched by madvise()) from the active queue.
  
  Now that the pagedaemon performs steady scanning of the active page queue,
  this weighted handling is unnecessary.  Instead, always cache clean pages
  by moving them to the head of the inactive page queue.  This simplifies the
  implementation of vm_page_advise() and eliminates the fragmentation that
  resulted from the distribution of pages among multiple queues.
  
  Suggested by: alc
  Reviewed by:  alc
  Sponsored by: EMC / Isilon Storage Division
  Differential Revision:https://reviews.freebsd.org/D3401

Modified:
  head/sys/sys/pcpu.h
  head/sys/vm/vm_page.c

Modified: head/sys/sys/pcpu.h
==
--- head/sys/sys/pcpu.h Fri Aug 28 00:38:18 2015(r287234)
+++ head/sys/sys/pcpu.h Fri Aug 28 00:44:17 2015(r287235)
@@ -162,7 +162,7 @@ struct pcpu {
longpc_cp_time[CPUSTATES];  /* statclock ticks */
struct device   *pc_device;
void*pc_netisr; /* netisr SWI cookie */
-   int pc_dnweight;/* vm_page_dontneed() */
+   int pc_unused1; /* unused field */
int pc_domain;  /* Memory domain. */
struct rm_queue pc_rm_queue;/* rmlock list of trackers */
uintptr_t   pc_dynamic; /* Dynamic per-cpu data area */

Modified: head/sys/vm/vm_page.c
==
--- head/sys/vm/vm_page.c   Fri Aug 28 00:38:18 2015(r287234)
+++ head/sys/vm/vm_page.c   Fri Aug 28 00:44:17 2015(r287235)
@@ -2542,19 +2542,26 @@ _vm_page_deactivate(vm_page_t m, int ath
struct vm_pagequeue *pq;
int queue;
 
-   vm_page_lock_assert(m, MA_OWNED);
+   vm_page_assert_locked(m);
 
/*
-* Ignore if already inactive.
+* Ignore if the page is already inactive, unless it is unlikely to be
+* reactivated.
 */
-   if ((queue = m-queue) == PQ_INACTIVE)
+   if ((queue = m-queue) == PQ_INACTIVE  !athead)
return;
if (m-wire_count == 0  (m-oflags  VPO_UNMANAGED) == 0) {
-   if (queue != PQ_NONE)
-   vm_page_dequeue(m);
-   m-flags = ~PG_WINATCFLS;
pq = vm_phys_domain(m)-vmd_pagequeues[PQ_INACTIVE];
-   vm_pagequeue_lock(pq);
+   /* Avoid multiple acquisitions of the inactive queue lock. */
+   if (queue == PQ_INACTIVE) {
+   vm_pagequeue_lock(pq);
+   vm_page_dequeue_locked(m);
+   } else {
+   if (queue != PQ_NONE)
+   vm_page_dequeue(m);
+   m-flags = ~PG_WINATCFLS;
+   vm_pagequeue_lock(pq);
+   }
m-queue = PQ_INACTIVE;
if (athead)
TAILQ_INSERT_HEAD(pq-pq_pl, m, plinks.q);
@@ -2729,34 +2736,18 @@ vm_page_cache(vm_page_t m)
 /*
  * vm_page_advise
  *
- * Cache, deactivate, or do nothing as appropriate.  This routine
- * is used by madvise().
- *
- * Generally speaking we want to move the page into the cache so
- * it gets reused quickly.  However, this can result in a silly syndrome
- * due to the page recycling too quickly.  Small objects will not be
- * fully cached.  On the other hand, if we move the page to the inactive
- * queue we wind up with a problem whereby very large objects
- * unnecessarily blow away our inactive and cache queues.
- *
- * The solution is to move the pages based on a fixed weighting.  We
- * either leave them alone, deactivate them, or move them to the cache,
- * where moving them to the cache has the highest weighting.
- * By forcing some pages into other queues we eventually force the
- * system to balance the queues, potentially recovering other unrelated
- * space from active.  The idea is to not force this to happen too
- * often.
+ * Deactivate or do nothing, as appropriate.  This routine is used
+ * by madvise() and vop_stdadvise().
  *
  * The object and page must be locked.
  */
 void
 vm_page_advise(vm_page_t m, int advice)
 {
-   int dnw, head;
 
vm_page_assert_locked(m);
VM_OBJECT_ASSERT_WLOCKED(m-object);
-   if (advice == MADV_FREE) {
+   if (advice == MADV_FREE)
/*
 * Mark the page 

svn commit: r287236 - head/bin/df

2015-08-27 Thread Xin LI
Author: delphij
Date: Fri Aug 28 00:44:58 2015
New Revision: 287236
URL: https://svnweb.freebsd.org/changeset/base/287236

Log:
  Use exit() instead of return in main().
  
  MFC after:2 weeks

Modified:
  head/bin/df/df.c

Modified: head/bin/df/df.c
==
--- head/bin/df/df.cFri Aug 28 00:44:17 2015(r287235)
+++ head/bin/df/df.cFri Aug 28 00:44:58 2015(r287236)
@@ -311,7 +311,7 @@ main(int argc, char *argv[])
 
xo_close_container(storage-system-information);
xo_finish();
-   return (rv);
+   exit(rv);
 }
 
 static char *
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r287237 - head/bin/rm

2015-08-27 Thread Xin LI
Author: delphij
Date: Fri Aug 28 00:49:30 2015
New Revision: 287237
URL: https://svnweb.freebsd.org/changeset/base/287237

Log:
  Respect locale settings.
  
  MFC after:2 weeks

Modified:
  head/bin/rm/rm.c

Modified: head/bin/rm/rm.c
==
--- head/bin/rm/rm.cFri Aug 28 00:44:58 2015(r287236)
+++ head/bin/rm/rm.cFri Aug 28 00:49:30 2015(r287237)
@@ -50,6 +50,7 @@ __FBSDID($FreeBSD$);
 #include fcntl.h
 #include fts.h
 #include grp.h
+#include locale.h
 #include pwd.h
 #include stdint.h
 #include stdio.h
@@ -86,6 +87,8 @@ main(int argc, char *argv[])
int ch;
char *p;
 
+   (void)setlocale(LC_ALL, );
+
/*
 * Test for the special case where the utility is called as
 * unlink, for which the functionality provided is greatly
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org