Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std

2013-07-26 Thread David Chisnall
On 25 Jul 2013, at 19:19, Tijl Coosemans t...@coosemans.org wrote:

 This also
 broke compilation of C code with -D_XOPEN_SOURCE=500.

Do you have a test case for this?

David



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r253636 - head/sys/vm

2013-07-26 Thread David Chisnall
On 25 Jul 2013, at 16:10, m...@freebsd.org wrote:

 Isn't that a compiler bug?  memset(p, 0, n) is the same as bzero(p, n).  Why 
 would the compiler warn on one and not the other?

They are different.  memcpy is defined by the C standard.  bzero is defined by 
POSIX.  When you are compiling C code, the compiler is free to assume behaviour 
of any C standard functions but not of POSIX functions because it does not know 
that you are compiling for a POSIX target (possibly it should do this if the 
relevant POSIX macros are set).  

As Bruce says, however, the C standard excludes memset() and memcpy() in 
freestanding environments (which is a shame, because a lot of optimisations 
depend on their existence, and something I had thought was fixed in C11), so 
this is not relevant in the kernel.

 Does clang have a similar bias for memcpy versus bcopy?

Almost certainly.

David



signature.asc
Description: Message signed with OpenPGP using GPGMail


svn commit: r253670 - head/sys/dev/usb/net

2013-07-26 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jul 26 09:58:56 2013
New Revision: 253670
URL: http://svnweb.freebsd.org/changeset/base/253670

Log:
  Assume that all Apple products using interface class 255, subclass 253
  and protocol 1 are USB ethernet adapters. This avoids keeping and updating
  the product list every now and then. This patch will add support for the
  USB ethernet interface found in the IPAD.
  
  MFC after:1 week

Modified:
  head/sys/dev/usb/net/if_ipheth.c

Modified: head/sys/dev/usb/net/if_ipheth.c
==
--- head/sys/dev/usb/net/if_ipheth.cFri Jul 26 09:11:38 2013
(r253669)
+++ head/sys/dev/usb/net/if_ipheth.cFri Jul 26 09:58:56 2013
(r253670)
@@ -149,6 +149,7 @@ static const struct usb_ether_methods ip
 USB_IFACE_PROTOCOL(pt)
 
 static const STRUCT_USB_HOST_ID ipheth_devs[] = {
+#if 0
{IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE,
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
IPHETH_USBINTF_PROTO)},
@@ -167,6 +168,13 @@ static const STRUCT_USB_HOST_ID ipheth_d
{IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_5,
IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
IPHETH_USBINTF_PROTO)},
+#else
+   /* product agnostic interface match */
+   {USB_VENDOR(USB_VENDOR_APPLE),
+USB_IFACE_CLASS(IPHETH_USBINTF_CLASS),
+USB_IFACE_SUBCLASS(IPHETH_USBINTF_SUBCLASS),
+USB_IFACE_PROTOCOL(IPHETH_USBINTF_PROTO)},
+#endif
 };
 
 static int
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r253672 - head/etc/devd

2013-07-26 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jul 26 10:25:18 2013
New Revision: 253672
URL: http://svnweb.freebsd.org/changeset/base/253672

Log:
  Regenerate usb.conf
  
  MFC after:1 week

Modified:
  head/etc/devd/usb.conf

