]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
9 years agoMFC r279301: GNU nm: Avoid NULL dereference
emaste [Wed, 4 Mar 2015 01:10:09 +0000 (01:10 +0000)]
MFC r279301: GNU nm: Avoid NULL dereference

  bfd_dwarf2_find_line() calls find_line() with NULL functionname_ptr,
  which resulted in a crash on certain ELF objects.

  This change was implemented independently from upstream binutils, but
  I have checked that the crash does not happen there.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@279572 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278915:
loos [Tue, 3 Mar 2015 17:03:41 +0000 (17:03 +0000)]
MFC r278915:

Set the #address-cells and #size-cells properties on I2C controllers of
Raspberry-pi.

This fixes the issues on dtc(1) while compiling I2C addresses set with
"reg" property.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279565 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278844:
royger [Tue, 3 Mar 2015 10:11:58 +0000 (10:11 +0000)]
MFC r278844:

xen: fix xenstore dev

git-svn-id: svn://svn.freebsd.org/base/stable/10@279562 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279249, r279250, r279257:
gjb [Tue, 3 Mar 2015 02:46:59 +0000 (02:46 +0000)]
MFC r279249, r279250, r279257:

 r279249:
  Add 'cloudware-install' target to handle copying cloud
  disk images to a directory within DESTDIR.

  Add CLOUDINSTALL variable to automatically generate the
  actual list of install targets.  While here, rename the
  cloud-specific names from 'vm-' to 'cw-' to avoid naming
  collisions.

  Add AZURE_DISK, GCE_DISK, and OPENSTACK_DISK output file
  variables.

  Add 'cloudware-install' to the 'install' target.

 r279250:
  Remove a stale comment.

 r279257:
  Add a CLOUDPACKAGE variable to contain a list of targets for
  post-install packaging cloud provider images.

  Add a 'gce-package.sh' script to generate the final output
  image ready for upload to the GCE platform.  Right now, this
  is the only image that has a specific output format (GNU-tar),
  and this implementation is expected to be temporary.

  This is not directly connected to the other release targets.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@279558 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC rev. 278728:
thomas [Mon, 2 Mar 2015 23:17:17 +0000 (23:17 +0000)]
MFC rev. 278728:
(backup_kernel_finddir, backup_kernel, install_files):
Add missing references to $BASEDIR, in order to allow correct operation
when updating a system mounted at another location than / (e.g. when
updating an alternate Boot Environment).

Reviewed by:  cperciva

git-svn-id: svn://svn.freebsd.org/base/stable/10@279556 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279346:
ken [Mon, 2 Mar 2015 21:00:54 +0000 (21:00 +0000)]
MFC r279346:

  ------------------------------------------------------------------------
  r279346 | ken | 2015-02-26 19:44:12 -0700 (Thu, 26 Feb 2015) | 13 lines

  Remove an obsolete comment in devstat(3) about the accuracy of the
  milliseconds per transaction (DSM_MS_PER_TRANSACTION) calculation.

  The comment was accurate many years ago when the kernel didn't
  record I/O times on a per-I/O basis, but now that we do collect
  that information in most areas, it isn't correct.

  The milliseconds per transaction values are correct, assuming the
  I/O duration has been recorded.

  Sponsored by: Spectra Logic

  ------------------------------------------------------------------------

git-svn-id: svn://svn.freebsd.org/base/stable/10@279545 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279367:
kib [Mon, 2 Mar 2015 09:15:50 +0000 (09:15 +0000)]
MFC r279367:
Fix typo.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279206:
ae [Mon, 2 Mar 2015 07:51:14 +0000 (07:51 +0000)]
MFC r279206:
  In some cases soreceive_dgram() can return no data, but has control
  message. This can happen when application is sending packets too big
  for the path MTU and recvmsg() will return zero (indicating no data)
  but there will be a cmsghdr with cmsg_type set to IPV6_PATHMTU.
  Remove KASSERT() which does NULL pointer dereference in such case.
  Also call m_freem() only when m isn't NULL.

MFC r279209:
  soreceive_generic() still has similar KASSERT(), therefore instead of
  remove KASSERT(), change it to check mbuf isn't NULL.

PR: 197882
Sponsored by: Yandex LLC

git-svn-id: svn://svn.freebsd.org/base/stable/10@279516 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoRegen src.conf(5)
ngie [Sun, 1 Mar 2015 22:12:24 +0000 (22:12 +0000)]
Regen src.conf(5)

git-svn-id: svn://svn.freebsd.org/base/stable/10@279507 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278193:
ngie [Sun, 1 Mar 2015 22:07:54 +0000 (22:07 +0000)]
MFC r278193:

Add MK_FILE to control whether or not to build file(1), libmagic(3), etc

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@279506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278192:
ngie [Sun, 1 Mar 2015 22:03:52 +0000 (22:03 +0000)]
MFC r278192:

Add the following options to enable/disable several features in the base system

WITHOUT_BOOTPARAMD - bootparamd
WITHOUT_BOOTPD - bootpd
WITHOUT_FINGER - finger, fingerd
WITHOUT_FTP - ftp, ftpd
WITHOUT_INETD - inetd
WITHOUT_RBOOTD - rbootd
WITHOUT_TCP_WRAPPERS - tcpd, et al
WITHOUT_TFTP - tftp, tftp-server
WITHOUT_TIMED - timed

Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@279505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278704:
ngie [Sun, 1 Mar 2015 21:24:19 +0000 (21:24 +0000)]
MFC r278704:

Unbreak rcorder when MK_UNBOUND == no by moving local_unbound from REQUIRE:
in NETWORKING to BEFORE: in the script

git-svn-id: svn://svn.freebsd.org/base/stable/10@279499 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoUnbreak rcorUnbreak rcorder when MK_UTX == no by moving utx from REQUIRE: in LOGIN to
ngie [Sun, 1 Mar 2015 21:22:34 +0000 (21:22 +0000)]
Unbreak rcorUnbreak rcorder when MK_UTX == no by moving utx from REQUIRE: in LOGIN to
BEFORE: in utx

git-svn-id: svn://svn.freebsd.org/base/stable/10@279497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278891:
ngie [Sun, 1 Mar 2015 21:03:34 +0000 (21:03 +0000)]
MFC r278891:

Add the mnt_lockref field to the ddb(4) 'show mount' command

Differential Revision: https://reviews.freebsd.org/D1688
Submitted by: Conrad Meyer <conrad.meyer@isilon.com>
Sponsored by: EMC / Isilon Storage Division

git-svn-id: svn://svn.freebsd.org/base/stable/10@279495 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r276949:
kib [Sun, 1 Mar 2015 10:39:19 +0000 (10:39 +0000)]
MFC r276949:
(only to ease merging of r279117).

