svn commit: r302387 - head/release/arm64

2016-07-06 Thread Wojciech Macek
Author: wma
Date: Thu Jul  7 05:47:42 2016
New Revision: 302387
URL: https://svnweb.freebsd.org/changeset/base/302387

Log:
  ARM64: move to GPT scheme in sysinstall
  
   It's time to abandon MBR installations on
   ARM64 platforms.
  
   Obtained from: Semihalf
   Submitted by:  Dominik Ermel 
   Sponsored by:  Cavium
   Reviewed by:   gjb, emaste, marcel
   Approved by:   re (gjb)
   Differential Revision: https://reviews.freebsd.org/D6798

Modified:
  head/release/arm64/make-memstick.sh

Modified: head/release/arm64/make-memstick.sh
==
--- head/release/arm64/make-memstick.sh Thu Jul  7 05:04:20 2016
(r302386)
+++ head/release/arm64/make-memstick.sh Thu Jul  7 05:47:42 2016
(r302387)
@@ -38,6 +38,6 @@ fi
 rm ${1}/etc/fstab
 rm ${1}/etc/rc.conf.local
 
-mkimg -s mbr -p efi:=${1}/boot/boot1.efifat -p freebsd:=${2}.part -o ${2}
+mkimg -s gpt -p efi:=${1}/boot/boot1.efifat -p freebsd:=${2}.part -o ${2}
 rm ${2}.part
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302386 - in stable/9/contrib/expat: . doc examples lib tests tests/benchmark xmlwf

2016-07-06 Thread Xin LI
Author: delphij
Date: Thu Jul  7 05:04:20 2016
New Revision: 302386
URL: https://svnweb.freebsd.org/changeset/base/302386

Log:
  MFC r302305: MFV r302260: expat 2.2.0.

Added:
  stable/9/contrib/expat/configure.ac
 - copied unchanged from r302305, head/contrib/expat/configure.ac
  stable/9/contrib/expat/doc/xmlwf.xml
 - copied unchanged from r302305, head/contrib/expat/doc/xmlwf.xml
Deleted:
  stable/9/contrib/expat/configure.in
  stable/9/contrib/expat/doc/xmlwf.sgml
Modified:
  stable/9/contrib/expat/COPYING
  stable/9/contrib/expat/Changes
  stable/9/contrib/expat/MANIFEST
  stable/9/contrib/expat/Makefile.in
  stable/9/contrib/expat/README
  stable/9/contrib/expat/doc/expat.png   (contents, props changed)
  stable/9/contrib/expat/doc/reference.html
  stable/9/contrib/expat/doc/xmlwf.1
  stable/9/contrib/expat/examples/elements.c
  stable/9/contrib/expat/examples/outline.c
  stable/9/contrib/expat/expat_config.h.in
  stable/9/contrib/expat/lib/expat.h
  stable/9/contrib/expat/lib/expat_external.h
  stable/9/contrib/expat/lib/internal.h
  stable/9/contrib/expat/lib/xmlparse.c
  stable/9/contrib/expat/lib/xmlrole.c
  stable/9/contrib/expat/lib/xmltok.c
  stable/9/contrib/expat/lib/xmltok.h
  stable/9/contrib/expat/lib/xmltok_impl.c
  stable/9/contrib/expat/tests/benchmark/README.txt
  stable/9/contrib/expat/tests/chardata.c
  stable/9/contrib/expat/tests/minicheck.c
  stable/9/contrib/expat/tests/minicheck.h
  stable/9/contrib/expat/tests/runtests.c
  stable/9/contrib/expat/tests/xmltest.sh
  stable/9/contrib/expat/xmlwf/codepage.c
  stable/9/contrib/expat/xmlwf/readfilemap.c
  stable/9/contrib/expat/xmlwf/unixfilemap.c
  stable/9/contrib/expat/xmlwf/xmlfile.c
  stable/9/contrib/expat/xmlwf/xmlwf.c
Directory Properties:
  stable/9/contrib/expat/   (props changed)

Modified: stable/9/contrib/expat/COPYING
==
--- stable/9/contrib/expat/COPYING  Thu Jul  7 04:59:58 2016
(r302385)
+++ stable/9/contrib/expat/COPYING  Thu Jul  7 05:04:20 2016
(r302386)
@@ -1,6 +1,5 @@
-Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
-   and Clark Cooper
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
+Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
+Copyright (c) 2001-2016 Expat maintainers
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the