Modified: head/etc/devd/usb.conf
==
--- head/etc/devd/usb.conf  Fri Jul 26 10:22:04 2013(r253671)
+++ head/etc/devd/usb.conf  Fri Jul 26 10:25:18 2013(r253672)
@@ -8,72 +8,6 @@
 nomatch 32 {
match bus uhub[0-9]+;
match mode host;
-   match vendor 0x05ac;
-   match product 0x1290;
-   match intclass 0xff;
-   match intsubclass 0xfd;
-   match intprotocol 0x01;
-   action kldload -n if_ipheth;
-};
-
-nomatch 32 {
-   match bus uhub[0-9]+;
-   match mode host;
-   match vendor 0x05ac;
-   match product 0x1292;
-   match intclass 0xff;
-   match intsubclass 0xfd;
-   match intprotocol 0x01;
-   action kldload -n if_ipheth;
-};
-
-nomatch 32 {
-   match bus uhub[0-9]+;
-   match mode host;
-   match vendor 0x05ac;
-   match product 0x1294;
-   match intclass 0xff;
-   match intsubclass 0xfd;
-   match intprotocol 0x01;
-   action kldload -n if_ipheth;
-};
-
-nomatch 32 {
-   match bus uhub[0-9]+;
-   match mode host;
-   match vendor 0x05ac;
-   match product 0x1297;
-   match intclass 0xff;
-   match intsubclass 0xfd;
-   match intprotocol 0x01;
-   action kldload -n if_ipheth;
-};
-
-nomatch 32 {
-   match bus uhub[0-9]+;
-   match mode host;
-   match vendor 0x05ac;
-   match product 0x12a0;
-   match intclass 0xff;
-   match intsubclass 0xfd;
-   match intprotocol 0x01;
-   action kldload -n if_ipheth;
-};
-
-nomatch 32 {
-   match bus uhub[0-9]+;
-   match mode host;
-   match vendor 0x05ac;
-   match product 0x12a8;
-   match intclass 0xff;
-   match intsubclass 0xfd;
-   match intprotocol 0x01;
-   action kldload -n if_ipheth;
-};
-
-nomatch 32 {
-   match bus uhub[0-9]+;
-   match mode host;
match vendor 0x0104;
match product 0x00be;
action kldload -n uipaq;
@@ -2938,6 +2872,14 @@ nomatch 32 {
 nomatch 32 {
match bus uhub[0-9]+;
match mode host;
+   match vendor 0x1004;
+   match product 0x618f;
+   action kldload -n u3g;
+};
+
+nomatch 32 {
+   match bus uhub[0-9]+;
+   match mode host;
match vendor 0x100d;
match product (0x9031|0x9032);
action kldload -n if_run;
@@ -4042,6 +3984,14 @@ nomatch 32 {
 nomatch 32 {
match bus uhub[0-9]+;
match mode host;
+   match vendor 0x17ef;
+   match product 0x7203;
+   action kldload -n if_axe;
+};
+
+nomatch 32 {
+   match bus uhub[0-9]+;
+   match mode host;
match vendor 0x17f4;
match product 0x;
action kldload -n uslcom;
@@ -4826,6 +4776,16 @@ nomatch 32 {
 nomatch 32 {
match bus uhub[0-9]+;
match mode host;
+   match vendor 0x05ac;
+   match intclass 0xff;
+   match intsubclass 0xfd;
+   match intprotocol 0x01;
+   action kldload -n if_ipheth;
+};
+
+nomatch 32 {
+   match bus uhub[0-9]+;
+   match mode host;
match vendor 0x0a5c;
match intclass 0xff;
match intsubclass 0x01;
@@ -4976,5 +4936,5 @@ nomatch 32 {
action kldload -n umass;
 };
 
-# 2480 USB entries processed
+# 2477 USB entries processed
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std

2013-07-26 Thread Tijl Coosemans
On Fri, 26 Jul 2013 10:43:07 +0100 David Chisnall wrote:
 On 25 Jul 2013, at 19:19, Tijl Coosemans t...@coosemans.org wrote:
 This also
 broke compilation of C code with -D_XOPEN_SOURCE=500.
 
 Do you have a test case for this?

% cc -c test.c -D_XOPEN_SOURCE=500 -Wall -std=gnu89
test.c:5:10: warning: implicit declaration of function 'isnan'
  [-Wimplicit-function-declaration]
return( isnan( d ));
^
1 warning generated.

The isnan function is part of SUSv2:
http://pubs.opengroup.org/onlinepubs/7990989775/xsh/isnan.html

_XOPEN_SOURCE is handled in sys/cdefs.h. It sets the following macros:
#define __XSI_VISIBLE   500
#define __POSIX_VISIBLE 199506
#define __ISO_C_VISIBLE 1990


signature.asc
Description: PGP signature


Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std

2013-07-26 Thread David Chisnall
On 26 Jul 2013, at 11:26, Tijl Coosemans t...@coosemans.org wrote:

 On Fri, 26 Jul 2013 10:43:07 +0100 David Chisnall wrote:
 On 25 Jul 2013, at 19:19, Tijl Coosemans t...@coosemans.org wrote:
 This also
 broke compilation of C code with -D_XOPEN_SOURCE=500.
 
 Do you have a test case for this?
 
 % cc -c test.c -D_XOPEN_SOURCE=500 -Wall -std=gnu89
 test.c:5:10: warning: implicit declaration of function 'isnan'
  [-Wimplicit-function-declaration]
return( isnan( d ));
^
 1 warning generated.
 
 The isnan function is part of SUSv2:
 http://pubs.opengroup.org/onlinepubs/7990989775/xsh/isnan.html
 
 _XOPEN_SOURCE is handled in sys/cdefs.h. It sets the following macros:
 #define __XSI_VISIBLE   500
 #define __POSIX_VISIBLE 199506
 #define __ISO_C_VISIBLE 1990

So, isnan and isinf should be visible in functions when in __ISO_C_VISIBLE  
1999 and __XSI_VISIBLE  600, 
and __XSI_VISIBLE  = 500?

David



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r253563 - head/contrib/libstdc++/include/c_std

2013-07-26 Thread Jilles Tjoelker
On Fri, Jul 26, 2013 at 11:51:43AM +0100, David Chisnall wrote:
 On 26 Jul 2013, at 11:26, Tijl Coosemans t...@coosemans.org wrote:

  On Fri, 26 Jul 2013 10:43:07 +0100 David Chisnall wrote:
  On 25 Jul 2013, at 19:19, Tijl Coosemans t...@coosemans.org wrote:
  This also broke compilation of C code with -D_XOPEN_SOURCE=500.

  Do you have a test case for this?

  % cc -c test.c -D_XOPEN_SOURCE=500 -Wall -std=gnu89
  test.c:5:10: warning: implicit declaration of function 'isnan'
   [-Wimplicit-function-declaration]
 return( isnan( d ));
 ^
  1 warning generated.

  The isnan function is part of SUSv2:
  http://pubs.opengroup.org/onlinepubs/7990989775/xsh/isnan.html

  _XOPEN_SOURCE is handled in sys/cdefs.h. It sets the following macros:
  #define __XSI_VISIBLE   500
  #define __POSIX_VISIBLE 199506
  #define __ISO_C_VISIBLE 1990

 So, isnan and isinf should be visible in functions when in
 __ISO_C_VISIBLE  1999 and __XSI_VISIBLE  600, and __XSI_VISIBLE  =
 500?

This is cosmetic, but
http://pubs.opengroup.org/onlinepubs/95399/functions/isnan.html says
that isnan() appeared in Issue 3. This is before _XOPEN_SOURCE == 500. A
simple solution is to expose it when __XSI_VISIBLE  0  __XSI_VISIBLE
 600  __ISO_C_VISIBLE  1999. However, sys/cdefs.h has no support
for _XOPEN_SOURCE  500 and there is no point in adding such support
now.

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


svn commit: r253675 - head/usr.sbin/makefs/ffs

2013-07-26 Thread Marius Strobl
Author: marius
Date: Fri Jul 26 14:22:03 2013
New Revision: 253675
URL: http://svnweb.freebsd.org/changeset/base/253675

Log:
  Ensure that makefs.h is included when using ufs_bswap.h so the FFS_EI macro
  is picked up when defined. Previously, ffs_subr.c was always built without
  support for opposite endianess as it doesn't include makefs.h on its own.
  
  MFC after:3 days

Modified:
  head/usr.sbin/makefs/ffs/ufs_bswap.h

Modified: head/usr.sbin/makefs/ffs/ufs_bswap.h
==
--- head/usr.sbin/makefs/ffs/ufs_bswap.hFri Jul 26 11:39:29 2013
(r253674)
+++ head/usr.sbin/makefs/ffs/ufs_bswap.hFri Jul 26 14:22:03 2013
(r253675)
@@ -40,6 +40,8 @@
 
 #include sys/endian.h
 
+#include makefs.h
+
 /* Macros to access UFS flags */
 #ifdef FFS_EI
 #defineUFS_MPNEEDSWAP(mp)  (VFSTOUFS(mp)-um_flags  UFS_NEEDSWAP)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r253676 - head/release/sparc64

2013-07-26 Thread Marius Strobl
Author: marius
Date: Fri Jul 26 14:23:25 2013
New Revision: 253676
URL: http://svnweb.freebsd.org/changeset/base/253676

Log:
  - Once we have shifted arguments thrice, base-bits-dir is $1 rather than $4.
Introduce $BASEBITSDIR for clarity and in order to avoid repeating this
mistake in the future. Fixing this ensures that we pick up the newly built
boot code and loader native to the target, which is especially relevant
when cross-building release images.
  - It is pointless to specify an endianess for ISO 9660 images so strip that.
  
  MFC after:3 days

Modified:
  head/release/sparc64/mkisoimages.sh

Modified: head/release/sparc64/mkisoimages.sh
==
--- head/release/sparc64/mkisoimages.sh Fri Jul 26 14:22:03 2013
(r253675)
+++ head/release/sparc64/mkisoimages.sh Fri Jul 26 14:23:25 2013
(r253676)
@@ -32,26 +32,28 @@ case $1 in
 esac
 LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift
 NAME=$1; shift
+BASEBITSDIR=$1
 
 # Create an ISO image
 publisher=The FreeBSD Project.  http://www.FreeBSD.org/;
-echo /dev/iso9660/$LABEL / cd9660 ro 0 0  $1/etc/fstab
-makefs -t cd9660 -B be -o rockridge -o label=$LABEL -o 
publisher=$publisher ${NAME}.tmp $*
-rm $1/etc/fstab
+echo /dev/iso9660/$LABEL / cd9660 ro 0 0  ${BASEBITSDIR}/etc/fstab
+makefs -t cd9660 -o rockridge -o label=$LABEL -o publisher=$publisher 
${NAME}.tmp $*
+rm ${BASEBITSDIR}/etc/fstab
 
 if [ x$BOPT != x-b ]; then
mv ${NAME}.tmp ${NAME}
exit 0
 fi
+
 TMPIMGDIR=`mktemp -d /tmp/bootfs.` || exit 1
 BOOTFSDIR=${TMPIMGDIR}/bootfs
 BOOTFSIMG=${TMPIMGDIR}/bootfs.img
 
 # Create a boot filesystem
 mkdir -p ${BOOTFSDIR}/boot
-cp $4/boot/loader ${BOOTFSDIR}/boot
+cp -p ${BASEBITSDIR}/boot/loader ${BOOTFSDIR}/boot
 makefs -t ffs -B be -M 512k ${BOOTFSIMG} ${BOOTFSDIR}
-dd if=$4/boot/boot1 of=${BOOTFSIMG} bs=512 conv=notrunc,sync
+dd if=${BASEBITSDIR}/boot/boot1 of=${BOOTFSIMG} bs=512 conv=notrunc,sync
 
 # Create a boot ISO image
 : ${CYLSIZE:=640}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r253677 - in head: . sys/fs/devfs

2013-07-26 Thread Andriy Gapon
Author: avg
Date: Fri Jul 26 14:25:58 2013
New Revision: 253677
URL: http://svnweb.freebsd.org/changeset/base/253677

Log:
  make path matching in devfs rules consistent and sane (and safer)
  
  Before this change path matching had the following features:
  - for device nodes the patterns were matched against full path
  - in the above case '/' in a path could be matched by a wildcard
  - for directories and links only the last component was matched
  
  So, for example, a pattern like 're*' could match the following entries:
  - re0 device
  - responder/u0 device
  - zvol/recpool directory
  
  Although it was possible to work around this behavior (once it was spotted
  and understood), it was very confusing and contrary to documentation.
  
  Now we always match a full path for all types of devfs entries (devices,
  directories, links) and a '/' has to be matched explicitly.
  This behavior follows the shell globbing rules.
  
  This change is originally developed by Jaakko Heinonen.
  Many thanks!
  
  PR:   kern/122838
  Submitted by: jh
  MFC after:4 weeks

Modified:
  head/UPDATING
  head/sys/fs/devfs/devfs_rule.c

Modified: head/UPDATING
==
--- head/UPDATING   Fri Jul 26 14:23:25 2013(r253676)
+++ head/UPDATING   Fri Jul 26 14:25:58 2013(r253677)
@@ -64,6 +64,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
even if neither the traced process nor the tracing process had
write access to that file.
 
+201306XX:
+   Behavior of devfs rules path matching has been changed.
+   Pattern is now always matched against fully qualified devfs
+   path and slash characters must be explicitly matched by
+   slashes in pattern (FNM_PATHNAME). Rulesets involving devfs
+   subdirectories must be reviewed.
+
 20130615:
CVS has been removed from the base system.  An exact copy
of the code is available from the devel/cvs port.

Modified: head/sys/fs/devfs/devfs_rule.c
==
--- head/sys/fs/devfs/devfs_rule.c  Fri Jul 26 14:23:25 2013
(r253676)
+++ head/sys/fs/devfs/devfs_rule.c  Fri Jul 26 14:25:58 2013
(r253677)
@@ -101,7 +101,7 @@ struct devfs_ruleset {
 static devfs_rid devfs_rid_input(devfs_rid rid, struct devfs_mount *dm);
 
 static void devfs_rule_applyde_recursive(struct devfs_krule *dk,
-   struct devfs_dirent *de);
+   struct devfs_mount *dm, struct devfs_dirent *de);
 static void devfs_rule_applydm(struct devfs_krule *dk, struct devfs_mount *dm);
 static int  devfs_rule_autonumber(struct devfs_ruleset *ds, devfs_rnum *rnp);
 static struct devfs_krule *devfs_rule_byid(devfs_rid rid);
@@ -109,13 +109,16 @@ static int  devfs_rule_delete(struct dev
 static struct cdev *devfs_rule_getdev(struct devfs_dirent *de);
 static int  devfs_rule_input(struct devfs_rule *dr, struct devfs_mount *dm);
 static int  devfs_rule_insert(struct devfs_rule *dr);
-static int  devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de);
-static int  devfs_rule_matchpath(struct devfs_krule *dk,
+static int  devfs_rule_match(struct devfs_krule *dk, struct devfs_mount *dm,
+   struct devfs_dirent *de);
+static int  devfs_rule_matchpath(struct devfs_krule *dk, struct devfs_mount 
*dm,
struct devfs_dirent *de);
-static void devfs_rule_run(struct devfs_krule *dk, struct devfs_dirent *de, 
unsigned depth);
+static void devfs_rule_run(struct devfs_krule *dk, struct devfs_mount *dm,
+   struct devfs_dirent *de, unsigned depth);
 
 static void devfs_ruleset_applyde(struct devfs_ruleset *ds,
-   struct devfs_dirent *de, unsigned depth);
+   struct devfs_mount *dm, struct devfs_dirent *de,
+   unsigned depth);
 static void devfs_ruleset_applydm(struct devfs_ruleset *ds,
struct devfs_mount *dm);
 static struct devfs_ruleset *devfs_ruleset_bynum(devfs_rsnum rsnum);
@@ -146,7 +149,7 @@ devfs_rules_apply(struct devfs_mount *dm
sx_slock(sx_rules);
ds = devfs_ruleset_bynum(dm-dm_ruleset);
KASSERT(ds != NULL, (mount-point has NULL ruleset));
-   devfs_ruleset_applyde(ds, de, devfs_rule_depth);
+   devfs_ruleset_applyde(ds, dm, de, devfs_rule_depth);
sx_sunlock(sx_rules);
 }
 
@@ -337,13 +340,14 @@ devfs_rid_input(devfs_rid rid, struct de
  * XXX: a linear search could be done through the cdev list instead.
  */
 static void
-devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_dirent *de)
+devfs_rule_applyde_recursive(struct devfs_krule *dk, struct devfs_mount *dm,
+struct devfs_dirent *de)
 {
struct devfs_dirent *de2;
 
TAILQ_FOREACH(de2, de-de_dlist, de_list)
-   devfs_rule_applyde_recursive(dk, de2);
-   devfs_rule_run(dk, de, devfs_rule_depth);
+   

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

2013-07-26 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Jul 26 14:37:23 2013
New Revision: 253678
URL: http://svnweb.freebsd.org/changeset/base/253678

Log:
  Style issue in r253661.
  
  Pointed out by:   avg
  MFC after:1 month

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

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c
==
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c   Fri Jul 26 14:25:58 
2013(r253677)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c   Fri Jul 26 14:37:23 
2013(r253678)
@@ -52,7 +52,7 @@ static char *curfile;
 #defineCTF_BUF_CHUNK_SIZE  (64 * 1024)
 #defineRES_BUF_CHUNK_SIZE  (64 * 1024)
 
-static int ntypes=0;   /* The number of types. */
+static int ntypes = 0; /* The number of types. */
 
 struct ctf_buf {
strtab_t ctb_strtab;/* string table */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r253679 - head

2013-07-26 Thread Andriy Gapon
Author: avg
Date: Fri Jul 26 14:43:38 2013
New Revision: 253679
URL: http://svnweb.freebsd.org/changeset/base/253679

Log:
  fix UPDATING entry in r253677
  
  MFC after:3 weeks
  X-MFC with:   r253677

Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Fri Jul 26 14:37:23 2013(r253678)
+++ head/UPDATING   Fri Jul 26 14:43:38 2013(r253679)
@@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
disable the most expensive debugging functionality run
ln -s 'abort:false,junk:false' /etc/malloc.conf.)
 
+20130726:
+   Behavior of devfs rules path matching has been changed.
+   Pattern is now always matched against fully qualified devfs
+   path and slash characters must be explicitly matched by
+   slashes in pattern (FNM_PATHNAME). Rulesets involving devfs
+   subdirectories must be reviewed.
+
 20130716:
The default ARM ABI has changed to the ARM EABI. The old ABI is
incompatible with the ARM EABI and all programs and modules will
@@ -64,13 +71,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
even if neither the traced process nor the tracing process had
write access to that file.
 
-201306XX:
-   Behavior of devfs rules path matching has been changed.
-   Pattern is now always matched against fully qualified devfs
-   path and slash characters must be explicitly matched by
-   slashes in pattern (FNM_PATHNAME). Rulesets involving devfs
-   subdirectories must be reviewed.
-
 20130615:
CVS has been removed from the base system.  An exact copy
of the code is available from the devel/cvs port.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc

2013-07-26 Thread Jilles Tjoelker
On Fri, Jul 26, 2013 at 02:00:07AM +, Andrey Zonov wrote:
 Author: zont
 Date: Fri Jul 26 02:00:06 2013
 New Revision: 253662
 URL: http://svnweb.freebsd.org/changeset/base/253662

 Log:
   Remove define and documentation for vm_pageout_algorithm missed in r253587

 Modified:
   head/lib/libc/gen/sysctl.3
   head/sys/vm/vm_param.h
   head/tools/tools/sysdoc/tunables.mdoc

 Modified: head/sys/vm/vm_param.h
 ==
 --- head/sys/vm/vm_param.hFri Jul 26 00:28:19 2013(r253661)
 +++ head/sys/vm/vm_param.hFri Jul 26 02:00:06 2013(r253662)
 @@ -82,9 +82,8 @@
  #define  VM_V_CACHE_MIN  7   /* cnt.v_cache_min */
  #define  VM_V_CACHE_MAX  8   /* cnt.v_cache_max */
  #define VM_V_PAGEOUT_FREE_MIN9   /* cnt.v_pageout_free_min */
 -#define  VM_PAGEOUT_ALGORITHM10  /* pageout algorithm */
 -#define VM_SWAPPING_ENABLED  11  /* swapping enabled */
 -#define  VM_MAXID12  /* number of valid vm ids */
 +#define VM_SWAPPING_ENABLED  10  /* swapping enabled */
 +#define  VM_MAXID11  /* number of valid vm ids */

As noted in mail from Bruce Evans, please preserve the ABI of
VM_SWAPPING_ENABLED here.

  #define CTL_VM_NAMES { \
   { 0, 0 }, \
 @@ -97,7 +96,6 @@
   { v_cache_min, CTLTYPE_UINT }, \
   { v_cache_max, CTLTYPE_UINT }, \
   { v_pageout_free_min, CTLTYPE_UINT}, \
 - { pageout_algorithm, CTLTYPE_INT}, \
   { swap_enabled, CTLTYPE_INT},\
  }

This should be replaced with some sort of dummy rather than replaced
entirely (does not matter very much because it should not be used).

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


svn commit: r253680 - in head: lib/libfetch usr.bin/fetch

2013-07-26 Thread Dag-Erling Smørgrav
Author: des
Date: Fri Jul 26 15:53:43 2013
New Revision: 253680
URL: http://svnweb.freebsd.org/changeset/base/253680

Log:
  Implement certificate verification, and many other SSL-related
  imrovements; complete details in the PR.
  
  PR:   kern/175514
  Submitted by: Michael Gmelin free...@grem.de
  MFC after:1 week

Modified:
  head/lib/libfetch/common.c
  head/lib/libfetch/common.h
  head/lib/libfetch/fetch.3
  head/lib/libfetch/http.c
  head/usr.bin/fetch/fetch.1
  head/usr.bin/fetch/fetch.c

Modified: head/lib/libfetch/common.c
==
--- head/lib/libfetch/common.c  Fri Jul 26 14:43:38 2013(r253679)
+++ head/lib/libfetch/common.c  Fri Jul 26 15:53:43 2013(r253680)
@@ -1,5 +1,6 @@
 /*-
  * Copyright (c) 1998-2011 Dag-Erling Smørgrav
+ * Copyright (c) 2013 Michael Gmelin free...@grem.de
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,6 +48,10 @@ __FBSDID($FreeBSD$);
 #include string.h
 #include unistd.h
 
+#ifdef WITH_SSL
+#include openssl/x509v3.h
+#endif
+
 #include fetch.h
 #include common.h
 
@@ -317,15 +322,488 @@ fetch_connect(const char *host, int port
return (conn);
 }
 
+#ifdef WITH_SSL
+/*
+ * Convert characters A-Z to lowercase (intentionally avoid any locale
+ * specific conversions).
+ */
+static char
+fetch_ssl_tolower(char in)
+{
+   if (in = 'A'  in = 'Z')
+   return (in + 32);
+   else
+   return (in);
+}
+
+/*
+ * isalpha implementation that intentionally avoids any locale specific
+ * conversions.
+ */
+static int
+fetch_ssl_isalpha(char in)
+{
+   return ((in = 'A'  in = 'Z') || (in = 'a'  in = 'z'));
+}
+
+/*
+ * Check if passed hostnames a and b are equal.
+ */
+static int
+fetch_ssl_hname_equal(const char *a, size_t alen, const char *b,
+size_t blen)
+{
+   size_t i;
+
+   if (alen != blen)
+   return (0);
+   for (i = 0; i  alen; ++i) {
+   if (fetch_ssl_tolower(a[i]) != fetch_ssl_tolower(b[i]))
+   return (0);
+   }
+   return (1);
+}
+
+/*
+ * Check if domain label is traditional, meaning that only A-Z, a-z, 0-9
+ * and '-' (hyphen) are allowed. Hyphens have to be surrounded by alpha-
+ * numeric characters. Double hyphens (like they're found in IDN a-labels
+ * 'xn--') are not allowed. Empty labels are invalid.
+ */
+static int
+fetch_ssl_is_trad_domain_label(const char *l, size_t len, int wcok)
+{
+   size_t i;
+
+   if (!len || l[0] == '-' || l[len-1] == '-')
+   return (0);
+   for (i = 0; i  len; ++i) {
+   if (!isdigit(l[i]) 
+   !fetch_ssl_isalpha(l[i]) 
+   !(l[i] == '*'  wcok) 
+   !(l[i] == '-'  l[i - 1] != '-'))
+   return (0);
+   }
+   return (1);
+}
+
+/*
+ * Check if host name consists only of numbers. This might indicate an IP
+ * address, which is not a good idea for CN wildcard comparison.
+ */
+static int
+fetch_ssl_hname_is_only_numbers(const char *hostname, size_t len)
+{
+   size_t i;
+
+   for (i = 0; i  len; ++i) {
+   if (!((hostname[i] = '0'  hostname[i] = '9') ||
+   hostname[i] == '.'))
+   return (0);
+   }
+   return (1);
+}
+
+/*
+ * Check if the host name h passed matches the pattern passed in m which
+ * is usually part of subjectAltName or CN of a certificate presented to
+ * the client. This includes wildcard matching. The algorithm is based on
+ * RFC6125, sections 6.4.3 and 7.2, which clarifies RFC2818 and RFC3280.
+ */
+static int
+fetch_ssl_hname_match(const char *h, size_t hlen, const char *m,
+size_t mlen)
+{
+   int delta, hdotidx, mdot1idx, wcidx;
+   const char *hdot, *mdot1, *mdot2;
+   const char *wc; /* wildcard */
+
+   if (!(h  *h  m  *m))
+   return (0);
+   if ((wc = strnstr(m, *, mlen)) == NULL)
+   return (fetch_ssl_hname_equal(h, hlen, m, mlen));
+   wcidx = wc - m;
+   /* hostname should not be just dots and numbers */
+   if (fetch_ssl_hname_is_only_numbers(h, hlen))
+   return (0);
+   /* only one wildcard allowed in pattern */
+   if (strnstr(wc + 1, *, mlen - wcidx - 1) != NULL)
+   return (0);
+   /*
+* there must be at least two more domain labels and
+* wildcard has to be in the leftmost label (RFC6125)
+*/
+   mdot1 = strnstr(m, ., mlen);
+   if (mdot1 == NULL || mdot1  wc || (mlen - (mdot1 - m))  4)
+   return (0);
+   mdot1idx = mdot1 - m;
+   mdot2 = strnstr(mdot1 + 1, ., mlen - mdot1idx - 1);
+   if (mdot2 == NULL || (mlen - (mdot2 - m))  2)
+   return (0);
+   /* hostname must contain a dot and not be the 1st char */
+   hdot = strnstr(h, ., hlen);
+   if (hdot == NULL || hdot == h)
+   

svn commit: r253685 - in head/sys: amd64/amd64 i386/i386

2013-07-26 Thread Jeff Roberson
Author: jeff
Date: Fri Jul 26 19:06:14 2013
New Revision: 253685
URL: http://svnweb.freebsd.org/changeset/base/253685

Log:
   - Use kmem_malloc rather than kmem_alloc() for GDT/LDT/tss allocations etc.
 This eliminates some unusual uses of that API in favor of more typical
 uses of kmem_malloc().
  
  Discussed with:   kib/alc
  Tested by:pho
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/amd64/amd64/sys_machdep.c
  head/sys/i386/i386/sys_machdep.c

Modified: head/sys/amd64/amd64/sys_machdep.c
==
--- head/sys/amd64/amd64/sys_machdep.c  Fri Jul 26 19:02:17 2013
(r253684)
+++ head/sys/amd64/amd64/sys_machdep.c  Fri Jul 26 19:06:14 2013
(r253685)
@@ -356,8 +356,8 @@ amd64_set_ioperm(td, uap)
 */
pcb = td-td_pcb;
if (pcb-pcb_tssp == NULL) {
-   tssp = (struct amd64tss *)kmem_alloc(kernel_map,
-   ctob(IOPAGES+1));
+   tssp = (struct amd64tss *)kmem_malloc(kernel_map,
+   ctob(IOPAGES+1), M_WAITOK);
if (tssp == NULL)
return (ENOMEM);
iomap = (char *)tssp[1];
@@ -463,8 +463,9 @@ user_ldt_alloc(struct proc *p, int force
return (mdp-md_ldt);
mtx_unlock(dt_lock);
new_ldt = malloc(sizeof(struct proc_ldt), M_SUBPROC, M_WAITOK);
-   new_ldt-ldt_base = (caddr_t)kmem_alloc(kernel_map,
-max_ldt_segment * sizeof(struct user_segment_descriptor));
+   new_ldt-ldt_base = (caddr_t)kmem_malloc(kernel_map,
+max_ldt_segment * sizeof(struct user_segment_descriptor),
+M_WAITOK);
if (new_ldt-ldt_base == NULL) {
FREE(new_ldt, M_SUBPROC);
mtx_lock(dt_lock);

Modified: head/sys/i386/i386/sys_machdep.c
==
--- head/sys/i386/i386/sys_machdep.cFri Jul 26 19:02:17 2013
(r253684)
+++ head/sys/i386/i386/sys_machdep.cFri Jul 26 19:06:14 2013
(r253685)
@@ -164,8 +164,9 @@ sysarch(td, uap)
break;
case I386_SET_LDT:
if (kargs.largs.descs != NULL) {
-   lp = (union descriptor *)kmem_alloc(kernel_map,
-   kargs.largs.num * sizeof(union descriptor));
+   lp = (union descriptor *)kmem_malloc(kernel_map,
+   kargs.largs.num * sizeof(union descriptor),
+   M_WAITOK);
if (lp == NULL) {
error = ENOMEM;
break;
@@ -298,7 +299,8 @@ i386_extend_pcb(struct thread *td)
0   /* granularity */
};
 
-   ext = (struct pcb_ext *)kmem_alloc(kernel_map, ctob(IOPAGES+1));
+   ext = (struct pcb_ext *)kmem_malloc(kernel_map, ctob(IOPAGES+1),
+   M_WAITOK);
if (ext == 0)
return (ENOMEM);
bzero(ext, sizeof(struct pcb_ext)); 
@@ -471,8 +473,8 @@ user_ldt_alloc(struct mdproc *mdp, int l
 M_SUBPROC, M_WAITOK); 
  
 new_ldt-ldt_len = len = NEW_MAX_LD(len); 
-new_ldt-ldt_base = (caddr_t)kmem_alloc(kernel_map, 
-round_page(len * sizeof(union descriptor))); 
+new_ldt-ldt_base = (caddr_t)kmem_malloc(kernel_map, 
+round_page(len * sizeof(union descriptor)), M_WAITOK);
 if (new_ldt-ldt_base == NULL) { 
 free(new_ldt, M_SUBPROC);
mtx_lock_spin(dt_lock);
@@ -511,8 +513,8 @@ user_ldt_alloc(struct mdproc *mdp, int l
M_SUBPROC, M_WAITOK);
 
new_ldt-ldt_len = len = NEW_MAX_LD(len);
-   new_ldt-ldt_base = (caddr_t)kmem_alloc(kernel_map,
-   len * sizeof(union descriptor));
+   new_ldt-ldt_base = (caddr_t)kmem_malloc(kernel_map,
+   len * sizeof(union descriptor), M_WAITOK);
if (new_ldt-ldt_base == NULL) {
free(new_ldt, M_SUBPROC);
mtx_lock_spin(dt_lock);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r253687 - head/sys/net

2013-07-26 Thread Adrian Chadd
Author: adrian
Date: Fri Jul 26 19:41:13 2013
New Revision: 253687
URL: http://svnweb.freebsd.org/changeset/base/253687

Log:
  Break out the static, global LACP debug options into a per-lagg unit
  sysctl tree.
  
  * Create a net.link.lagg.X.lacp node
  * Add a debug node under that for tx_test and rx_test
  * Add lacp_strict_mode, defaulting to 1
  
  tx_test and rx_test are still a bitmap of unit numbers for now.
  At some point it would be nice to create child nodes of the lagg bundle
  for each sub-interface, and then populate those with various knobs
  and statistics.
  
  Sponsored by: Netflix

Modified:
  head/sys/net/ieee8023ad_lacp.c
  head/sys/net/ieee8023ad_lacp.h
  head/sys/net/if_lagg.c
  head/sys/net/if_lagg.h

Modified: head/sys/net/ieee8023ad_lacp.c
==
--- head/sys/net/ieee8023ad_lacp.c  Fri Jul 26 19:11:08 2013
(r253686)
+++ head/sys/net/ieee8023ad_lacp.c  Fri Jul 26 19:41:13 2013
(r253687)
@@ -193,18 +193,6 @@ SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO
 lacp_debug, 0, Enable LACP debug logging (1=debug, 2=trace));
 TUNABLE_INT(net.link.lagg.lacp.debug, lacp_debug);
 
-/* bitmap of ports */
-static int lacp_rx_test = 0;
-static int lacp_tx_test = 0;
-SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, rxtest, CTLFLAG_RW, lacp_rx_test, 0,
-RXTest);
-SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, txtest, CTLFLAG_RW, lacp_tx_test, 0,
-TXTest);
-
-static int lacp_strict = 1;
-SYSCTL_INT(_net_link_lagg_lacp, OID_AUTO, strict, CTLFLAG_RW, lacp_strict,
-0, Strict spec compliance);
-
 #define LACP_DPRINTF(a) if (lacp_debug  0x01) { lacp_dprintf a ; }
 #define LACP_TRACE(a) if (lacp_debug  0x02) { 
lacp_dprintf(a,%s\n,__func__); }
 #define LACP_TPRINTF(a) if (lacp_debug  0x04) { lacp_dprintf a ; }
@@ -315,7 +303,7 @@ lacp_pdu_input(struct lacp_port *lp, str
lacp_dump_lacpdu(du);
}
 
-   if ((1  lp-lp_ifp-if_dunit)  lacp_rx_test) {
+   if ((1  lp-lp_ifp-if_dunit)  lp-lp_lsc-lsc_debug.lsc_rx_test) {
LACP_TPRINTF((lp, Dropping RX PDU\n));
goto bad;
}
@@ -750,10 +738,48 @@ lacp_transit_expire(void *vp)
lsc-lsc_suppress_distributing = FALSE;
 }
 
+static void
+lacp_attach_sysctl(struct lacp_softc *lsc, struct sysctl_oid *p_oid)
+{
+   struct lagg_softc *sc = lsc-lsc_softc;
+
+   SYSCTL_ADD_UINT(sc-ctx, SYSCTL_CHILDREN(p_oid), OID_AUTO,
+   lacp_strict_mode,
+   CTLFLAG_RW,
+   lsc-lsc_strict_mode,
+   lsc-lsc_strict_mode,
+   Enable LACP strict mode);
+}
+
+static void
+lacp_attach_sysctl_debug(struct lacp_softc *lsc, struct sysctl_oid *p_oid)
+{
+   struct lagg_softc *sc = lsc-lsc_softc;
+   struct sysctl_oid *oid;
+
+   /* Create a child of the parent lagg interface */
+   oid = SYSCTL_ADD_NODE(sc-ctx, SYSCTL_CHILDREN(p_oid),
+   OID_AUTO, debug, CTLFLAG_RD, NULL, DEBUG);
+
+   SYSCTL_ADD_UINT(sc-ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+   rx_test,
+   CTLFLAG_RW,
+   lsc-lsc_debug.lsc_rx_test,
+   lsc-lsc_debug.lsc_rx_test,
+   Bitmap of if_dunit entries to drop RX frames for);
+   SYSCTL_ADD_UINT(sc-ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+   tx_test,
+   CTLFLAG_RW,
+   lsc-lsc_debug.lsc_tx_test,
+   lsc-lsc_debug.lsc_tx_test,
+   Bitmap of if_dunit entries to drop TX frames for);
+}
+
 int
 lacp_attach(struct lagg_softc *sc)
 {
struct lacp_softc *lsc;
+   struct sysctl_oid *oid;
 
lsc = malloc(sizeof(struct lacp_softc),
M_DEVBUF, M_NOWAIT|M_ZERO);
@@ -765,10 +791,19 @@ lacp_attach(struct lagg_softc *sc)
 
lsc-lsc_hashkey = arc4random();
lsc-lsc_active_aggregator = NULL;
+   lsc-lsc_strict_mode = 1;
LACP_LOCK_INIT(lsc);
TAILQ_INIT(lsc-lsc_aggregators);
LIST_INIT(lsc-lsc_ports);
 
+   /* Create a child of the parent lagg interface */
+   oid = SYSCTL_ADD_NODE(sc-ctx, SYSCTL_CHILDREN(sc-sc_oid),
+   OID_AUTO, lacp, CTLFLAG_RD, NULL, LACP);
+
+   /* Attach sysctl nodes */
+   lacp_attach_sysctl(lsc, oid);
+   lacp_attach_sysctl_debug(lsc, oid);
+
callout_init_mtx(lsc-lsc_transit_callout, lsc-lsc_mtx, 0);
callout_init_mtx(lsc-lsc_callout, lsc-lsc_mtx, 0);
 
@@ -1594,7 +1629,7 @@ lacp_sm_rx_record_pdu(struct lacp_port *
}
 
/* XXX Hack, still need to implement 5.4.9 para 2,3,4 */
-   if (lacp_strict)
+   if (lp-lp_lsc-lsc_strict_mode)
lp-lp_partner.lip_state |= LACP_STATE_SYNC;
 
lacp_sm_ptx_update_timeout(lp, oldpstate);
@@ -1622,7 +1657,7 @@ lacp_sm_rx_record_default(struct lacp_po
LACP_TRACE(lp);
 
oldpstate = lp-lp_partner.lip_state;
-   if (lacp_strict)
+   if (lp-lp_lsc-lsc_strict_mode)
lp-lp_partner = lacp_partner_admin_strict;
else

svn commit: r253689 - in head: gnu/usr.bin/patch share/mk tools/build/options usr.bin/patch

2013-07-26 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Jul 26 21:25:18 2013
New Revision: 253689
URL: http://svnweb.freebsd.org/changeset/base/253689

Log:
  Make the BSD-licensed patch the default.
  
  The BSD-licensed patch(1) command has matured and it's behaviour
  can be considered equivalent to the older version of GNU patch
  in the tree.
  
  The switch has been extensively tested [1] and only two ports
  presented regressions, which have since been fixed.
  
  For convenience a new WITH_GNU_PATCH option is available,
  but it will likely be removed in the near future.
  
  PR:   176313
  Approved by:  portmgr

Added:
  head/tools/build/options/WITH_GNU_PATCH
 - copied, changed from r253470, head/tools/build/options/WITH_BSD_PATCH
Deleted:
  head/tools/build/options/WITH_BSD_PATCH
Modified:
  head/gnu/usr.bin/patch/Makefile
  head/share/mk/bsd.own.mk
  head/usr.bin/patch/Makefile

Modified: head/gnu/usr.bin/patch/Makefile
==
--- head/gnu/usr.bin/patch/Makefile Fri Jul 26 20:54:33 2013
(r253688)
+++ head/gnu/usr.bin/patch/Makefile Fri Jul 26 21:25:18 2013
(r253689)
@@ -2,14 +2,14 @@
 
 .include bsd.own.mk
 
-.if ${MK_BSD_PATCH} == yes
+.if ${MK_GNU_PATCH} == yes
+PROG=  patch
+.else
 PROG=  gnupatch
 CLEANFILES+= gnupatch.1
 
 gnupatch.1: patch.1
cp ${.ALLSRC} ${.TARGET}
-.else
-PROG=  patch
 .endif
 
 SRCS=   backupfile.c inp.c patch.c pch.c util.c version.c

Modified: head/share/mk/bsd.own.mk
==
--- head/share/mk/bsd.own.mkFri Jul 26 20:54:33 2013(r253688)
+++ head/share/mk/bsd.own.mkFri Jul 26 21:25:18 2013(r253689)
@@ -364,7 +364,6 @@ __DEFAULT_YES_OPTIONS = \
 ZONEINFO
 
 __DEFAULT_NO_OPTIONS = \
-BSD_PATCH \
 BIND_IDN \
 BIND_LARGE_FILE \
 BIND_LIBS \
@@ -375,6 +374,7 @@ __DEFAULT_NO_OPTIONS = \
 CLANG_EXTRAS \
 CTF \
 DEBUG_FILES \
+GNU_PATCH \
 GPL_DTC \
 HESIOD \
 ICONV \

Copied and modified: head/tools/build/options/WITH_GNU_PATCH (from r253470, 
head/tools/build/options/WITH_BSD_PATCH)
==
--- head/tools/build/options/WITH_BSD_PATCH Fri Jul 19 12:43:20 2013
(r253470, copy source)
+++ head/tools/build/options/WITH_GNU_PATCH Fri Jul 26 21:25:18 2013
(r253689)
@@ -1,2 +1,2 @@
 .\ $FreeBSD$
-Install BSD-licensed patch as 'patch' instead of GNU patch.
+Install GNU-licensed patch as 'patch' instead of BSD patch.

Modified: head/usr.bin/patch/Makefile
==
--- head/usr.bin/patch/Makefile Fri Jul 26 20:54:33 2013(r253688)
+++ head/usr.bin/patch/Makefile Fri Jul 26 21:25:18 2013(r253689)
@@ -3,14 +3,14 @@
 
 .include bsd.own.mk
 
-.if ${MK_BSD_PATCH} == yes
-PROG=  patch
-.else
+.if ${MK_GNU_PATCH} == yes
 PROG=  bsdpatch
 CLEANFILES+= bsdpatch.1
 
 bsdpatch.1: patch.1
cp ${.ALLSRC} ${.TARGET}
+.else
+PROG=  patch
 .endif
 
 SRCS=  backupfile.c inp.c mkpath.c patch.c pch.c util.c
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r253662 - in head: lib/libc/gen sys/vm tools/tools/sysdoc

2013-07-26 Thread Andrey Zonov
On 7/26/13 8:09 AM, Jilles Tjoelker wrote:
 On Fri, Jul 26, 2013 at 02:00:07AM +, Andrey Zonov wrote:
 Author: zont
 Date: Fri Jul 26 02:00:06 2013
 New Revision: 253662
 URL: http://svnweb.freebsd.org/changeset/base/253662
 
 Log:
   Remove define and documentation for vm_pageout_algorithm missed in r253587
 
 Modified:
   head/lib/libc/gen/sysctl.3
   head/sys/vm/vm_param.h
   head/tools/tools/sysdoc/tunables.mdoc
 
 Modified: head/sys/vm/vm_param.h
 ==
 --- head/sys/vm/vm_param.h   Fri Jul 26 00:28:19 2013(r253661)
 +++ head/sys/vm/vm_param.h   Fri Jul 26 02:00:06 2013(r253662)
 @@ -82,9 +82,8 @@
  #define VM_V_CACHE_MIN  7   /* cnt.v_cache_min */
  #define VM_V_CACHE_MAX  8   /* cnt.v_cache_max */
  #define VM_V_PAGEOUT_FREE_MIN   9   /* cnt.v_pageout_free_min */
 -#define VM_PAGEOUT_ALGORITHM10  /* pageout algorithm */
 -#define VM_SWAPPING_ENABLED 11  /* swapping enabled */
 -#define VM_MAXID12  /* number of valid vm ids */
 +#define VM_SWAPPING_ENABLED 10  /* swapping enabled */
 +#define VM_MAXID11  /* number of valid vm ids */
 
 As noted in mail from Bruce Evans, please preserve the ABI of
 VM_SWAPPING_ENABLED here.
 

I don't think it's a big problem.  Internally we don't use it.  Good
code uses sysctlbyname() instead of sysctl().  It doesn't seem to me
this is very popular sysctl.  It's also CURRENT without MFC.

I prefer clean code where it is possible instead of dummy all around.

  #define CTL_VM_NAMES { \
  { 0, 0 }, \
 @@ -97,7 +96,6 @@
  { v_cache_min, CTLTYPE_UINT }, \
  { v_cache_max, CTLTYPE_UINT }, \
  { v_pageout_free_min, CTLTYPE_UINT}, \
 -{ pageout_algorithm, CTLTYPE_INT}, \
  { swap_enabled, CTLTYPE_INT},\
  }
 
 This should be replaced with some sort of dummy rather than replaced
 entirely (does not matter very much because it should not be used).
 


-- 
Andrey Zonov



signature.asc
Description: OpenPGP digital signature


svn commit: r253691 - in head: sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/modules/cxgbe/if_cxgbe tools/tools/cxgbetool

2013-07-26 Thread Navdeep Parhar
Author: np
Date: Fri Jul 26 22:04:11 2013
New Revision: 253691
URL: http://svnweb.freebsd.org/changeset/base/253691

Log:
  Add support for packet-sniffing tracers to cxgbe(4).  This works with
  all T4 and T5 based cards and is useful for analyzing TSO, LRO, TOE, and
  for general purpose monitoring without tapping any cxgbe or cxl ifnet
  directly.
  
  Tracers on the T4/T5 chips provide access to Ethernet frames exactly as
  they were received from or transmitted on the wire.  On transmit, a
  tracer will capture a frame after TSO segmentation, hw VLAN tag
  insertion, hw L3  L4 checksum insertion, etc.  It will also capture
  frames generated by the TCP offload engine (TOE traffic is normally
  invisible to the kernel).  On receive, a tracer will capture a frame
  before hw VLAN extraction, runt filtering, other badness filtering,
  before the steering/drop/L2-rewrite filters or the TOE have had a go at
  it, and of course before sw LRO in the driver.
  
  There are 4 tracers on a chip.  A tracer can trace only in one direction
  (tx or rx).  For now cxgbetool will set up tracers to capture the first
  128B of every transmitted or received frame on a given port.  This is a
  small subset of what the hardware can do.  A pseudo ifnet with the same
  name as the nexus driver (t4nex0 or t5nex0) will be created for tracing.
  The data delivered to this ifnet is an additional copy made inside the
  chip.  Normal delivery to cxgben or cxln will be made as usual.
  
  /* watch cxl0, which is the first port hanging off t5nex0. */
  # cxgbetool t5nex0 tracer 0 tx0  (watch what cxl0 is transmitting)
  # cxgbetool t5nex0 tracer 1 rx0  (watch what cxl0 is receiving)
  # cxgbetool t5nex0 tracer list
  # tcpdump -i t5nex0   == all that cxl0 sees and puts on the wire
  
  If you were doing TSO, a tcpdump on cxl0 may have shown you ~64K
  frames with no L3/L4 checksum but this will show you the frames that
  were actually transmitted.
  
  /* all done */
  # cxgbetool t5nex0 tracer 0 disable
  # cxgbetool t5nex0 tracer 1 disable
  # cxgbetool t5nex0 tracer list
  # ifconfig t5nex0 destroy

Added:
  head/sys/dev/cxgbe/t4_tracer.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/common/t4_hw.c
  head/sys/dev/cxgbe/common/t4_hw.h
  head/sys/dev/cxgbe/t4_ioctl.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c
  head/sys/modules/cxgbe/if_cxgbe/Makefile
  head/tools/tools/cxgbetool/cxgbetool.c

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Jul 26 21:34:09 2013(r253690)
+++ head/sys/conf/files Fri Jul 26 22:04:11 2013(r253691)
@@ -1155,6 +1155,8 @@ dev/cxgbe/t4_sge.coptional cxgbe pci \
compile-with ${NORMAL_C} -I$S/dev/cxgbe
 dev/cxgbe/t4_l2t.c optional cxgbe pci \
compile-with ${NORMAL_C} -I$S/dev/cxgbe
+dev/cxgbe/t4_tracer.c  optional cxgbe pci \
+   compile-with ${NORMAL_C} -I$S/dev/cxgbe
 dev/cxgbe/common/t4_hw.c   optional cxgbe pci \
compile-with ${NORMAL_C} -I$S/dev/cxgbe
 t4fw_cfg.c optional cxgbe  \

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hFri Jul 26 21:34:09 2013
(r253690)
+++ head/sys/dev/cxgbe/adapter.hFri Jul 26 22:04:11 2013
(r253691)
@@ -172,6 +172,7 @@ enum {
DOOMED  = (1  0),
PORT_INIT_DONE  = (1  1),
PORT_SYSCTL_CTX = (1  2),
+   HAS_TRACEQ  = (1  3),
 };
 
 #define IS_DOOMED(pi)  ((pi)-flags  DOOMED)
@@ -577,6 +578,14 @@ struct adapter {
 #endif
int flags;
 
+   char ifp_lockname[16];
+   struct mtx ifp_lock;
+   struct ifnet *ifp;  /* tracer ifp */
+   struct ifmedia media;
+   int traceq; /* iq used by all tracers, -1 if none */
+   int tracer_valid;   /* bitmap of valid tracers */
+   int tracer_enabled; /* bitmap of enabled tracers */
+
char fw_version[32];
char cfg_file[32];
u_int cfcsum;
@@ -808,6 +817,16 @@ int t4_eth_tx(struct ifnet *, struct sge
 void t4_update_fl_bufsize(struct ifnet *);
 int can_resume_tx(struct sge_eq *);
 
+/* t4_tracer.c */
+struct t4_tracer;
+void t4_tracer_modload(void);
+void t4_tracer_modunload(void);
+void t4_tracer_port_detach(struct adapter *);
+int t4_get_tracer(struct adapter *, struct t4_tracer *);
+int t4_set_tracer(struct adapter *, struct t4_tracer *);
+int t4_trace_pkt(struct sge_iq *, const struct rss_header *, struct mbuf *);
+int t5_trace_pkt(struct sge_iq *, const struct rss_header *, struct mbuf *);
+
 static inline struct wrqe *
 alloc_wrqe(int wr_len, struct sge_wrq *wrq)
 {

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- 

svn commit: r253692 - head/contrib/bind9/lib/dns/rdata/generic releng/8.4 releng/8.4/contrib/bind9/lib/dns/rdata/generic releng/8.4/sys/conf

2013-07-26 Thread Xin LI
Author: delphij
Date: Fri Jul 26 22:40:17 2013
New Revision: 253692
URL: http://svnweb.freebsd.org/changeset/base/253692

Log:
  Fix Denial of Service vulnerability in named(8). [13:07]
  
  Security: CVE-2013-4854
  Security: FreeBSD-SA-13:07.bind
  Approved by:  so

Modified:
  head/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c

Changes in other areas also in this revision:
Modified:
  releng/8.4/UPDATING
  releng/8.4/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c
  releng/8.4/sys/conf/newvers.sh

Modified: head/contrib/bind9/lib/dns/rdata/generic/keydata_65533.c
==
--- head/contrib/bind9/lib/dns/rdata/generic/keydata_65533.cFri Jul 26 
22:04:11 2013(r253691)
+++ head/contrib/bind9/lib/dns/rdata/generic/keydata_65533.cFri Jul 26 
22:40:17 2013(r253692)
@@ -176,7 +176,7 @@ fromwire_keydata(ARGS_FROMWIRE) {
UNUSED(options);
 
isc_buffer_activeregion(source, sr);
-   if (sr.length  4)
+   if (sr.length  16)
return (ISC_R_UNEXPECTEDEND);
 
isc_buffer_forward(source, sr.length);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r253697 - head/sys/vm

2013-07-26 Thread Jeff Roberson
Author: jeff
Date: Fri Jul 26 23:22:05 2013
New Revision: 253697
URL: http://svnweb.freebsd.org/changeset/base/253697

Log:
  Improve page LRU quality and simplify the logic.
  
   - Don't short-circuit aging tests for unmapped objects.  This biases
 against unmapped file pages and transient mappings.
   - Always honor PGA_REFERENCED.  We can now use this after soft busying
 to lazily restart the LRU.
   - Don't transition directly from active to cached bypassing the inactive
 queue.  This frees recently used data much too early.
   - Rename actcount to act_delta to be more consistent with use and meaning.
  
  Reviewed by:  kib, alc
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cFri Jul 26 22:53:17 2013(r253696)
+++ head/sys/vm/vm_pageout.cFri Jul 26 23:22:05 2013(r253697)
@@ -708,7 +708,7 @@ vm_pageout_object_deactivate_pages(pmap_
 {
vm_object_t backing_object, object;
vm_page_t p;
-   int actcount, remove_mode;
+   int act_delta, remove_mode;
 
VM_OBJECT_ASSERT_LOCKED(first_object);
if ((first_object-flags  OBJ_FICTITIOUS) != 0)
@@ -739,17 +739,17 @@ vm_pageout_object_deactivate_pages(pmap_
vm_page_unlock(p);
continue;
}
-   actcount = pmap_ts_referenced(p);
+   act_delta = pmap_ts_referenced(p);
if ((p-aflags  PGA_REFERENCED) != 0) {
-   if (actcount == 0)
-   actcount = 1;
+   if (act_delta == 0)
+   act_delta = 1;
vm_page_aflag_clear(p, PGA_REFERENCED);
}
-   if (p-queue != PQ_ACTIVE  actcount != 0) {
+   if (p-queue != PQ_ACTIVE  act_delta != 0) {
vm_page_activate(p);
-   p-act_count += actcount;
+   p-act_count += act_delta;
} else if (p-queue == PQ_ACTIVE) {
-   if (actcount == 0) {
+   if (act_delta == 0) {
p-act_count -= min(p-act_count,
ACT_DECLINE);
if (!remove_mode  p-act_count == 0) {
@@ -869,7 +869,7 @@ vm_pageout_scan(int pass)
int page_shortage, maxscan, pcount;
int addl_page_shortage;
vm_object_t object;
-   int actcount;
+   int act_delta;
int vnodes_skipped = 0;
int maxlaunder;
boolean_t queues_locked;
@@ -989,44 +989,40 @@ vm_pageout_scan(int pass)
queues_locked = FALSE;
 
/*
-* If the object is not being used, we ignore previous 
+* We bump the activation count if the page has been
+* referenced while in the inactive queue.  This makes
+* it less likely that the page will be added back to the
+* inactive queue prematurely again.  Here we check the 
+* page tables (or emulated bits, if any), given the upper 
+* level VM system not knowing anything about existing 
 * references.
 */
-   if (object-ref_count == 0) {
+   act_delta = 0;
+   if ((m-aflags  PGA_REFERENCED) != 0) {
vm_page_aflag_clear(m, PGA_REFERENCED);
+   act_delta = 1;
+   }
+   if (object-ref_count != 0) {
+   act_delta += pmap_ts_referenced(m);
+   } else {
KASSERT(!pmap_page_is_mapped(m),
(vm_pageout_scan: page %p is mapped, m));
-
-   /*
-* Otherwise, if the page has been referenced while in the 
-* inactive queue, we bump the activation count upwards, 
-* making it less likely that the page will be added back to 
-* the inactive queue prematurely again.  Here we check the 
-* page tables (or emulated bits, if any), given the upper 
-* level VM system not knowing anything about existing 
-* references.
-*/
-   } else if ((m-aflags  PGA_REFERENCED) == 0 
-   (actcount = pmap_ts_referenced(m)) != 0) {
-   vm_page_activate(m);
-   VM_OBJECT_WUNLOCK(object);
-   m-act_count += actcount + ACT_ADVANCE;
-   vm_page_unlock(m);
-   goto 

svn commit: r253699 - head/sys/dev/cxgbe

2013-07-26 Thread Navdeep Parhar
Author: np
Date: Sat Jul 27 00:53:07 2013
New Revision: 253699
URL: http://svnweb.freebsd.org/changeset/base/253699

Log:
  Expand the list of devices claimed by cxgbe(4).

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cFri Jul 26 23:41:22 2013
(r253698)
+++ head/sys/dev/cxgbe/t4_main.cSat Jul 27 00:53:07 2013
(r253699)
@@ -447,26 +447,27 @@ struct {
 }, t5_pciids[] = {
{0xb000, Chelsio Terminator 5 FPGA},
{0x5400, Chelsio T580-dbg},
-   {0x5401,  Chelsio T520-CR},
+   {0x5401,  Chelsio T520-CR},   /* 2 x 10G */
+   {0x5402,  Chelsio T522-CR},   /* 2 x 10G, 2 X 1G */
{0x5403,  Chelsio T540-CR},   /* 4 x 10G */
-   {0x5407,  Chelsio T520-SO},
-   {0x5408,  Chelsio T520-CX},
+   {0x5407,  Chelsio T520-SO},   /* 2 x 10G, nomem */
+   {0x5409,  Chelsio T520-BT},   /* 2 x 10GBaseT */
+   {0x540a,  Chelsio T504-BT},   /* 4 x 1G */
+   {0x540d,  Chelsio T580-CR},   /* 2 x 40G */
+   {0x540e,  Chelsio T540-LP-CR},/* 4 x 10G */
{0x5410,  Chelsio T580-LP-CR},/* 2 x 40G */
-   {0x5411,  Chelsio T520-LL-CR},
+   {0x5411,  Chelsio T520-LL-CR},/* 2 x 10G */
+   {0x5412,  Chelsio T560-CR},   /* 1 x 40G, 2 x 10G */
+   {0x5414,  Chelsio T580-LP-SO-CR}, /* 2 x 40G, nomem */
 #ifdef notyet
-   {0x5402,  Chelsio T522-CR},
{0x5404,  Chelsio T520-BCH},
{0x5405,  Chelsio T540-BCH},
{0x5406,  Chelsio T540-CH},
-   {0x5409,  Chelsio T520-BT},
-   {0x540a,  Chelsio T504-BT},
+   {0x5408,  Chelsio T520-CX},
{0x540b,  Chelsio B520-SR},
{0x540c,  Chelsio B504-BT},
-   {0x540d,  Chelsio T580-CR},
-   {0x540e,  Chelsio T540-LP-CR},
{0x540f,  Chelsio Amsterdam},
-   {0x5412,  Chelsio T560-CR},
-   {0x5413,  Chelsio T580-CR},
+   {0x5413,  Chelsio T580-CHR},
 #endif
 };
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org