MFC r279117:
Revert r276949 and redo the fix for PCIe/PCI bridges, which do not
follow specification and do not provide PCIe capability.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279486 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r276948:
kib [Sun, 1 Mar 2015 10:35:54 +0000 (10:35 +0000)]
MFC r276948:
Print rid when announcing DMAR context creation.  Print sid when fault
occurs.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279485 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r276867:
kib [Sun, 1 Mar 2015 10:29:48 +0000 (10:29 +0000)]
MFC r276867:
Fix DMAR context allocations for the devices behind PCIe->PCI bridges
after dmar driver was converted to use rids.  The bus component to
calculate context page must be taken from the requestor rid, which is
a bridge, and not from the device bus number.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279484 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279276: Add checks for malloc() failures.
mav [Sun, 1 Mar 2015 09:29:59 +0000 (09:29 +0000)]
MFC r279276: Add checks for malloc() failures.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@279482 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279277: Fix memory leak on incorrect initiator portal.
mav [Sun, 1 Mar 2015 09:28:39 +0000 (09:28 +0000)]
MFC r279277: Fix memory leak on incorrect initiator portal.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@279481 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r277649:
rstone [Sun, 1 Mar 2015 04:39:07 +0000 (04:39 +0000)]
MFC r277649:

   vmspace_release() may sleep if the last reference is being released,
   so add a WITNESS_WARN() to catch cases where it is called with a
   non-sleepable lock held.

   MFC after:    1 month
   Sponsored by: Sandvine Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279474 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r272284
rstone [Sun, 1 Mar 2015 04:36:20 +0000 (04:36 +0000)]
MFC r272284

   Fix integer truncation in affecting systat -ifstat

   The "systat -ifstat" command was using a u_int to store byte counters.
   With a 10Gbps or faster interface, this overflows within the default
   5 second refresh period.  Switch to using a uint64_t across the board,
   which matches the size used for all counters as of r263102.

   PR:           182448
   MFC after:    1 week
   Sponsored by: Sandvine Inc

git-svn-id: svn://svn.freebsd.org/base/stable/10@279473 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r265107
rstone [Sun, 1 Mar 2015 04:28:30 +0000 (04:28 +0000)]
MFC r265107

   Be consistent with the whitespace in the rest of these files.

   X-MFC-With: r264007

git-svn-id: svn://svn.freebsd.org/base/stable/10@279472 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r264091
rstone [Sun, 1 Mar 2015 04:26:47 +0000 (04:26 +0000)]
MFC r264091

   Correct a PCI enumeration bug introduced in r264011

   Ensure that first_func is set to 0 on every iteration of the PCI slot
   enumeration loop after the first.  There is a continue statement that would
   cause first_func to stay at 1 any PCI device where slot 0 has no functions
   until we find a slot that does have a function.  This would cause us to
   not enumerate the first PCI function on the device.

   Credit to markj@ for spotting the bug.

   X-MFC-With: r264011

git-svn-id: svn://svn.freebsd.org/base/stable/10@279471 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r264007,r264008,r264009,r264011,r264012,r264013
rstone [Sun, 1 Mar 2015 04:22:06 +0000 (04:22 +0000)]
MFC r264007,r264008,r264009,r264011,r264012,r264013

MFC support for PCI Alternate RID Interpretation.  ARI is an optional PCIe
feature that allows PCI devices to present up to 256 functions on a bus.
This is effectively a prerequisite for PCI SR-IOV support.

r264007:
   Add a method to get the PCI RID for a device.

   Reviewed by:  kib
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264008:
   Re-implement the DMAR I/O MMU code in terms of PCI RIDs

   Under the hood the VT-d spec is really implemented in terms of
   PCI RIDs instead of bus/slot/function, even though the spec makes
   pains to convert back to bus/slot/function in examples.  However
   working with bus/slot/function is not correct when PCI ARI is
   in use, so convert to using RIDs in most cases.  bus/slot/function
   will only be used when reporting errors to a user.

   Reviewed by:  kib
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264009:
   Re-write bhyve's I/O MMU handling in terms of PCI RID.

   Reviewed by:  neel
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264011:
   Add support for PCIe ARI

   PCIe Alternate RID Interpretation (ARI) is an optional feature that
   allows devices to have up to 256 different functions.  It is
   implemented by always setting the PCI slot number to 0 and
   re-purposing the 5 bits used to encode the slot number to instead
   contain the function number.  Combined with the original 3 bits
   allocated for the function number, this allows for 256 functions.

   This is enabled by default, but it's expected to be a no-op on currently
   supported hardware.  It's a prerequisite for supporting PCI SR-IOV, and
   I want the ARI support to go in early to help shake out any bugs in it.
   ARI can be disabled by setting the tunable hw.pci.enable_ari=0.

   Reviewed by:  kib
   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264012:
   Print status of ARI capability in pciconf -c

   Teach pciconf how to print out the status (enabled/disabled) of the ARI
   capability on PCI Root Complexes and Downstream Ports.

   MFC after:    2 months
   Sponsored by: Sandvine Inc.

r264013:
   Add missing copyright date.

   MFC after:    2 months

git-svn-id: svn://svn.freebsd.org/base/stable/10@279470 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279312:
dim [Sun, 1 Mar 2015 01:08:14 +0000 (01:08 +0000)]
MFC r279312:

Fix a number of -Wcast-qual warnings under sys/arm.  No functional
change.

Submitted by: andrew

git-svn-id: svn://svn.freebsd.org/base/stable/10@279467 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279311:
dim [Sun, 1 Mar 2015 00:57:01 +0000 (00:57 +0000)]
MFC r279311:

In sys/arm/ti/am335x/am335x_rtc.c, fix a clang 3.6.0 warning about
am33x_rtc_softc::sc_irq_res (which is an array) never being NULL.

Submitted by: andrew

git-svn-id: svn://svn.freebsd.org/base/stable/10@279462 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279307:
dim [Sun, 1 Mar 2015 00:47:37 +0000 (00:47 +0000)]
MFC r279307:

Make libcxxrt's parsing of DWARF exception handling tables work on
architectures with strict alignment, by using memcpy() instead of
directly reading fields.

Reported by: Daisuke Aoyama <aoyama@peach.ne.jp>
Reviewed by: imp, bapt
Tested by: bapt
Differential Revision: https://reviews.freebsd.org/D1967

MFC r279310:

Since newer versions of compiler-rt require unwind.h, and we want to use
the copy in libcxxrt for it, fix the arm-specific header to define the
_Unwind_Action type.

Submitted by: andrew