Modified: stable/9/contrib/expat/Changes
==
--- stable/9/contrib/expat/Changes  Thu Jul  7 04:59:58 2016
(r302385)
+++ stable/9/contrib/expat/Changes  Thu Jul  7 05:04:20 2016
(r302386)
@@ -1,3 +1,67 @@
+Release 2.2.0 Tue June 21 2016
+Security fixes:
+#537  CVE-2016-0718 -- Fix crash on malformed input
+  CVE-2016-4472 -- Improve insufficient fix to CVE-2015-1283 /
+   CVE-2015-2716 introduced with Expat 2.1.1
+#499  CVE-2016-5300 -- Use more entropy for hash initialization
+   than the original fix to CVE-2012-0876
+#519  CVE-2012-6702 -- Resolve troublesome internal call to srand
+   that was introduced with Expat 2.1.0
+   when addressing CVE-2012-0876 (issue #496)
+
+Bug fixes:
+  Fix uninitialized reads of size 1
+(e.g. in little2_updatePosition)
+  Fix detection of UTF-8 character boundaries
+
+Other changes:
+#532  Fix compilation for Visual Studio 2010 (keyword "C99")
+  Autotools: Resolve use of "$<" to better support bmake
+  Autotools: Add QA script "qa.sh" (and make target "qa")
+  Autotools: Respect CXXFLAGS if given
+  Autotools: Fix "make run-xmltest"
+  Autotools: Have "make run-xmltest" check for expected output
+ p90  CMake: Fix static build (BUILD_shared=OFF) on Windows
+#536  CMake: Add soversion, support -DNO_SONAME=yes to bypass
+#323  CMake: Add suffix "d" to differentiate debug from release
+  CMake: Define WIN32 with CMake on Windows
+  Annotate memory allocators for GCC
+  Address all currently known compile warnings
+  Make sure that API symbols remain visible despite
+-fvisibility=hidden
+  Remove executable flag from source files
+  Resolve COMPILED_FROM_DSP in favor of WIN32
+
+Special thanks to:
+Björn Lindahl
+Christian Heimes
+Cristian Rodríguez
+Daniel Krügler
+Gustavo Grieco
+Karl Waclawek
+

svn commit: r302385 - in stable/10/contrib/expat: . doc examples lib tests tests/benchmark xmlwf

2016-07-06 Thread Xin LI
Author: delphij
Date: Thu Jul  7 04:59:58 2016
New Revision: 302385
URL: https://svnweb.freebsd.org/changeset/base/302385

Log:
  MFC r302305: MFV r302260: expat 2.2.0.

Added:
  stable/10/contrib/expat/configure.ac
 - copied unchanged from r302305, head/contrib/expat/configure.ac
  stable/10/contrib/expat/doc/xmlwf.xml
 - copied unchanged from r302305, head/contrib/expat/doc/xmlwf.xml
Deleted:
  stable/10/contrib/expat/configure.in
  stable/10/contrib/expat/doc/xmlwf.sgml
Modified:
  stable/10/contrib/expat/COPYING
  stable/10/contrib/expat/Changes
  stable/10/contrib/expat/MANIFEST
  stable/10/contrib/expat/Makefile.in
  stable/10/contrib/expat/README
  stable/10/contrib/expat/doc/expat.png   (contents, props changed)
  stable/10/contrib/expat/doc/reference.html
  stable/10/contrib/expat/doc/xmlwf.1
  stable/10/contrib/expat/examples/elements.c
  stable/10/contrib/expat/examples/outline.c
  stable/10/contrib/expat/expat_config.h.in
  stable/10/contrib/expat/lib/expat.h
  stable/10/contrib/expat/lib/expat_external.h
  stable/10/contrib/expat/lib/internal.h
  stable/10/contrib/expat/lib/xmlparse.c
  stable/10/contrib/expat/lib/xmlrole.c
  stable/10/contrib/expat/lib/xmltok.c
  stable/10/contrib/expat/lib/xmltok.h
  stable/10/contrib/expat/lib/xmltok_impl.c
  stable/10/contrib/expat/tests/benchmark/README.txt
  stable/10/contrib/expat/tests/chardata.c
  stable/10/contrib/expat/tests/minicheck.c
  stable/10/contrib/expat/tests/minicheck.h
  stable/10/contrib/expat/tests/runtests.c
  stable/10/contrib/expat/tests/xmltest.sh
  stable/10/contrib/expat/xmlwf/codepage.c
  stable/10/contrib/expat/xmlwf/readfilemap.c
  stable/10/contrib/expat/xmlwf/unixfilemap.c
  stable/10/contrib/expat/xmlwf/xmlfile.c
  stable/10/contrib/expat/xmlwf/xmlwf.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/expat/COPYING
==
--- stable/10/contrib/expat/COPYING Thu Jul  7 03:39:18 2016
(r302384)
+++ stable/10/contrib/expat/COPYING Thu Jul  7 04:59:58 2016
(r302385)
@@ -1,6 +1,5 @@
-Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
-   and Clark Cooper
-Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
+Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
+Copyright (c) 2001-2016 Expat maintainers
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the

Modified: stable/10/contrib/expat/Changes
==
--- stable/10/contrib/expat/Changes Thu Jul  7 03:39:18 2016
(r302384)
+++ stable/10/contrib/expat/Changes Thu Jul  7 04:59:58 2016
(r302385)
@@ -1,3 +1,67 @@
+Release 2.2.0 Tue June 21 2016
+Security fixes:
+#537  CVE-2016-0718 -- Fix crash on malformed input
+  CVE-2016-4472 -- Improve insufficient fix to CVE-2015-1283 /
+   CVE-2015-2716 introduced with Expat 2.1.1
+#499  CVE-2016-5300 -- Use more entropy for hash initialization
+   than the original fix to CVE-2012-0876
+#519  CVE-2012-6702 -- Resolve troublesome internal call to srand
+   that was introduced with Expat 2.1.0
+   when addressing CVE-2012-0876 (issue #496)
+
+Bug fixes:
+  Fix uninitialized reads of size 1
+(e.g. in little2_updatePosition)
+  Fix detection of UTF-8 character boundaries
+
+Other changes:
+#532  Fix compilation for Visual Studio 2010 (keyword "C99")
+  Autotools: Resolve use of "$<" to better support bmake
+  Autotools: Add QA script "qa.sh" (and make target "qa")
+  Autotools: Respect CXXFLAGS if given
+  Autotools: Fix "make run-xmltest"
+  Autotools: Have "make run-xmltest" check for expected output
+ p90  CMake: Fix static build (BUILD_shared=OFF) on Windows
+#536  CMake: Add soversion, support -DNO_SONAME=yes to bypass
+#323  CMake: Add suffix "d" to differentiate debug from release
+  CMake: Define WIN32 with CMake on Windows
+  Annotate memory allocators for GCC
+  Address all currently known compile warnings
+  Make sure that API symbols remain visible despite
+-fvisibility=hidden
+  Remove executable flag from source files
+  Resolve COMPILED_FROM_DSP in favor of WIN32
+
+Special thanks to:
+Björn Lindahl
+Christian Heimes
+Cristian Rodríguez
+Daniel Krügler
+Gustavo Grieco
+

svn commit: r302384 - in head/sys/dev: e1000 ixgb ixgbe ixl

2016-07-06 Thread Sean Bruno
Author: sbruno
Date: Thu Jul  7 03:39:18 2016
New Revision: 302384
URL: https://svnweb.freebsd.org/changeset/base/302384

Log:
  Do not initialize the adapter on MTU change when adapter status is down.
  This fixes long-standing problems when changing settings of the adapter.
  
  Discussed in:
  https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html
  
  Submitted by: arnaud.ys...@stormshield.eu
  Reviewed by:  e...@freebsd.org
  Approved by:  re (gjb)
  Differential Revision:https://reviews.freebsd.org/D7030

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_lem.c
  head/sys/dev/ixgb/if_ixgb.c
  head/sys/dev/ixgbe/if_ix.c
  head/sys/dev/ixgbe/if_ixv.c
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/if_ixlv.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/e1000/if_em.c  Thu Jul  7 03:39:18 2016(r302384)
@@ -1214,7 +1214,8 @@ em_ioctl(if_t ifp, u_long command, caddr
if_setmtu(ifp, ifr->ifr_mtu);
adapter->hw.mac.max_frame_size =
if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   em_init_locked(adapter);
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
+   em_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
}

Modified: head/sys/dev/e1000/if_igb.c
==
--- head/sys/dev/e1000/if_igb.c Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/e1000/if_igb.c Thu Jul  7 03:39:18 2016(r302384)
@@ -1106,7 +1106,8 @@ igb_ioctl(struct ifnet *ifp, u_long comm
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   igb_init_locked(adapter);
+   if ((ifp->if_drv_flags & IFF_DRV_RUNNING))
+   igb_init_locked(adapter);
IGB_CORE_UNLOCK(adapter);
break;
}

Modified: head/sys/dev/e1000/if_lem.c
==
--- head/sys/dev/e1000/if_lem.c Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/e1000/if_lem.c Thu Jul  7 03:39:18 2016(r302384)
@@ -1053,7 +1053,8 @@ lem_ioctl(if_t ifp, u_long command, cadd
if_setmtu(ifp, ifr->ifr_mtu);
adapter->max_frame_size =
if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN;
-   lem_init_locked(adapter);
+   if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING))
+   lem_init_locked(adapter);
EM_CORE_UNLOCK(adapter);
break;
}

Modified: head/sys/dev/ixgb/if_ixgb.c
==
--- head/sys/dev/ixgb/if_ixgb.c Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/ixgb/if_ixgb.c Thu Jul  7 03:39:18 2016(r302384)
@@ -539,7 +539,8 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD
adapter->hw.max_frame_size =
ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
 
-   ixgb_init_locked(adapter);
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+   ixgb_init_locked(adapter);
IXGB_UNLOCK(adapter);
}
break;

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/ixgbe/if_ix.c  Thu Jul  7 03:39:18 2016(r302384)
@@ -893,7 +893,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + IXGBE_MTU_HDR;
-   ixgbe_init_locked(adapter);
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+   ixgbe_init_locked(adapter);
 #ifdef PCI_IOV
ixgbe_recalculate_max_frame(adapter);
 #endif