git-svn-id: svn://svn.freebsd.org/base/stable/10@279456 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279233:
hselasky [Fri, 27 Feb 2015 12:20:03 +0000 (12:20 +0000)]
MFC r279233:
Ensure that the XHCI driver will refresh the control endpoint settings
when re-enumerating a FULL speed device. Else the wrong max packet
setting might be used when trying to re-enumerate a FULL speed device.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279083:
jamie [Fri, 27 Feb 2015 02:53:44 +0000 (02:53 +0000)]
MFC r279083:

  Fix the logic for skipping parameters (with -s) that have "jailsys"
  parents (such as host.hostname); these were being skipped all the time.
  That it went this long without anyone noticing is a sign that this feature
  isn't actually used by anyone, but it's there so it might as well work.

MFC r279123:

  Allow for parameters added with the JP_OPT flag to not exist.
  That's why the flag exists in the first place.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279348 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r279081:
jamie [Fri, 27 Feb 2015 02:50:01 +0000 (02:50 +0000)]
MFC r279081:

  Allow parameters listed on the command line to override the -v option,
  instead of crashing.

PR: 197701

git-svn-id: svn://svn.freebsd.org/base/stable/10@279347 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278964:
ken [Thu, 26 Feb 2015 20:46:16 +0000 (20:46 +0000)]
MFC r278964:

The __FreeBSD_version was changed to 1001510 to be appropriate for
stable/10.

I will followup with a commit to mpr(4) and mps(4) in head to reflect
the stable/10 __FreeBSD_version and merge the change back to stable/10.

  ------------------------------------------------------------------------
  r278964 | ken | 2015-02-18 11:30:19 -0700 (Wed, 18 Feb 2015) | 46 lines

  Make sure that the flags for the XPT_DEV_ADVINFO CCB are initialized
  properly.

  If there is garbage in the flags field, it can sometimes include a
  set CDAI_FLAG_STORE flag, which may cause either an error or
  perhaps result in overwriting the field that was intended to be
  read.

  sys/cam/cam_ccb.h:
   Add a new flag to the XPT_DEV_ADVINFO CCB, CDAI_FLAG_NONE,
   that callers can use to set the flags field when no store
   is desired.

  sys/cam/scsi/scsi_enc_ses.c:
   In ses_setphyspath_callback(), explicitly set the
   XPT_DEV_ADVINFO flags to CDAI_FLAG_NONE when fetching the
   physical path information.  Instead of ORing in the
   CDAI_FLAG_STORE flag when storing the physical path, set
   the flags field to CDAI_FLAG_STORE.

  sys/cam/scsi/scsi_sa.c:
   Set the XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE when
   fetching extended inquiry information.

  sys/cam/scsi/scsi_da.c:
   When storing extended READ CAPACITY information, set the
   XPT_DEV_ADVINFO flags field to CDAI_FLAG_STORE instead of
   ORing it into a field that isn't initialized.

  sys/dev/mpr/mpr_sas.c,
  sys/dev/mps/mps_sas.c:
   When fetching extended READ CAPACITY information, set the
   XPT_DEV_ADVINFO flags field to CDAI_FLAG_NONE instead of
   setting it to 0.

  sbin/camcontrol/camcontrol.c:
   When fetching a device ID, set the XPT_DEV_ADVINFO flags
   field to CDAI_FLAG_NONE instead of 0.

  sys/sys/param.h:
   Bump __FreeBSD_version to 1100061 for the new XPT_DEV_ADVINFO
   CCB flag, CDAI_FLAG_NONE.

  Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@279329 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278933:
rpaulo [Thu, 26 Feb 2015 19:56:48 +0000 (19:56 +0000)]
MFC r278933:
  Fix a typo in ipv6_down().

  Submitted by: Ashutosh Kumar AK0037447 at TechMahindra.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@279327 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoImplement the -fuse-ld= option.
emaste [Wed, 25 Feb 2015 22:32:32 +0000 (22:32 +0000)]
Implement the -fuse-ld= option.

Merge upstream Clang revision 211785:
  This commit implements the -fuse-ld= option, so that the user
  can specify -fuse-ld=bfd to use ld.bfd.

  This commit re-applies r194328 with some test case changes.
  It seems that r194328 was breaking macosx or mingw build
  because clang can't find ld.bfd or ld.gold in the given sysroot.
  We should use -B to specify the executable search path instead.

  Patch originally by David Chisnall.

This is a direct commit to stable/10 as this is change is already
included in Clang 3.5 in HEAD. The patch is also reworked slightly for
Clang 3.4.1.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@279302 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoAdd clang patches corresponding to r279289.
dim [Wed, 25 Feb 2015 17:54:18 +0000 (17:54 +0000)]
Add clang patches corresponding to r279289.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279290 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoPull in r199571 from upstream clang trunk (by Ted Kremenek):
dim [Wed, 25 Feb 2015 17:27:02 +0000 (17:27 +0000)]
Pull in r199571 from upstream clang trunk (by Ted Kremenek):

  Harden InitListExpr::isStringLiteralInit() against getInit()
  returning null.

  This led to a crash on invalid code (sorry, no good test case).

  Fixes <rdar://problem/15831804>.

This fixes an assertion when compiling certain incorrect code, as
reported upstream in http://llvm.org/PR22684 .

Direct commit to stable/10 and stable/9, since head has clang 3.5.1,
which already includes this change.

Reported by: hbowden@securelabsllc.com

git-svn-id: svn://svn.freebsd.org/base/stable/10@279289 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoBump __FreeBSD_version after FreeBSD-EN-15:01.vt,
gjb [Wed, 25 Feb 2015 16:44:40 +0000 (16:44 +0000)]
Bump __FreeBSD_version after FreeBSD-EN-15:01.vt,
FreeBSD-EN-15:02.openssl, FreeBSD-EN-15:03.freebsd-update,
FreeBSD-SA-15:04.igmp, FreeBSD-SA-15:05.bind

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@279287 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoDocument FreeBSD-EN-15:01.vt, FreeBSD-EN-15:02.openssl,
gjb [Wed, 25 Feb 2015 16:36:44 +0000 (16:36 +0000)]
Document FreeBSD-EN-15:01.vt, FreeBSD-EN-15:02.openssl,
FreeBSD-EN-15:03.freebsd-update, FreeBSD-SA-15:04.igmp,
FreeBSD-SA-15:05.bind

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@279285 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278850:
hselasky [Wed, 25 Feb 2015 12:24:24 +0000 (12:24 +0000)]
MFC r278850:
Handle VBUS error interrupts.

PR: 190471

git-svn-id: svn://svn.freebsd.org/base/stable/10@279279 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278584: Add support for General Statistics and Performance log page.
mav [Wed, 25 Feb 2015 09:21:04 +0000 (09:21 +0000)]
MFC r278584: Add support for General Statistics and Performance log page.

CTL already collects most of statistics reported there, so why not.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279273 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278963:
kib [Wed, 25 Feb 2015 09:19:26 +0000 (09:19 +0000)]
MFC r278963:
If malloc() sleeps, Giant is dropped.  Recheck for another thread
doing our work.

Remove unneeded check for failed M_WAITOK allocation.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279272 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278586:
tijl [Wed, 25 Feb 2015 08:39:48 +0000 (08:39 +0000)]
MFC r278586:

Fix ldscripts such that ld(1) collects the .fini_array section in the same
order as the .init_array section.  Finalisation routines need to be called
in the opposite order as their corresponding initialisation routines but
rtld(1) handles that by calling the function pointers in .fini_array in
reverse order.

Reviewed by: kib

git-svn-id: svn://svn.freebsd.org/base/stable/10@279271 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoInstant MFC:
delphij [Wed, 25 Feb 2015 05:43:02 +0000 (05:43 +0000)]
Instant MFC:

Fix integer overflow in IGMP protocol.

Security: FreeBSD-SA-15:04.igmp
Security: CVE-2015-1414
Found by: Mateusz Kocielski, Logicaltrust
Analyzed by: Marek Kroemeke, Mateusz Kocielski (shm@NetBSD.org) and
22733db72ab3ed94b5f8a1ffcde850251fe6f466
Submited by: Mariusz Zaborski <oshogbo@FreeBSD.org>
Reviewed by: bms
Approved by: so

git-svn-id: svn://svn.freebsd.org/base/stable/10@279263 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: r278870
marius [Tue, 24 Feb 2015 22:28:44 +0000 (22:28 +0000)]
MFC: r278870

Unbreak sparc64 after r276630 (MFCed to stable/10 in r277317) by calling
__sparc_sigtramp_setup signal trampoline as part of the MD __sys_sigaction
again.

Submitted by: kib (initial versions)

git-svn-id: svn://svn.freebsd.org/base/stable/10@279258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC part of r273865: fix boot1.efi for block size != 512
emaste [Tue, 24 Feb 2015 22:11:07 +0000 (22:11 +0000)]
MFC part of r273865: fix boot1.efi for block size != 512

r273865 is part of the work for supporting 4Kn drives, but it turns out
the underlying bug can actually cause corruption of the UEFI system
table in any case where block size is not 512.

Relevant portion of the original commit message:

  convert boot1.efi to corrrectly calculate the lba for what the
  media reports and convert the size based on what FreeBSD uses.
  existing code would use the 512 byte lba and convert the
  using 4K byte size.

PR: 197881
Reviewed by: Chris Ruffin

git-svn-id: svn://svn.freebsd.org/base/stable/10@279254 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278523:
kib [Tue, 24 Feb 2015 01:46:43 +0000 (01:46 +0000)]
MFC r278523:
In mountd, silence a race with the parallel unmount.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279224 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC 275412:
jhb [Mon, 23 Feb 2015 21:16:02 +0000 (21:16 +0000)]
MFC 275412:
The runtime linker needs to include a path to itself in the link map
it exports to the debugger.  It currently has two choices: it can use
a compiled-in path (/libexec/ld-elf.so.1) or it can use the path stored
in the interpreter path in the binary being executed.  The runtime linker
currently prefers the second.  However, this is usually wrong for compat32
binaries since the binary specifies the path of rtld on a 32-bit system
(/libexec/ld-elf.so.1) instead of the actual path (/libexec/ld-elf32.so.1).
For now, always assume the compiled in path (/libexec/ld-elf32.so.1) as
the rtld path and ignore the path in the binary for the 32-bit runtime
linker.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279218 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC 274817,274878,276801,276840,278976:
jhb [Mon, 23 Feb 2015 18:38:41 +0000 (18:38 +0000)]
MFC 274817,274878,276801,276840,278976:
Improve support for XSAVE with debuggers.
- Dump an NT_X86_XSTATE note if XSAVE is in use. This note is designed
  to match what Linux does in that 1) it dumps the entire XSAVE area
  including the fxsave state, and 2) it stashes a copy of the current
  xsave mask in the unused padding between the fxsave state and the
  xstate header at the same location used by Linux.
- Teach readelf() to recognize NT_X86_XSTATE notes.
- Change PT_GET/SETXSTATE to take the entire XSAVE state instead of
  only the extra portion. This avoids having to always make two
  ptrace() calls to get or set the full XSAVE state.
- Add a PT_GET_XSTATE_INFO which returns the length of the current
  XSTATE save area (so the size of the buffer needed for PT_GETXSTATE)
  and the current XSAVE mask (%xcr0).

git-svn-id: svn://svn.freebsd.org/base/stable/10@279211 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278857:
pluknet [Mon, 23 Feb 2015 08:45:42 +0000 (08:45 +0000)]
MFC r278857:
   kdump: sendfile(2) "flags" argument needs casting on 64-bit platforms.

Sponsored by: Nginx, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279201 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278983:
markj [Mon, 23 Feb 2015 01:24:10 +0000 (01:24 +0000)]
MFC r278983:
Free the zlib stream once the CTF section is decompressed.

MFC r278984:
Remove unnecessary checks for a NULL return value from malloc.

MFC r279089:
Let vn_rdwr() check for short reads.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279196 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278871:
kib [Mon, 23 Feb 2015 01:17:45 +0000 (01:17 +0000)]
MFC r278871:
Array cannot be NULL, remove always true comparision.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279195 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278840:
kevlo [Sun, 22 Feb 2015 15:30:08 +0000 (15:30 +0000)]
MFC r278840:
Xref the following in wlan(4):

- rsu(4)
- urtwn(4)

git-svn-id: svn://svn.freebsd.org/base/stable/10@279159 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r277481:
kevlo [Sun, 22 Feb 2015 15:28:49 +0000 (15:28 +0000)]
MFC r277481:
Typo: ivalid -> invalid.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279158 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278551:
kevlo [Sun, 22 Feb 2015 15:27:02 +0000 (15:27 +0000)]
MFC r278551:
Add preliminary support for the Ralink RT5390 and RT5392 chipsets.
Committed over the D-Link DWA-525 rev A2 on amd64 with WPA.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279157 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278790, r278802:
pfg [Sun, 22 Feb 2015 02:14:49 +0000 (02:14 +0000)]
MFC r278790, r278802:
Initialize the allocation of variables related to the ext2 allocator.