Modified: head/sys/dev/ixgbe/if_ixv.c
==
--- head/sys/dev/ixgbe/if_ixv.c Thu Jul  7 02:23:52 2016(r302383)
+++ head/sys/dev/ixgbe/if_ixv.c Thu Jul  7 03:39:18 2016(r302384)
@@ -578,7 +578,8 @@ ixv_ioctl(struct ifnet * ifp, u_long com
ifp->if_mtu = ifr->ifr_mtu;
adapter->max_frame_size =
ifp->if_mtu + IXGBE_MTU_HDR;
-   ixv_init_locked(adapter);
+   if (ifp->if_drv_flags & 

svn commit: r302383 - stable/10/contrib/ipfilter/tools

2016-07-06 Thread Cy Schubert
Author: cy
Date: Thu Jul  7 02:23:52 2016
New Revision: 302383
URL: https://svnweb.freebsd.org/changeset/base/302383

Log:
  MFC r302296:
  
  Remove dead code.

Modified:
  stable/10/contrib/ipfilter/tools/ipf.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/ipfilter/tools/ipf.c
==
--- stable/10/contrib/ipfilter/tools/ipf.c  Wed Jul  6 23:49:19 2016
(r302382)
+++ stable/10/contrib/ipfilter/tools/ipf.c  Thu Jul  7 02:23:52 2016
(r302383)
@@ -410,23 +410,6 @@ static void flushfilter(arg, filter)
return;
}
 
-#ifdef SIOCIPFFA
-   if (!strcmp(arg, "u")) {
-   closedevice();
-   /*
-* Flush auth rules and packets
-*/
-   if (opendevice(IPL_AUTH, 1) == -1)
-   perror("open(IPL_AUTH)");
-   else {
-   if (ioctl(fd, SIOCIPFFA, ) == -1)
-   ipferror(fd, "ioctl(SIOCIPFFA)");
-   }
-   closedevice();
-   return;
-   }
-#endif
-
if (strchr(arg, 'i') || strchr(arg, 'I'))
fl = FR_INQUE;
if (strchr(arg, 'o') || strchr(arg, 'O'))
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302382 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-07-06 Thread Steven Hartland
Author: smh
Date: Wed Jul  6 23:49:19 2016
New Revision: 302382
URL: https://svnweb.freebsd.org/changeset/base/302382

Log:
  Fix ZFS ARC min / max tunable
  
  Due to ARC initial configuration not being done and kmem information
  not being available we need to blindly set zfs_arc_max and zfs_arc_min
  when configured via the tunable.
  
  This fixes vfs.zfs.arc_(min|max) configuration via loader.conf broken by
  r302265.
  
  Approved by:  re(gjb)
  MFC after:1 week

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Wed Jul  6 
22:21:22 2016(r302381)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c   Wed Jul  6 
23:49:19 2016(r302382)
@@ -919,6 +919,12 @@ sysctl_vfs_zfs_arc_max(SYSCTL_HANDLER_AR
if (err != 0 || req->newptr == NULL)
return (err);
 
+   if (zfs_arc_max == 0) {
+   /* Loader tunable so blindly set */
+   zfs_arc_max = val;
+   return (0);
+   }
+
if (val < arc_abs_min || val > kmem_size())
return (EINVAL);
if (val < arc_c_min)
@@ -956,6 +962,12 @@ sysctl_vfs_zfs_arc_min(SYSCTL_HANDLER_AR
if (err != 0 || req->newptr == NULL)
return (err);
 
+   if (zfs_arc_min == 0) {
+   /* Loader tunable so blindly set */
+   zfs_arc_min = val;
+   return (0);
+   }
+
if (val < arc_abs_min || val > arc_c_max)
return (EINVAL);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302381 - head/sys/fs/cuse

2016-07-06 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Jul  6 22:21:22 2016
New Revision: 302381
URL: https://svnweb.freebsd.org/changeset/base/302381

Log:
  Handle IOC_VOID special case of passing an integer IOCTL argument through 
CUSE.
  
  Submitted by: Vladimir Kondratyev 
  Approved by:  re (gjb)

Modified:
  head/sys/fs/cuse/cuse.c

Modified: head/sys/fs/cuse/cuse.c
==
--- head/sys/fs/cuse/cuse.c Wed Jul  6 20:48:42 2016(r302380)
+++ head/sys/fs/cuse/cuse.c Wed Jul  6 22:21:22 2016(r302381)
@@ -1656,7 +1656,7 @@ cuse_client_ioctl(struct cdev *dev, unsi
 
cuse_cmd_lock(pccmd);
 
-   if (cmd & IOC_IN)
+   if (cmd & (IOC_IN | IOC_VOID))
memcpy(pcc->ioctl_buffer, data, len);
 
/*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302380 - head/sys/dev/isci/scil

2016-07-06 Thread Jim Harris
Author: jimharris
Date: Wed Jul  6 20:48:42 2016
New Revision: 302380
URL: https://svnweb.freebsd.org/changeset/base/302380

Log:
  isci: fix ATA PASSTHROUGH fixed sense data format
  
  PR: kern/191717
  Submitted by: mar...@lispworks.com
  Approved by: re (gjb)
  MFC after: 3 days

Modified:
  head/sys/dev/isci/scil/sati_passthrough.c
  head/sys/dev/isci/scil/sati_util.c

Modified: head/sys/dev/isci/scil/sati_passthrough.c
==
--- head/sys/dev/isci/scil/sati_passthrough.c   Wed Jul  6 18:55:46 2016
(r302379)
+++ head/sys/dev/isci/scil/sati_passthrough.c   Wed Jul  6 20:48:42 2016
(r302380)
@@ -230,9 +230,9 @@ void sati_passthrough_construct_sense(
 
// Command specific section
sati_set_sense_data_byte(sense_data, sense_len, 8,  
(PASSTHROUGH_CDB_EXTEND(cdb) << 7) | (sector_count_upper << 6) | (lba_upper << 
5));
-   sati_set_sense_data_byte(sense_data, sense_len, 9,  
sati_get_ata_lba_high(register_fis));
+   sati_set_sense_data_byte(sense_data, sense_len, 9,  
sati_get_ata_lba_low(register_fis));
sati_set_sense_data_byte(sense_data, sense_len, 10, 
sati_get_ata_lba_mid(register_fis));
-   sati_set_sense_data_byte(sense_data, sense_len, 11, 
sati_get_ata_lba_low(register_fis));
+   sati_set_sense_data_byte(sense_data, sense_len, 11, 
sati_get_ata_lba_high(register_fis));
 
sequence->is_sense_response_set = TRUE;
 }

Modified: head/sys/dev/isci/scil/sati_util.c
==
--- head/sys/dev/isci/scil/sati_util.c  Wed Jul  6 18:55:46 2016
(r302379)
+++ head/sys/dev/isci/scil/sati_util.c  Wed Jul  6 20:48:42 2016
(r302380)
@@ -932,7 +932,7 @@ void sati_scsi_fixed_sense_data_construc
 sati_set_sense_data_byte(sense_data, sense_len, 4,  0);
 sati_set_sense_data_byte(sense_data, sense_len, 5,  0);
 sati_set_sense_data_byte(sense_data, sense_len, 6,  0);
-sati_set_sense_data_byte(sense_data, sense_len, 7,  0);
+sati_set_sense_data_byte(sense_data, sense_len, 7,  (sense_len < 18 ? 
sense_len - 1 : 17) - 7);
 sati_set_sense_data_byte(sense_data, sense_len, 8,  0);
 sati_set_sense_data_byte(sense_data, sense_len, 9,  0);
 sati_set_sense_data_byte(sense_data, sense_len, 10, 0);
@@ -981,7 +981,7 @@ void sati_scsi_common_fixed_sense_constr
 
//Bytes 3, 4, 5, 6 are set in read_error_sense_construct functions
 
-   sati_set_sense_data_byte(sense_data, sense_len, 7,  0);
+   sati_set_sense_data_byte(sense_data, sense_len, 7,  (sense_len < 18 ? 
sense_len - 1 : 17) - 7);
sati_set_sense_data_byte(sense_data, sense_len, 8,  0);
sati_set_sense_data_byte(sense_data, sense_len, 9,  0);
sati_set_sense_data_byte(sense_data, sense_len, 10, 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302379 - head/sys/sys

2016-07-06 Thread John Baldwin
Author: jhb
Date: Wed Jul  6 18:55:46 2016
New Revision: 302379
URL: https://svnweb.freebsd.org/changeset/base/302379

Log:
  Correct locking annotation for p_comm.
  
  p_comm is changed during exec, it is not read-only after fork.
  
  Pointed out by:   rwatson
  Approved by:  re (gjb, kib)
  MFC after:1 week

Modified:
  head/sys/sys/proc.h

Modified: head/sys/sys/proc.h
==
--- head/sys/sys/proc.h Wed Jul  6 17:46:49 2016(r302378)
+++ head/sys/sys/proc.h Wed Jul  6 18:55:46 2016(r302379)
@@ -602,7 +602,7 @@ struct proc {
u_int   p_magic;/* (b) Magic number. */
int p_osrel;/* (x) osreldate for the
   binary (from ELF note, if any) */
-   charp_comm[MAXCOMLEN + 1];  /* (b) Process name. */
+   charp_comm[MAXCOMLEN + 1];  /* (x) Process name. */
struct sysentvec *p_sysent; /* (b) Syscall dispatch info. */
struct pargs*p_args;/* (c) Process arguments. */
rlim_t  p_cpulimit; /* (c) Current CPU limit in seconds. */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302378 - head/sys/net

2016-07-06 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Jul  6 17:46:49 2016
New Revision: 302378
URL: https://svnweb.freebsd.org/changeset/base/302378

Log:
  Add variable declaration missing in r302372.
  
  Submitted by: andrew
  Approved by:  re (gjb, kib)

Modified:
  head/sys/net/flowtable.c

Modified: head/sys/net/flowtable.c
==
--- head/sys/net/flowtable.cWed Jul  6 17:45:38 2016(r302377)
+++ head/sys/net/flowtable.cWed Jul  6 17:46:49 2016(r302378)
@@ -739,6 +739,7 @@ flowtable_lookup_common(struct flowtable
 static void
 flowtable_alloc(struct flowtable *ft)
 {
+   int i;
 
ft->ft_table = malloc(ft->ft_size * sizeof(struct flist),
M_FTABLE, M_WAITOK);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302377 - in stable/10: lib/libcam sbin/camcontrol sbin/iscontrol sys/cam usr.sbin/camdd usr.sbin/mptutil

2016-07-06 Thread Don Lewis
Author: truckman
Date: Wed Jul  6 17:45:38 2016
New Revision: 302377
URL: https://svnweb.freebsd.org/changeset/base/302377

Log:
  MFC r300547
  
  Fix multiple Coverity Out-of-bounds access false postive issues in CAM
  
  The currently used idiom for clearing the part of a ccb after its
  header generates one or two Coverity errors for each time it is
  used.  All instances generate an Out-of-bounds access (ARRAY_VS_SINGLETON)
  error because of the treatment of the header as a two element array,
  with a pointer to the non-existent second element being passed as
  the starting address to bzero().  Some instances also alsp generate
  Out-of-bounds access (OVERRUN) errors, probably because the space
  being cleared is larger than the sizeofstruct ccb_hdr).
  
  In addition, this idiom is difficult for humans to understand and
  it is error prone.  The user has to chose the proper struct ccb_*
  type (which does not appear in the surrounding code) for the sizeof()
  in the length calculation.  I found several instances where the
  length was incorrect, which could cause either an actual out of
  bounds write, or incompletely clear the ccb.
  
  A better way is to write the code to clear the ccb itself starting
  at sizeof(ccb_hdr) bytes from the start of the ccb, and calculate
  the length based on the specific type of struct ccb_* being cleared
  as specified by the union ccb member being used.  The latter can
  normally be seen in the nearby code.  This is friendlier for Coverity
  and other static analysis tools because they will see that the
  intent is to clear the trailing part of the ccb.
  
  Wrap all of the boilerplate code in a convenient macro that only
  requires a pointer to the desired union ccb member (or a pointer
  to the union ccb itself) as an argument.
  
  Reported by:  Coverity
  CID:  1007578, 1008684, 1009724, 1009773, 1011304, 1011306
  CID:  1011307, 1011308, 1011309, 1011310, 1011311, 1011312
  CID:  1011313, 1011314, 1011315, 1011316, 1011317, 1011318
  CID:  1011319, 1011320, 1011321, 1011322, 1011324, 1011325
  CID:  1011326, 1011327, 1011328, 1011329, 1011330, 1011374
  CID:  1011390, 1011391, 1011392, 1011393, 1011394, 1011395
  CID:  1011396, 1011397, 1011398, 1011399, 1011400, 1011401
  CID:  1011402, 1011403, 1011404, 1011405, 1011406, 1011408
  CID:  1011409, 1011410, 1011411, 1011412, 1011413, 1011414
  CID:  1017461, 1018387, 1086860, 1086874, 1194257, 1229897
  CID:  1229968, 1306229, 1306234, 1331282, 1331283, 1331294
  CID:  1331295, 1331535, 1331536, 1331539, 1331540, 1341623
  CID:  1341624, 1341637, 1341638, 1355264, 1355324
  Reviewed by:  scottl, ken, delphij, imp
  MFH:  1 month
  Differential Revision:https://reviews.freebsd.org/D6496

Modified:
  stable/10/lib/libcam/camlib.c
  stable/10/sbin/camcontrol/attrib.c
  stable/10/sbin/camcontrol/camcontrol.c
  stable/10/sbin/camcontrol/fwdownload.c
  stable/10/sbin/camcontrol/persist.c
  stable/10/sbin/iscontrol/fsm.c
  stable/10/sys/cam/cam_ccb.h
  stable/10/usr.sbin/camdd/camdd.c
  stable/10/usr.sbin/mptutil/mpt_cam.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libcam/camlib.c
==
--- stable/10/lib/libcam/camlib.c   Wed Jul  6 17:42:09 2016
(r302376)
+++ stable/10/lib/libcam/camlib.c   Wed Jul  6 17:45:38 2016
(r302377)
@@ -619,7 +619,7 @@ cam_real_open_device(const char *path, i
/*
 * Zero the payload, the kernel does look at the flags.
 */
-   bzero(&(_h)[1], sizeof(struct ccb_trans_settings));
+   CCB_CLEAR_ALL_EXCEPT_HDR();
 
/*
 * Get transfer settings for this device.

Modified: stable/10/sbin/camcontrol/attrib.c
==
--- stable/10/sbin/camcontrol/attrib.c  Wed Jul  6 17:42:09 2016
(r302376)
+++ stable/10/sbin/camcontrol/attrib.c  Wed Jul  6 17:45:38 2016
(r302377)
@@ -137,8 +137,7 @@ scsiattrib(struct cam_device *device, in
goto bailout;
}
 
-   bzero(&(>ccb_h)[1],
- sizeof(union ccb) - sizeof(struct ccb_hdr));
+   CCB_CLEAR_ALL_EXCEPT_HDR(>csio);
 
STAILQ_INIT(_attr_list);
 

Modified: stable/10/sbin/camcontrol/camcontrol.c
==
--- stable/10/sbin/camcontrol/camcontrol.c  Wed Jul  6 17:42:09 2016
(r302376)
+++ stable/10/sbin/camcontrol/camcontrol.c  Wed Jul  6 17:45:38 2016
(r302377)
@@ -838,8 +838,7 @@ scsiinquiry(struct cam_device *device, i
}
 
/* cam_getccb cleans up the header, caller has to zero the payload */
-   bzero(&(>ccb_h)[1],
- sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr));
+   CCB_CLEAR_ALL_EXCEPT_HDR(>csio);
 
  

svn commit: r302376 - in stable/10: sbin/camcontrol sys/cam sys/cam/scsi

2016-07-06 Thread Don Lewis
Author: truckman
Date: Wed Jul  6 17:42:09 2016
New Revision: 302376
URL: https://svnweb.freebsd.org/changeset/base/302376

Log:
  MFC r299371 (by trasz)
  
  Add "camcontrol reprobe" subcommand, and implement it for da(4).
  This makes it possible to manually force updating capacity data
  after the disk got resized. Without it it might be neccessary to
  reboot before FreeBSD notices updated disk size under eg VMWare.
  
  Differential Revision:https://reviews.freebsd.org/D6108

Modified:
  stable/10/sbin/camcontrol/camcontrol.8
  stable/10/sbin/camcontrol/camcontrol.c
  stable/10/sys/cam/cam_ccb.h
  stable/10/sys/cam/cam_xpt.c
  stable/10/sys/cam/scsi/scsi_da.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/camcontrol/camcontrol.8
==
--- stable/10/sbin/camcontrol/camcontrol.8  Wed Jul  6 16:20:10 2016
(r302375)
+++ stable/10/sbin/camcontrol/camcontrol.8  Wed Jul  6 17:42:09 2016
(r302376)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 6, 2015
+.Dd April 26, 2016
 .Dt CAMCONTROL 8
 .Os
 .Sh NAME
@@ -98,6 +98,9 @@
 .Op device id
 .Op generic args
 .Nm
+.Ic reprobe
+.Op device id
+.Nm
 .Ic rescan
 .Aq all | bus Ns Op :target:lun
 .Nm
@@ -518,6 +521,12 @@ are not specified).
 Print out the last logical block or the size of the device only, and omit
 the blocksize.
 .El
+.Pp
+Note that this command only displays the information, it does not update
+the kernel data structures.
+Use the
+.Nm 
+reprobe subcommand to do that.
 .It Ic start
 Send the SCSI Start/Stop Unit (0x1B) command to the given device with the
 start bit set.
@@ -539,6 +548,12 @@ The user
 may specify a scan of all busses, a single bus, or a lun.
 Scanning all luns
 on a target is not supported.
+.It Ic reprobe
+Tell the kernel to refresh the information about the device and
+notify the upper layer,
+.Xr GEOM 4 .
+This includes sending the SCSI READ CAPACITY command and updating
+the disk size visible to the rest of the system.
 .It Ic reset
 Tell the kernel to reset all busses in the system (with the
 .Ar all

Modified: stable/10/sbin/camcontrol/camcontrol.c
==
--- stable/10/sbin/camcontrol/camcontrol.c  Wed Jul  6 16:20:10 2016
(r302375)
+++ stable/10/sbin/camcontrol/camcontrol.c  Wed Jul  6 17:42:09 2016
(r302376)
@@ -100,7 +100,8 @@ typedef enum {
CAM_CMD_APM = 0x0021,
CAM_CMD_AAM = 0x0022,
CAM_CMD_ATTRIB  = 0x0023,
-   CAM_CMD_OPCODES = 0x0024
+   CAM_CMD_OPCODES = 0x0024,
+   CAM_CMD_REPROBE = 0x0025
 } cam_cmdmask;
 
 typedef enum {
@@ -190,6 +191,7 @@ static struct camcontrol_opts option_tab
{"eject", CAM_CMD_STARTSTOP, CAM_ARG_EJECT, NULL},
{"reportluns", CAM_CMD_REPORTLUNS, CAM_ARG_NONE, "clr:"},
{"readcapacity", CAM_CMD_READCAP, CAM_ARG_NONE, "bhHNqs"},
+   {"reprobe", CAM_CMD_REPROBE, CAM_ARG_NONE, NULL},
 #endif /* MINIMALISTIC */
{"rescan", CAM_CMD_RESCAN, CAM_ARG_NONE, NULL},
{"reset", CAM_CMD_RESET, CAM_ARG_NONE, NULL},
@@ -328,6 +330,7 @@ static int scsiprintopcodes(struct cam_d
 static int scsiopcodes(struct cam_device *device, int argc, char **argv,
   char *combinedopt, int retry_count, int timeout,
   int verbose);
+static int scsireprobe(struct cam_device *device);
 
 #endif /* MINIMALISTIC */
 #ifndef min
@@ -8662,6 +8665,42 @@ bailout:
 
 #endif /* MINIMALISTIC */
 
+static int
+scsireprobe(struct cam_device *device)
+{
+   union ccb *ccb;
+   int retval = 0;
+
+   ccb = cam_getccb(device);
+
+   if (ccb == NULL) {
+   warnx("%s: error allocating ccb", __func__);
+   return (1);
+   }
+
+   bzero(&(>ccb_h)[1],
+ sizeof(struct ccb_scsiio) - sizeof(struct ccb_hdr));
+
+   ccb->ccb_h.func_code = XPT_REPROBE_LUN;
+
+   if (cam_send_ccb(device, ccb) < 0) {
+   warn("error sending XPT_REPROBE_LUN CCB");
+   retval = 1;
+   goto bailout;
+   }
+
+   if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
+   cam_error_print(device, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr);
+   retval = 1;
+   goto bailout;
+   }
+
+bailout:
+   cam_freeccb(ccb);
+
+   return (retval);
+}
+
 void
 usage(int printlong)
 {
@@ -8681,6 +8720,7 @@ usage(int printlong)
 "camcontrol stop   [dev_id][generic args]\n"
 "camcontrol load   [dev_id][generic args]\n"
 "camcontrol eject  [dev_id][generic args]\n"
+"camcontrol reprobe[dev_id][generic args]\n"
 #endif /* MINIMALISTIC */
 "camcontrol rescan \n"
 "camcontrol reset  \n"
@@ -8753,6 +8793,7 @@ usage(int printlong)
 "stop

Re: svn commit: r302372 - in head/sys: amd64/include cddl/compat/opensolaris/sys dev/cpuctl i386/include kern net netinet powerpc/include powerpc/powerpc vm

2016-07-06 Thread Andrew Turner
On Wed, 6 Jul 2016 10:00:08 -0700
Nathan Whitehorn  wrote:

> On 07/06/16 09:57, Andrew Turner wrote:
> > On Wed, 6 Jul 2016 14:09:49 + (UTC)
> > Nathan Whitehorn  wrote:
> >  
> >> Author: nwhitehorn
> >> Date: Wed Jul  6 14:09:49 2016
> >> New Revision: 302372
> >> URL: https://svnweb.freebsd.org/changeset/base/302372
> >>
> >> Log:
> >>Replace a number of conflations of mp_ncpus and mp_maxid with
> >> either mp_maxid or CPU_FOREACH() as appropriate. This fixes a
> >> number of places in the kernel that assumed CPU IDs are dense in
> >> [0, mp_ncpus) and would try, for example, to run tasks on CPUs
> >> that did not exist or to allocate too few buffers on systems with
> >> sparse CPU IDs in which there are holes in the range and mp_maxid
> >> > mp_ncpus. Such circumstances generally occur on systems with
> >> > SMT, but on which SMT
> >> is disabled. This patch restores system operation at least on
> >> POWER8 systems configured in this way.
> >>There are a number of other places in the kernel with potential
> >> problems in these situations, but where sparse CPU IDs are not
> >> currently known to occur, mostly in the ARM machine-dependent code.
> >> These will be fixed in a follow-up commit after the stable/11
> >> branch. 
> > ...  
> >> Modified: head/sys/net/flowtable.c
> >> ==
> >> --- head/sys/net/flowtable.c   Wed Jul  6 10:57:04 2016
> >> (r302371) +++ head/sys/net/flowtable.c Wed Jul  6 14:09:49
> >> 2016   (r302372) @@ -746,7 +746,7 @@ flowtable_alloc(struct
> >> flowtable *ft) ft->ft_table[i] = uma_zalloc(pcpu_zone_ptr,
> >> M_WAITOK | M_ZERO);
> >>ft->ft_masks = uma_zalloc(pcpu_zone_ptr, M_WAITOK);
> >> -  for (int i = 0; i < mp_ncpus; i++) {
> >> +  CPU_FOREACH(i) {  
> > This is broken, it removed the declaration of i.
> >
> > Andrew
> >  
> 
> You are right. Somehow my build tests succeeded anyway. Will fix
> quickly. -Nathan
> 

It only seems to be enabled in LINT.

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


Re: svn commit: r302372 - in head/sys: amd64/include cddl/compat/opensolaris/sys dev/cpuctl i386/include kern net netinet powerpc/include powerpc/powerpc vm

2016-07-06 Thread Nathan Whitehorn



On 07/06/16 09:57, Andrew Turner wrote:

On Wed, 6 Jul 2016 14:09:49 + (UTC)
Nathan Whitehorn  wrote:


Author: nwhitehorn
Date: Wed Jul  6 14:09:49 2016
New Revision: 302372
URL: https://svnweb.freebsd.org/changeset/base/302372

Log:
   Replace a number of conflations of mp_ncpus and mp_maxid with either
   mp_maxid or CPU_FOREACH() as appropriate. This fixes a number of
places in the kernel that assumed CPU IDs are dense in [0, mp_ncpus)
and would try, for example, to run tasks on CPUs that did not exist
or to allocate too few buffers on systems with sparse CPU IDs in
which there are holes in the range and mp_maxid > mp_ncpus. Such
circumstances generally occur on systems with SMT, but on which SMT
is disabled. This patch restores system operation at least on POWER8
systems configured in this way.
   There are a number of other places in the kernel with potential
problems in these situations, but where sparse CPU IDs are not
currently known to occur, mostly in the ARM machine-dependent code.
These will be fixed in a follow-up commit after the stable/11 branch.
   

...

Modified: head/sys/net/flowtable.c
==
--- head/sys/net/flowtable.cWed Jul  6 10:57:04 2016
(r302371) +++ head/sys/net/flowtable.c  Wed Jul  6 14:09:49
2016(r302372) @@ -746,7 +746,7 @@ flowtable_alloc(struct
flowtable *ft) ft->ft_table[i] = uma_zalloc(pcpu_zone_ptr, M_WAITOK |
M_ZERO);
ft->ft_masks = uma_zalloc(pcpu_zone_ptr, M_WAITOK);
-   for (int i = 0; i < mp_ncpus; i++) {
+   CPU_FOREACH(i) {

This is broken, it removed the declaration of i.

Andrew



You are right. Somehow my build tests succeeded anyway. Will fix quickly.
-Nathan
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r302372 - in head/sys: amd64/include cddl/compat/opensolaris/sys dev/cpuctl i386/include kern net netinet powerpc/include powerpc/powerpc vm

2016-07-06 Thread Andrew Turner
On Wed, 6 Jul 2016 14:09:49 + (UTC)
Nathan Whitehorn  wrote:

> Author: nwhitehorn
> Date: Wed Jul  6 14:09:49 2016
> New Revision: 302372
> URL: https://svnweb.freebsd.org/changeset/base/302372
> 
> Log:
>   Replace a number of conflations of mp_ncpus and mp_maxid with either
>   mp_maxid or CPU_FOREACH() as appropriate. This fixes a number of
> places in the kernel that assumed CPU IDs are dense in [0, mp_ncpus)
> and would try, for example, to run tasks on CPUs that did not exist
> or to allocate too few buffers on systems with sparse CPU IDs in
> which there are holes in the range and mp_maxid > mp_ncpus. Such
> circumstances generally occur on systems with SMT, but on which SMT
> is disabled. This patch restores system operation at least on POWER8
> systems configured in this way. 
>   There are a number of other places in the kernel with potential
> problems in these situations, but where sparse CPU IDs are not
> currently known to occur, mostly in the ARM machine-dependent code.
> These will be fixed in a follow-up commit after the stable/11 branch.
>   
...
> Modified: head/sys/net/flowtable.c
> ==
> --- head/sys/net/flowtable.c  Wed Jul  6 10:57:04 2016
> (r302371) +++ head/sys/net/flowtable.cWed Jul  6 14:09:49
> 2016  (r302372) @@ -746,7 +746,7 @@ flowtable_alloc(struct
> flowtable *ft) ft->ft_table[i] = uma_zalloc(pcpu_zone_ptr, M_WAITOK |
> M_ZERO); 
>   ft->ft_masks = uma_zalloc(pcpu_zone_ptr, M_WAITOK);
> - for (int i = 0; i < mp_ncpus; i++) {
> + CPU_FOREACH(i) {

This is broken, it removed the declaration of i.

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


svn commit: r302375 - in head/sys: arm64/arm64 conf

2016-07-06 Thread Andrew Turner
Author: andrew
Date: Wed Jul  6 16:20:10 2016
New Revision: 302375
URL: https://svnweb.freebsd.org/changeset/base/302375

Log:
  Remove the old pre-INTRNG arm64 interrupt framework. GENERIC was switched
  to INTRNG in r301565 with the old code no longer being built by default with
  no reports of issues on any supported hardware.
  
  Approved by:  re (gjb)
  Obtained from:ABT Systems Ltd
  Sponsored by: The FreeBSD Foundation

Deleted:
  head/sys/arm64/arm64/gic.c
  head/sys/arm64/arm64/gic_acpi.c
  head/sys/arm64/arm64/gic_fdt.c
  head/sys/arm64/arm64/gic_v3_its.c
  head/sys/arm64/arm64/intr_machdep.c
  head/sys/arm64/arm64/pic_if.m
Modified:
  head/sys/conf/files.arm64

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Wed Jul  6 16:17:13 2016(r302374)
+++ head/sys/conf/files.arm64   Wed Jul  6 16:20:10 2016(r302375)
@@ -25,15 +25,10 @@ arm64/arm64/disassem.c  optionalddb
 arm64/arm64/dump_machdep.c standard
 arm64/arm64/elf_machdep.c  standard
 arm64/arm64/exception.Sstandard
-arm64/arm64/gic.c  optional!intrng
 arm64/arm64/gicv3_its.coptionalintrng
-arm64/arm64/gic_acpi.c optional!intrng acpi
-arm64/arm64/gic_fdt.c  optional!intrng fdt
 arm64/arm64/gic_v3.c   standard
 arm64/arm64/gic_v3_fdt.c   optionalfdt
-arm64/arm64/gic_v3_its.c   optional!intrng
 arm64/arm64/identcpu.c standard
-arm64/arm64/intr_machdep.c optional!intrng
 arm64/arm64/in_cksum.c optionalinet | inet6
 arm64/arm64/locore.S   standardno-obj
 arm64/arm64/machdep.c  standard
@@ -42,7 +37,6 @@ arm64/arm64/minidump_machdep.cstandard
 arm64/arm64/mp_machdep.c   optionalsmp
 arm64/arm64/nexus.cstandard
 arm64/arm64/ofw_machdep.c  optionalfdt
-arm64/arm64/pic_if.m   optional!intrng
 arm64/arm64/pmap.c standard
 arm64/arm64/stack_machdep.coptionalddb | stack
 arm64/arm64/support.S  standard
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302374 - head/sys/netinet

2016-07-06 Thread Jonathan T. Looney
Author: jtl
Date: Wed Jul  6 16:17:13 2016
New Revision: 302374
URL: https://svnweb.freebsd.org/changeset/base/302374

Log:
  The TCPPCAP debugging feature caches recently-used mbufs for use in
  debugging TCP connections. This commit provides a mechanism to free those
  mbufs when the system is under memory pressure.
  
  Because this will result in lost debugging information, the behavior is
  controllable by a sysctl. The default setting is to free the mbufs.
  
  Reviewed by:  gnn
  Approved by:  re (gjb)
  Differential Revision:https://reviews.freebsd.org/D6931
  Input from:   novice_techie.com

Modified:
  head/sys/netinet/tcp_pcap.c
  head/sys/netinet/tcp_pcap.h
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_pcap.c
==
--- head/sys/netinet/tcp_pcap.c Wed Jul  6 16:02:15 2016(r302373)
+++ head/sys/netinet/tcp_pcap.c Wed Jul  6 16:17:13 2016(r302374)
@@ -42,9 +42,13 @@
 #define M_LEADINGSPACE_NOWRITE(m)  \
((m)->m_data - M_START(m))
 
+int tcp_pcap_aggressive_free = 1;
 static int tcp_pcap_clusters_referenced_cur = 0;
 static int tcp_pcap_clusters_referenced_max = 0;
 
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_aggressive_free,
+   CTLFLAG_RW, _pcap_aggressive_free, 0,
+   "Free saved packets when the memory system comes under pressure");
 SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_clusters_referenced_cur,
CTLFLAG_RD, _pcap_clusters_referenced_cur, 0,
"Number of clusters currently referenced on TCP PCAP queues");

Modified: head/sys/netinet/tcp_pcap.h
==
--- head/sys/netinet/tcp_pcap.h Wed Jul  6 16:02:15 2016(r302373)
+++ head/sys/netinet/tcp_pcap.h Wed Jul  6 16:17:13 2016(r302374)
@@ -36,4 +36,6 @@ void tcp_pcap_tcpcb_init(struct tcpcb *t
 void tcp_pcap_set_sock_max(struct mbufq *queue, int newval);
 int tcp_pcap_get_sock_max(struct mbufq *queue);
 
+extern int tcp_pcap_aggressive_free;
+
 #endif /* _NETINET_TCP_PCAP_H_ */

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Wed Jul  6 16:02:15 2016(r302373)
+++ head/sys/netinet/tcp_subr.c Wed Jul  6 16:17:13 2016(r302374)
@@ -1605,6 +1605,13 @@ tcp_drain(void)
if ((tcpb = intotcpcb(inpb)) != NULL) {
tcp_reass_flush(tcpb);
tcp_clean_sackreport(tcpb);
+#ifdef TCPPCAP
+   if (tcp_pcap_aggressive_free) {
+   /* Free the TCP PCAP queues. */
+   tcp_pcap_drain(&(tcpb->t_inpkts));
+   tcp_pcap_drain(&(tcpb->t_outpkts));
+   }
+#endif
}
INP_WUNLOCK(inpb);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-07-06 Thread Garrett Cooper
Author: ngie
Date: Wed Jul  6 16:02:15 2016
New Revision: 302373
URL: https://svnweb.freebsd.org/changeset/base/302373

Log:
  Fix CTASSERT issue in a more clean way
  
  - Replace all CTASSERT macro instances with static_assert's.
  - Remove the WRAPPED_CTASSERT macro; it's now an unnecessary obfuscation.
  - Localize all static_assert's to the structures being tested.
  - Sort some headers per-style(9).
  
  Approved by: re (hrs)
  Differential Revision: https://reviews.freebsd.org/D7130
  MFC after: 1 week
  X-MFC with: r302364
  Reviewed by: ed, grehan (maintainer)
  Submitted by: ed
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.sbin/bhyve/bhyverun.h
  head/usr.sbin/bhyve/pci_emul.c
  head/usr.sbin/bhyve/pci_emul.h
  head/usr.sbin/bhyve/task_switch.c

Modified: head/usr.sbin/bhyve/bhyverun.h
==
--- head/usr.sbin/bhyve/bhyverun.h  Wed Jul  6 14:09:49 2016
(r302372)
+++ head/usr.sbin/bhyve/bhyverun.h  Wed Jul  6 16:02:15 2016
(r302373)
@@ -29,12 +29,6 @@
 #ifndef_FBSDRUN_H_
 #define_FBSDRUN_H_
 
-#ifndef CTASSERT   /* Allow lint to override */
-#defineCTASSERT(x) _CTASSERT(x, __LINE__)
-#define_CTASSERT(x, y) __CTASSERT(x, y)
-#define__CTASSERT(x, y)typedef char __assert ## y[(x) ? 1 : -1]
-#endif
-
 #defineVMEXIT_CONTINUE (0)
 #defineVMEXIT_ABORT(-1)
 

Modified: head/usr.sbin/bhyve/pci_emul.c
==
--- head/usr.sbin/bhyve/pci_emul.c  Wed Jul  6 14:09:49 2016
(r302372)
+++ head/usr.sbin/bhyve/pci_emul.c  Wed Jul  6 16:02:15 2016
(r302373)
@@ -31,9 +31,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -755,16 +755,6 @@ pci_emul_init(struct vmctx *ctx, struct 
return (err);
 }
 
-#ifdef __GNU_C__
-#defineWRAPPED_CTASSERT(x) CTASSERT(x) __unused
-#else
-#defineWRAPPED_CTASSERT(x) CTASSERT(x)
-#endif
-
-WRAPPED_CTASSERT(sizeof(struct msicap) == 14);
-WRAPPED_CTASSERT(sizeof(struct msixcap) == 12);
-WRAPPED_CTASSERT(sizeof(struct pciecap) == 60);
-
 void
 pci_populate_msicap(struct msicap *msicap, int msgnum, int nextptr)
 {

Modified: head/usr.sbin/bhyve/pci_emul.h
==
--- head/usr.sbin/bhyve/pci_emul.h  Wed Jul  6 14:09:49 2016
(r302372)
+++ head/usr.sbin/bhyve/pci_emul.h  Wed Jul  6 16:02:15 2016
(r302373)
@@ -160,6 +160,7 @@ struct msicap {
uint32_taddrhi;
uint16_tmsgdata;
 } __packed;
+static_assert(sizeof(struct msicap) == 14, "compile-time assertion failed");
 
 struct msixcap {
uint8_t capid;
@@ -168,6 +169,7 @@ struct msixcap {
uint32_ttable_info; /* bar index and offset within it */
uint32_tpba_info;   /* bar index and offset within it */
 } __packed;
+static_assert(sizeof(struct msixcap) == 12, "compile-time assertion failed");
 
 struct pciecap {
uint8_t capid;
@@ -202,6 +204,7 @@ struct pciecap {
uint16_tslot_control2;
uint16_tslot_status2;
 } __packed;
+static_assert(sizeof(struct pciecap) == 60, "compile-time assertion failed");
 
 typedef void (*pci_lintr_cb)(int b, int s, int pin, int pirq_pin,
 int ioapic_irq, void *arg);

Modified: head/usr.sbin/bhyve/task_switch.c
==
--- head/usr.sbin/bhyve/task_switch.c   Wed Jul  6 14:09:49 2016
(r302372)
+++ head/usr.sbin/bhyve/task_switch.c   Wed Jul  6 16:02:15 2016
(r302373)
@@ -37,11 +37,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
 #include 
 #include 
 #include 
-#include 
-#include 
 
 #include 
 
@@ -91,7 +91,7 @@ struct tss32 {
uint16_ttss_trap;
uint16_ttss_iomap;
 };
-CTASSERT(sizeof(struct tss32) == 104);
+static_assert(sizeof(struct tss32) == 104, "compile-time assertion failed");
 
 #defineSEL_START(sel)  (((sel) & ~0x7))
 #defineSEL_LIMIT(sel)  (((sel) | 0x7))
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302372 - in head/sys: amd64/include cddl/compat/opensolaris/sys dev/cpuctl i386/include kern net netinet powerpc/include powerpc/powerpc vm

2016-07-06 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Jul  6 14:09:49 2016
New Revision: 302372
URL: https://svnweb.freebsd.org/changeset/base/302372

Log:
  Replace a number of conflations of mp_ncpus and mp_maxid with either
  mp_maxid or CPU_FOREACH() as appropriate. This fixes a number of places in
  the kernel that assumed CPU IDs are dense in [0, mp_ncpus) and would try,
  for example, to run tasks on CPUs that did not exist or to allocate too
  few buffers on systems with sparse CPU IDs in which there are holes in the
  range and mp_maxid > mp_ncpus. Such circumstances generally occur on
  systems with SMT, but on which SMT is disabled. This patch restores system
  operation at least on POWER8 systems configured in this way.
  
  There are a number of other places in the kernel with potential problems
  in these situations, but where sparse CPU IDs are not currently known
  to occur, mostly in the ARM machine-dependent code. These will be fixed
  in a follow-up commit after the stable/11 branch.
  
  PR:   kern/210106
  Reviewed by:  jhb
  Approved by:  re (glebius)

Modified:
  head/sys/amd64/include/counter.h
  head/sys/cddl/compat/opensolaris/sys/proc.h
  head/sys/dev/cpuctl/cpuctl.c
  head/sys/i386/include/counter.h
  head/sys/kern/subr_pcpu.c
  head/sys/kern/subr_taskqueue.c
  head/sys/net/flowtable.c
  head/sys/net/iflib.c
  head/sys/netinet/ip_id.c
  head/sys/powerpc/include/counter.h
  head/sys/powerpc/powerpc/mp_machdep.c
  head/sys/vm/uma.h
  head/sys/vm/uma_core.c

Modified: head/sys/amd64/include/counter.h
==
--- head/sys/amd64/include/counter.hWed Jul  6 10:57:04 2016
(r302371)
+++ head/sys/amd64/include/counter.hWed Jul  6 14:09:49 2016
(r302372)
@@ -51,7 +51,7 @@ counter_u64_fetch_inline(uint64_t *p)
int i;
 
r = 0;
-   for (i = 0; i < mp_ncpus; i++)
+   CPU_FOREACH(i)
r += counter_u64_read_one((uint64_t *)p, i);
 
return (r);

Modified: head/sys/cddl/compat/opensolaris/sys/proc.h
==
--- head/sys/cddl/compat/opensolaris/sys/proc.h Wed Jul  6 10:57:04 2016
(r302371)
+++ head/sys/cddl/compat/opensolaris/sys/proc.h Wed Jul  6 14:09:49 2016
(r302372)
@@ -45,8 +45,8 @@
 #defineCPU curcpu
 #defineminclsyspri PRIBIO
 #definemaxclsyspri PVM
-#definemax_ncpus   mp_ncpus
-#defineboot_max_ncpus  mp_ncpus
+#definemax_ncpus   (mp_maxid + 1)
+#defineboot_max_ncpus  (mp_maxid + 1)
 
 #defineTS_RUN  0
 

Modified: head/sys/dev/cpuctl/cpuctl.c
==
--- head/sys/dev/cpuctl/cpuctl.cWed Jul  6 10:57:04 2016
(r302371)
+++ head/sys/dev/cpuctl/cpuctl.cWed Jul  6 14:09:49 2016
(r302372)
@@ -120,7 +120,7 @@ static void
 set_cpu(int cpu, struct thread *td)
 {
 
-   KASSERT(cpu >= 0 && cpu < mp_ncpus && cpu_enabled(cpu),
+   KASSERT(cpu >= 0 && cpu <= mp_maxid && cpu_enabled(cpu),
("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu));
thread_lock(td);
sched_bind(td, cpu);
@@ -133,7 +133,7 @@ static void
 restore_cpu(int oldcpu, int is_bound, struct thread *td)
 {
 
-   KASSERT(oldcpu >= 0 && oldcpu < mp_ncpus && cpu_enabled(oldcpu),
+   KASSERT(oldcpu >= 0 && oldcpu <= mp_maxid && cpu_enabled(oldcpu),
("[cpuctl,%d]: bad cpu number %d", __LINE__, oldcpu));
thread_lock(td);
if (is_bound == 0)
@@ -150,7 +150,7 @@ cpuctl_ioctl(struct cdev *dev, u_long cm
int ret;
int cpu = dev2unit(dev);
 
-   if (cpu >= mp_ncpus || !cpu_enabled(cpu)) {
+   if (cpu > mp_maxid || !cpu_enabled(cpu)) {
DPRINTF("[cpuctl,%d]: bad cpu number %d\n", __LINE__, cpu);
return (ENXIO);
}
@@ -201,7 +201,7 @@ cpuctl_do_cpuid_count(int cpu, cpuctl_cp
int is_bound = 0;
int oldcpu;
 
-   KASSERT(cpu >= 0 && cpu < mp_ncpus,
+   KASSERT(cpu >= 0 && cpu <= mp_maxid,
("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu));
 
/* Explicitly clear cpuid data to avoid returning stale info. */
@@ -245,7 +245,7 @@ cpuctl_do_msr(int cpu, cpuctl_msr_args_t
int oldcpu;
int ret;
 
-   KASSERT(cpu >= 0 && cpu < mp_ncpus,
+   KASSERT(cpu >= 0 && cpu <= mp_maxid,
("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu));
 
/*
@@ -296,7 +296,7 @@ cpuctl_do_update(int cpu, cpuctl_update_
char vendor[13];
int ret;
 
-   KASSERT(cpu >= 0 && cpu < mp_ncpus,
+   KASSERT(cpu >= 0 && cpu <= mp_maxid,
("[cpuctl,%d]: bad cpu number %d", __LINE__, cpu));
DPRINTF("[cpuctl,%d]: XXX %d", __LINE__, cpu);
 
@@ -512,7 +512,7 @@ cpuctl_open(struct cdev *dev, int flags,
int cpu;
 
cpu = dev2unit(dev);
-

svn commit: r302371 - head/sys/dev/usb/controller

2016-07-06 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Jul  6 10:57:04 2016
New Revision: 302371
URL: https://svnweb.freebsd.org/changeset/base/302371

Log:
  Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure
  "struct xhci_dev_ctx_addr" fits into a single 4K page until further.
  
  Approved by:  re (hrs)
  MFC after:1 week

Modified:
  head/sys/dev/usb/controller/xhci.h

Modified: head/sys/dev/usb/controller/xhci.h
==
--- head/sys/dev/usb/controller/xhci.h  Wed Jul  6 10:29:29 2016
(r302370)
+++ head/sys/dev/usb/controller/xhci.h  Wed Jul  6 10:57:04 2016
(r302371)
@@ -30,7 +30,7 @@
 
 #defineXHCI_MAX_DEVICESMIN(USB_MAX_DEVICES, 128)
 #defineXHCI_MAX_ENDPOINTS  32  /* hardcoded - do not change */
-#defineXHCI_MAX_SCRATCHPADS1024
+#defineXHCI_MAX_SCRATCHPADS256 /* theoretical max is 1023 */
 #defineXHCI_MAX_EVENTS (16 * 13)
 #defineXHCI_MAX_COMMANDS   (16 * 1)
 #defineXHCI_MAX_RSEG   1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r302370 - head/sys/contrib/ipfilter/netinet

2016-07-06 Thread Bjoern A. Zeeb
Author: bz
Date: Wed Jul  6 10:29:29 2016
New Revision: 302370
URL: https://svnweb.freebsd.org/changeset/base/302370

Log:
  Only set the ipfilter running state to 'not running' if we are
  doing the teardown.  ipf_destroy_all() may free ipfmain in case
  of ipf_dynamic_softc being true, thus we are avoiding a possible
  memory modified after free as well.
  
  Reported by:  Coverity
  Coverity CID: 1357320
  Approved by:  re (hrs)
  MFC after:10 days

Modified:
  head/sys/contrib/ipfilter/netinet/mlfk_ipl.c

Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c
==
--- head/sys/contrib/ipfilter/netinet/mlfk_ipl.cWed Jul  6 05:17:56 
2016(r302369)
+++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.cWed Jul  6 10:29:29 
2016(r302370)
@@ -291,13 +291,14 @@ vnet_ipf_uninit(void)
return;
 
if (V_ipfmain.ipf_running >= 0) {
+
if (ipfdetach(_ipfmain) != 0)
return;
 
+   V_ipfmain.ipf_running = -2;
+
ipf_destroy_all(_ipfmain);
}
-
-   V_ipfmain.ipf_running = -2;
 }
 VNET_SYSUNINIT(vnet_ipf_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD,
 vnet_ipf_uninit, NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"