Use malloc to clear the values and initialize e2fs_contigdirs
during allocation.  free() e2fs_contigdirs upon error.

While here clean up small style issues.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279133 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278791:
pfg [Sun, 22 Feb 2015 01:42:45 +0000 (01:42 +0000)]
MFC r278791:
Reuse value of cursize instead of recalculating.

Reported by: Clang static checker

git-svn-id: svn://svn.freebsd.org/base/stable/10@279131 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278803, r278905:
pfg [Sun, 22 Feb 2015 01:31:28 +0000 (01:31 +0000)]
MFC r278803, r278905:
ulimit(3): Fix broken check.

The existing implementation had a broken comparison that could
overflow and return confusing values.  Replace this with a check
that avoids the overflow before it happens.

Consistently return a maximum value also on the case of negative
arguments since negative is considered an overflow and means
infinity for our current setrlimit().

New revamped version is credited to Bruce Evans.

CID: 1199295

git-svn-id: svn://svn.freebsd.org/base/stable/10@279129 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoUpdate commented last revision.
gjb [Fri, 20 Feb 2015 20:33:43 +0000 (20:33 +0000)]
Update commented last revision.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@279088 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoAdd 'Generic Storage' section.
gjb [Fri, 20 Feb 2015 20:30:04 +0000 (20:30 +0000)]
Add 'Generic Storage' section.

Document r279002, r279055:
 ctld(8) update to control non-iSCSI CTL ports
 CTL LUN mapping rewrite

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@279087 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoDocument r277583, arc_meta_limit exposed via kstats.
gjb [Fri, 20 Feb 2015 20:30:01 +0000 (20:30 +0000)]
Document r277583, arc_meta_limit exposed via kstats.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@279086 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoDocument r277434, fstyp(8) addition.
gjb [Fri, 20 Feb 2015 20:29:59 +0000 (20:29 +0000)]
Document r277434, fstyp(8) addition.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@279085 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278658:
rpaulo [Fri, 20 Feb 2015 20:02:47 +0000 (20:02 +0000)]
MFC r278658:

  Teach libproc how to find debugging symbols in /usr/lib/debug.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279082 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoDocument r278982, pmc callchain depths increased.
gjb [Fri, 20 Feb 2015 18:06:33 +0000 (18:06 +0000)]
Document r278982, pmc callchain depths increased.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@279070 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278594: Add missing asprintf() status checks.
mav [Fri, 20 Feb 2015 17:10:46 +0000 (17:10 +0000)]
MFC r278594: Add missing asprintf() status checks.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279056 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278354: Teach ctld(8) to control non-iSCSI CTL ports.
mav [Fri, 20 Feb 2015 17:09:49 +0000 (17:09 +0000)]
MFC r278354: Teach ctld(8) to control non-iSCSI CTL ports.

This change introduces new target option "port", that assigns current target
to specified CTL port.  On config application ctld(8) will apply LUN mapping
according to target configuration to specified port and bring the port up.
On shutdown cltd(8) will remove the mapping and put the port down.

This change allows to configure both iSCSI and FibreChannel targets in the
same configuration file in alike way.

Kernel side support was added earlier at r278037.

Relnotes: yes
Sponsored by: iXsystems, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279055 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278311: Some NetGraph debug polishing.
mav [Fri, 20 Feb 2015 11:52:46 +0000 (11:52 +0000)]
MFC r278311: Some NetGraph debug polishing.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@279052 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278889:
kib [Fri, 20 Feb 2015 09:25:13 +0000 (09:25 +0000)]
MFC r278889:
Restore the extern qualifier on __cleanup.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279049 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278856:
hselasky [Thu, 19 Feb 2015 17:42:12 +0000 (17:42 +0000)]
MFC r278856:
The "frag_info" pointer is already pointing to an array index.
Don't index twice.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@279014 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278301, r278315:
pfg [Thu, 19 Feb 2015 16:24:27 +0000 (16:24 +0000)]
MFC r278301, r278315:
tdelete(3): don't delete the node we are about to return.

CID: 272528
Obtained from: NetBSD (CVS rev. 1.4)

git-svn-id: svn://svn.freebsd.org/base/stable/10@279010 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278300, r278314:
pfg [Thu, 19 Feb 2015 16:17:44 +0000 (16:17 +0000)]
MFC r278300, r278314:
getdiskbyname(): plug resource leak

Variable cq going out of scope leaks the storage it points to.

CID: 270511
Phabric: D1775
Reviewed by: imp
Obtained from: NetBSD (CVS rev. 1.34)

git-svn-id: svn://svn.freebsd.org/base/stable/10@279008 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278322: Add support for multiple portal groups per target.
mav [Thu, 19 Feb 2015 14:52:01 +0000 (14:52 +0000)]
MFC r278322: Add support for multiple portal groups per target.

This change allows multiple "portal-group" options to be specified per
target.  Each of them may include new optional auth-group name parameter
to override per-target auth parameters for specific portal group.

Kernel side support was added earlier at r278161.

Sponsored by: iXsystems, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279006 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278672: Teach CTL to ask GEOM devices about BIO_DELETE support.
mav [Thu, 19 Feb 2015 14:40:50 +0000 (14:40 +0000)]
MFC r278672: Teach CTL to ask GEOM devices about BIO_DELETE support.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279005 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278625: Make XCOPY and WUT commands respect physical block size/offset.
mav [Thu, 19 Feb 2015 14:36:03 +0000 (14:36 +0000)]
MFC r278625: Make XCOPY and WUT commands respect physical block size/offset.

This change by 2-3 times improves performance of misaligned XCOPY and WUT
commands by avoiding unneeded read-modify-write cycles inside ZFS.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279004 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278161: Bring some more order into iSCSI portal group tags support.
mav [Thu, 19 Feb 2015 14:33:46 +0000 (14:33 +0000)]
MFC r278161: Bring some more order into iSCSI portal group tags support.

While ctld(8) still does not allow multiple portal groups per target
to be configured, kernel should now be able to handle it.

Sponsored by: iXsystems, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279003 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278037: CTL LUN mapping rewrite.
mav [Thu, 19 Feb 2015 14:31:16 +0000 (14:31 +0000)]
MFC r278037: CTL LUN mapping rewrite.

Replace iSCSI-specific LUN mapping mechanism with new one, working for any
ports.  By default all ports are created without LUN mapping, exposing all
CTL LUNs as before.  But, if needed, LUN mapping can be manually set on
per-port basis via ctladm.  For its iSCSI ports ctld does it via ioctl(2).
The next step will be to teach ctld to work with FibreChannel ports also.

Respecting additional flexibility of the new mechanism, ctl.conf now allows
alternative syntax for LUN definition.  LUNs can now be defined in global
context, and then referenced from targets by unique name, as needed.  It
allows same LUN to be exposed several times via multiple targets.

While there, increase limit for LUNs per target in ctld from 256 to 1024.
Some initiators do not support LUNs above 255, but that is not our problem.

Relnotes: yes
Sponsored by: iXsystems, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279002 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r274853:
mav [Thu, 19 Feb 2015 14:28:47 +0000 (14:28 +0000)]
MFC r274853:
For both iSCSI initiator and target increase socket buffer sizes before
establishing connection.

This is a workaround for Chelsio TOE driver, that does not update socket
buffer size in hardware after connection established, and unless that is
done beforehand, kernel code will stuck, attempting to send/receive full
PDU at once.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279001 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r274804:
mav [Thu, 19 Feb 2015 14:26:49 +0000 (14:26 +0000)]
MFC r274804:
In conf_apply() remove iSCSI ports from kernel before removing LUNs.

Previous order confused initiators with messages about "removed" LUNs
during simple ctld restart without any real config change.  After this
commit initiators only reestablish lost connection, receive "Power on
occurred" UNIT ATTENTION status and continue normal operation.

git-svn-id: svn://svn.freebsd.org/base/stable/10@279000 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278619: Make WRITE SAME commands respect physical block size.
mav [Thu, 19 Feb 2015 13:06:38 +0000 (13:06 +0000)]
MFC r278619: Make WRITE SAME commands respect physical block size.

This change by 2-3 times improves performance of misaligned WRITE SAME
commands by avoiding unneeded read-modify-write cycles inside ZFS.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278999 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278627:
kib [Thu, 19 Feb 2015 09:30:42 +0000 (09:30 +0000)]
MFC r278627:
Update libthr(3) man page to reflect the work done to support dlopen.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278990 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r277458, r277536, r277606, r277609, r277836, r277839,
gjb [Thu, 19 Feb 2015 03:57:47 +0000 (03:57 +0000)]
MFC r277458, r277536, r277606, r277609, r277836, r277839,
r278118, r278119, r278206, r278502:

 r277458:
  Move virtual machine / cloud provider targets and
  options from release/Makefile to their own Makefile.

  Add glue to allow enabling building cloud provider VM images
  by default.

  Add a 'vm-cloudware' target, used to drive all targets in
  CLOUDTARGETS.

  Add examples for WITH_CLOUDWARE to release.conf.sample.
  Add WITH_CLOUDWARE evaluation to RELEASE_RMAKEFLAGS.

  Rewrite to consolidate VM image build scripts into one.

  Fix duplicated mkimg(1) call in vm_create_disk().

  Add primitive (untested) PowerPC/PowerPC64 VM image support.

  Note: As it is currently written, the /boot/pmbr and
  /boot/{gptboot,boot1.hfs} use the build host and not the
  target build.  Fixing this is likely going to be a hack in
  itself.

  mount(8) and umount(8) devfs(5) as needed.

  Change path for mk-vmimage.sh from ${TARGET}/ to scripts/ now that
  it is consolidated into one file.

  Fix paths for the base image and output disk image files.

  Set the boot partition type to 'apple-boot' for powerpc.

  In vm_install_base(), copy the host resolv.conf into the build
  chroot before attempting to do anything that requires working DNS
  (i.e., pkg bootstrap).

  In vm_extra_pre_umount(), remove the resolv.conf before the disk
  image is unmounted from the backing md(4).

  Silence errors when umounting the chroot's /dev, since it probably
  doesn't exist when we're running this.

  Unmount filesystems before attempting to destroy the md which
  holds them.

  Unmount filesystem and destroy md before we read the vnode from
  disk and package it into a disk image.  Otherwise we end up
  packaging an unclean filesystem.

  Merge duplicative vm-CLOUDTYPE targets before additional duplication
  gets added by the impending arrival of ec2 and gcloud.

  Add NOSWAP option which can be set by a vmimage.conf file to specify
  that no swap space should be created in the image.  This will be used
  by EC2 builds, since FreeBSD/EC2 allocates swap space on "ephemeral"
  disks which are physically attached to the Xen host node.

  In vm_extra_install_packages(), only bootstrap pkg(8) if
  VM_EXTRA_PACKAGES is empty.

  In vm_extra_pre_umount(), cleanup downloaded packages if pkg(8) was
  bootstrapped earlier.

  In vm_extra_install_base(), do not install waagent in the openstack
  image, because it is not used.  This appears to be a copy mistake.

  Remove vm_extra_install_base() from the openstack.conf entirely,
  since it does not need to be overridden.

  Enable password-less sudo for openstack images.

  Update the VM_EXTRA_PACKAGES list for the openstack images.

  Remove vm_extra_install_base() for the Azure image, now that the
  waagent exists in the ports tree.

  Add sysutils/azure-agent to the VM_EXTRA_PACKAGES list.

  In vm_extra_pre_umount(), remove the explicit pkg(8) install
  list, as dependencies are resolved by sysutils/azure-agent.

  Add a 'list-cloudware' target to print the list of supported CLOUDWARE
  values and a description.

  Add the AZURE_DESC and OPENSTACK_DESC descriptions.

  Update release(7)

  Add 'list-vmtargets' target, which produces a list of all supported
  VM and cloud provider images.

  Add VHD_DESC, VMDK_DESC, QCOW2_DESC, RAW_DESC image descriptions.

  Update release(7) to document the list-vmtargets target.

  Add initial support for the GCE (Google Compute Engine) cloud hosting
  provider image.

  Remove the console setting from rc.conf(5), which is not used there.
  While here, set console to include vidconsole in the loader.conf(5).

  Remove the pkg-clean(8) call from vm_extra_pre_umount() since the
  function is often overridden.

  Add vm_extra_pkg_rmcache() to call pkg-clean(8) to avoid duplicated
  code.

  Move resolv.conf(5) removal back to vm_extra_pre_umount() where it
  belongs.

  The GCE image needs resolv.conf(5) to exist (created as part of the
  image setup), so it cannot be removed.

  Comment the line that configures ttys(5) to 'off', which makes it
  impossible to test that the image boots.

  Add a note explaining why the line is commented, and not (yet) removed
  entirely.

  Move the 'install' bits that are specific to virtual machine images
  from the Makefile to Makefile.vm.

  Rename the 'install' target to 'release-install', and add a new
  'vm-install' target.

  Add a new 'install' target that invokes the new targets.

  Add WITH_CLOUDWARE to the list of make(1) variables for the release
  build.

  Remove hw.vga.textmode=1 from the VM image loader.conf, which was
  included during test builds and not intended to be included when
  merging this project branch back to head.

  Remove mk-azure.sh, which is no longer needed.

 r277536:
  Rename the 'release' target to 'real-release', and add two targets,
  'vm-release' and 'cloudware-release', that are invoked if
  WITH_VMIMAGES and WITH_CLOUDWARE are not empty.

  This fixes an issue where 'make release' would not build the cloud
  provider targets because CLOUDWARE was not yet set.

  Move the WITH_VMIMAGES and WITH_CLOUDWARE targets to Makefile.vm.

  Note: There is no 'cloudware-install' target yet, since some of the
  disk image names may need to be specific to the provider, so this is
  probably best handled by the build scripts.

 r277606:
  Provide a recipe of "true" for building the "release" target once
  its prerequisites are satisfied, in order to avoid having an implicit
  rule triggered by the presence of release.sh.

 r277609:
  When iterating through VMFORMATS, the VMBASE file is not removed
  or truncated to a zero-size file, which if used to create more
  than one disk image format, can result in accidental pollution of
  the target formatted disk image.

  Instead of using a single VMBASE image (vm.img, by default), use
  a single base file for each format, named as VMFORMAT.img, which
  produces VMBASE.VMFORMAT as the final formatted image.

 r277836:
  Rename the 'system' target to 'disc1', which is specific to the
  disc1.iso installer image.

  Replace 'system' with 'release' in CLEANFILES, and add 'disc1'
  to CLEANDIRS.

  Ensure the 'dvd' target depends on 'packagesystem'.

  Fix 'mini-memstick.img' prerequisite, which should be the 'bootonly'
  target, not 'disc1' (previously 'system').

  Use .TARGET as the target installation directory for the disc1.iso
  and bootonly.iso images, which now expand to 'disc1' and 'bootonly'
  respectively, mimicking the behavior of the 'dvd' target.

  Remove '@true' from the 'release' target, and instead use
  'touch ${.TARGET}' to prevent multiple iterations of
  'make release' from clobbering previously-built installer
  medium.

 r277839:
  Update release(7) to reflect renaming the 'system' target to 'disc1'.

 r278118:
  Move service_enable="YES" rc.conf(5) additions to VM_RC_LIST and
  deduplicate.

  Evaluate if firstboot_freebsd_update should be enabled based on
  UNAME_r, because it is not supported for the -CURRENT or -STABLE
  branches.

 r278119:
  Use ifconfig_DEFAULT="" instead of hard-coding vtnet(4)

 r278206:
  Bump copyright after r277458.

 r278502:
  In scripts/mk-vmimage.sh, prevent incorrect usage() by defaulting
  VMCONFIG to /dev/null, and additionally ensuring VMCONFIG is not
  a character device before it is sourced.

  While here, be sure to exit if usage() is called.

  This should effectively be no-op, but the usage() output was
  discovered while investigating a larger issue.

* Several changes local to stable/10 were needed in order to handle
  UEFI images that are specific to this branch.

Tested with: stable/10@r278906
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@278985 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r275140: Increase default and maximum callchain depths
emaste [Thu, 19 Feb 2015 02:56:34 +0000 (02:56 +0000)]
MFC r275140: Increase default and maximum callchain depths

Bump the default from 16 to 32, to accommodate kernel flamegraphs.
Bump the maximum from 32 to 128, to accommodate deep user stacks.

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@278982 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC 278228:
ken [Wed, 18 Feb 2015 23:08:13 +0000 (23:08 +0000)]
MFC 278228:

The __FreeBSD_version has been changed to 1001508 for the addition of the
CDAI_TYPE_EXT_INQ request type.

  ------------------------------------------------------------------------
  r278228 | ken | 2015-02-04 17:12:21 -0700 (Wed, 04 Feb 2015) | 32 lines

  Add support for probing the SCSI VPD Extended Inquiry page (0x86).

  This VPD page is effectively an extension of the standard Inquiry
  data page, and includes lots of additional bits.

  This commit includes support for probing the page in the SCSI probe code,
  and an additional request type for the XPT_DEV_ADVINFO CCB.  CTL already
  supports the Extended Inquiry page.

  Support for querying this page in the sa(4) driver will come later.

  sys/cam/scsi/scsi_xpt.c:
   Probe the Extended Inquiry page, if the device supports it, and
   return it in response to a XPT_DEV_ADVINFO CCB if it is requested.

  sys/cam/scsi/cam_ccb.h:
   Define a new advanced information CCB data type, CDAI_TYPE_EXT_INQ.

  sys/cam/cam_xpt.c:
   Free the extended inquiry data in a device when the device goes
   away.

  sys/cam/cam_xpt_internal.h:
   Add an extended inquiry data pointer and length to struct cam_ed.

  sys/sys/param.h
   Bump __FreeBSD_version for the addition of the new
   CDAI_TYPE_EXT_INQ advanced information type.

  Sponsored by: Spectra Logic
  MFC after: 1 week

  ------------------------------------------------------------------------

Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/10@278974 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r276893: mkimg: Add MBR EFI partition type
emaste [Wed, 18 Feb 2015 19:42:37 +0000 (19:42 +0000)]
MFC r276893: mkimg: Add MBR EFI partition type

Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@278968 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278827
sbruno [Wed, 18 Feb 2015 16:28:55 +0000 (16:28 +0000)]
MFC r278827

Check for required arguments before accessing argv[0] and core dumping.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278961 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278795:
kib [Wed, 18 Feb 2015 08:10:13 +0000 (08:10 +0000)]
MFC r278795:
Reparenting done by debugger attach can leave reaper without direct
children.  Handle the situation instead asserting that it is
impossible.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278949 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278794:
kib [Wed, 18 Feb 2015 08:08:09 +0000 (08:08 +0000)]
MFC r278794:
Return with the process locked.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278948 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278606:
kib [Wed, 18 Feb 2015 08:06:36 +0000 (08:06 +0000)]
MFC r278606:
Registers definitions for the new capabilities.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278947 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278605:
kib [Wed, 18 Feb 2015 08:04:03 +0000 (08:04 +0000)]
MFC r278605:
vm_page_lookup() accepts read-locked object.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278946 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278739:
delphij [Tue, 17 Feb 2015 19:14:16 +0000 (19:14 +0000)]
MFC r278739:

Disallow pattern spaces which would cause intermediate calculations to
overflow size_t.

Obtained from: DragonFly (2841837793bd095a82f477e9c370cfe6cfb3862c dillon)
Security: CERT VU#695940

git-svn-id: svn://svn.freebsd.org/base/stable/10@278910 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278500: Do not abort already aborted tasks.
mav [Tue, 17 Feb 2015 17:34:45 +0000 (17:34 +0000)]
MFC r278500: Do not abort already aborted tasks.

This fixes abort of new tasks with the same tags as previously aborted,
but still remaining on the queue.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278906 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278751:
kib [Tue, 17 Feb 2015 01:03:06 +0000 (01:03 +0000)]
MFC r278751:
Properly interpose libc spinlocks, was missed in r276630.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278875 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278321
scottl [Mon, 16 Feb 2015 22:33:44 +0000 (22:33 +0000)]
MFC r278321

Use direct hardware access for internal requests for KCS and SMIC.  In
particular, updates to the watchdog should no longer sleep.
- Add a new IPMI_IO_LOCK for low-level I/O access.  Use this for
  kcs_polled_request() and smic_polled_request().
- Add a new backend callback "ipmi_driver_request" to handle a driver
  request.  The new callback performs the request sychronously for KCS
  and SMIC.  SSIF still defers the work to the worker thread since the
  worker thread sleeps during request processing anyway.
- Allocate driver requests on the stack rather than using malloc().

Submitted by: jhb

git-svn-id: svn://svn.freebsd.org/base/stable/10@278872 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278379:
dchagin [Mon, 16 Feb 2015 20:58:20 +0000 (20:58 +0000)]
MFC r278379:

Add Neoway WM620 module ID.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278863 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoClamp too large hwpmc callchaindepth to maximum
emaste [Sun, 15 Feb 2015 20:55:26 +0000 (20:55 +0000)]
Clamp too large hwpmc callchaindepth to maximum

If the depth requested by the user is too large, it's better to provide
the maximum than the smaller default.

MFC of: r274766
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@278813 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: r266990 (missed in r265946)
marius [Sun, 15 Feb 2015 20:53:50 +0000 (20:53 +0000)]
MFC: r266990 (missed in r265946)

Fix build UDP-Lite with VIMAGE enabled when building with gcc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278812 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC: r278532
marius [Sun, 15 Feb 2015 20:02:29 +0000 (20:02 +0000)]
MFC: r278532

Fix compilation with GCC in the PAE case.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278808 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC of r278472
rrs [Sun, 15 Feb 2015 13:57:44 +0000 (13:57 +0000)]
MFC of r278472
This fixes a bug in the way that the LLE timers for nd6
and arp were being used. They basically would pass in the
mutex to the callout_init. Because they used this method
to the callout system, it was possible to "stop" the callout.
When flushing the table and you stopped the running callout, the
callout_stop code would return 1 indicating that it was going
to stop the callout (that was about to run on the callout_wheel blocked
by the function calling the stop). Now when 1 was returned, it would
lower the reference count one extra time for the stopped timer, then
a few lines later delete the memory. Of course the callout_wheel was
stuck in the lock code and would then crash since it was accessing
freed memory. By using callout_init(c, 1) we always get a 0 back
and the reference counting bug does not rear its head. We do have
to make a few adjustments to the callouts themselves though to make
sure it does the proper thing if rescheduled as well as gets the lock.

Sponsored by: Netflix Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278801 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC of r278469, r278623
rrs [Sun, 15 Feb 2015 13:24:32 +0000 (13:24 +0000)]
MFC of r278469, r278623

278469:
This fixes two conditions that can incur when migration
is being done in the callout code and harmonizes the macro
use.:
1) The callout_active() will lie. Basically if a migration
   is occuring and the callout is about to expire and the
   migration has been deferred, the callout_active will no
   longer return true until after the migration. This confuses
   and breaks callers that are doing callout_init(&c, 1); such
   as TCP.
2) The migration code had a bug in it where when migrating, if
   a two calls to callout_reset came in and they both collided with
   the callout on the wheel about to run, then the second call to
   callout_reset would corrupt the list the callout wheel uses
   putting the callout thread into a endless loop.
3) Per imp, I have fixed all the macro occurance in the code that
   were for the most part being ignored.

278623:

This fixes a bug I in-advertantly inserted when I updated the callout
code in my last commit. The cc_exec_next is used to track the next
when a direct call is being made from callout. It is *never* used
in the in-direct method. When macro-izing I made it so that it
would separate out direct/vs/non-direct. This is incorrect and can
cause panics as Peter Holm has found for me (Thanks so much Peter for
all your help in this). What this change does is restore that behavior
but also get rid of the cc_next from the array and instead make it
be part of the base callout structure. This way no one else will get
confused since we will never use it for non-direct.

Sponsored by: Netflix Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278800 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r277917 (by ken), r278598:
mav [Sun, 15 Feb 2015 08:52:09 +0000 (08:52 +0000)]
MFC r277917 (by ken), r278598:
Improve SCSI Extended Inquiry VPD page (0x86) support.

sys/cam/scsi/scsi_all.h:
        In struct scsi_extended_inquiry_data:
        - Increase the length field to 2 bytes, as it is 2 bytes in SPC-4.
        - Add bit definitions for the various Activiate Microcode actions.
        - Add the Sequential Access Logical Block Protection support bit,
          since we need that in the sa(4) driver.  (For modifications
          that will come later.)
        - Add definitions for the various Multi I_T Nexus Microcode
          Download modes.

sys/cam/ctl/ctl.c:
        As of SPC-4, a single report of "REPORTED LUNS DATA HAS CHANGED"
        is to be given per I_T nexus.  Once it is reported, the unit
        attention condition should be cleared for all LUNS attached to
        an I_T nexus.

        Previously that only happened when a REPORT LUNS command was
        processed.

        This behavior may be different (according to SAM-5) when the
        UA_INTLCK_CTRL bits are non-zero in the control mode page but
        CTL does not currently support that.

        So, in view of the spec, whenever we report a LUN inventory
        change unit attention, clear it on all LUNs for that
        particular I_T nexus.

        Add a new function, ctl_clear_ua() that will clear a unit
        attention on all LUNs for the given I_T nexus.

        One field in the extended inquiry data that we could potentially
        report at some point is the maximum supported sense data length.
        To do that, we would the SIM to report (via path inquiry
        perhaps) how much sense data it is able to send.

        Add comments to explain some of the bits that are set in the
        Extended Inquiry VPD page.

        Add a few comments to make it more clear which functions handle
        various VPD pages.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278796 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r278621: Fix man page to match real option names.
mav [Sun, 15 Feb 2015 08:38:43 +0000 (08:38 +0000)]
MFC r278621: Fix man page to match real option names.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278793 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoAdd clang patches corresponding to r278788.
dim [Sat, 14 Feb 2015 23:28:09 +0000 (23:28 +0000)]
Add clang patches corresponding to r278788.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278789 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f