]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
8 years agoMFC r287012:
jamie [Sat, 29 Aug 2015 02:41:59 +0000 (02:41 +0000)]
MFC r287012:

  Make pkill/pgrep -j ARG take jname, not just jid.

PR: 201588
Submitted by: Daniel Shahaf <danielsh at apache.org>

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

8 years agoMFC: r286790
rmacklem [Fri, 28 Aug 2015 22:42:37 +0000 (22:42 +0000)]
MFC: r286790
For the case where an NFSv4.1 ExchangeID operation has the client identifier
that already has a confirmed ClientID, the nfsrv_setclient() function would
not fill in the clientidp being returned. As such, the value of ClientID
returned would be whatever garbage was on the stack.
This patch fixes the problem by filling in these fields.

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

8 years agoMFC r286344: find: Fix segfault with very long path in -exec/-ok ... {} \;.
jilles [Fri, 28 Aug 2015 20:53:08 +0000 (20:53 +0000)]
MFC r286344: find: Fix segfault with very long path in -exec/-ok ... {} \;.

If the resulting argument is longer than MAXPATHLEN, realloc() was called to
extend the space, but the new pointer was not correctly stored.

Different from what OpenBSD has done, rewrite brace_subst() to calculate the
necessary space first and realloc() at most once.

As before, the e_len fields are not updated in case of a realloc.
Therefore, a following long argument will do another realloc.

PR: 201750

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

8 years agoMFC r286720:
ae [Fri, 28 Aug 2015 11:56:20 +0000 (11:56 +0000)]
MFC r286720:
  Use g_conf_printf_escaped() to escape illegal symbols in file name.

  PR: 202289

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

8 years agoMFC r285252:
markj [Fri, 28 Aug 2015 00:06:31 +0000 (00:06 +0000)]
MFC r285252:
Fix an incorrect assertion in witness.

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

8 years agoMFC r286167:
markj [Thu, 27 Aug 2015 23:55:46 +0000 (23:55 +0000)]
MFC r286167:
Avoid dereferencing curthread->td_proc->p_cred in DTrace probe context.

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

8 years agoMFC r286418:
markj [Thu, 27 Aug 2015 23:52:53 +0000 (23:52 +0000)]
MFC r286418:
ipv4_is_zeronet() and ipv4_is_loopback() expect an address in network
order, but IN_ZERONET and IN_LOOPBACK expect it in host order.

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

8 years agoMFC r286169:
markj [Thu, 27 Aug 2015 23:46:11 +0000 (23:46 +0000)]
MFC r286169:
Perform bounds checking when constructing a format string.

PR: 201657

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

8 years agoMFC r281800 (pfg):
delphij [Thu, 27 Aug 2015 21:52:09 +0000 (21:52 +0000)]
MFC r281800 (pfg):

patch(1): small include changes.

Mostly to match OpenBSD, no functional change.

MFC r286601 + 286617:

use posix_spawn(3) instead of fork() and exec() manually as suggested
by jmg@.

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

8 years agoMFC r286966:
bdrewery [Thu, 27 Aug 2015 16:36:39 +0000 (16:36 +0000)]
MFC r286966:

  Add link for rw_unlock(9) to rwlock(9).

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

8 years agoDocument SA-15:21, SA-15:22, EN-15:15.
gjb [Thu, 27 Aug 2015 15:21:58 +0000 (15:21 +0000)]
Document SA-15:21, SA-15:22, EN-15:15.

Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r287119:
loos [Thu, 27 Aug 2015 14:07:28 +0000 (14:07 +0000)]
MFC r287119:

  Reapply r196551 which was accidentally reverted by r223637 (update to
  OpenBSD pf 4.5).

  Fix argument ordering to memcpy as well as the size of the copy in the
  (theoretical) case that pfi_buffer_cnt should be greater than ~_max.

  This fix the failure when you hit the self table size and force it to be
  resized.

  Sponsored by: Rubicon Communications (Netgate)

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

8 years agoMFC, r286965:
ken [Thu, 27 Aug 2015 13:17:05 +0000 (13:17 +0000)]
MFC, r286965:

  ------------------------------------------------------------------------
  r286965 | ken | 2015-08-20 10:07:51 -0600 (Thu, 20 Aug 2015) | 297 lines

  Revamp camcontrol(8) fwdownload support and add the opcodes subcommand.

  The significant changes and bugs fixed here are:

  1. Fixed a bug in the progress display code:

     When the user's filename is too big, or his terminal width is too
     small, the progress code could wind up using a negative number for
     the length of the "stars" that it uses to indicate progress.

     This negative value was assigned to an unsigned variable, resulting
     in a very large positive value.

     The result is that we wound up writing garbage from memory to the
     user's terminal.

     With an 80 column terminal, a file name length of more than 35
     characters would generate this problem.

     To address this, we now set a minimum progress bar length, and
     truncate the user's file name as needed.

     This has been tested with large filenames and small terminals, and
     at least produces reasonable results.  If the terminal is too
     narrow, the progress display takes up an additional line with each
     update, but this is more user friendly than writing garbage to the
     tty.

  2. SATA drives connected via a SATA controller didn't have SCSI Inquiry
     data populated in struct cam_device.  This meant that the code in
     fw_get_vendor() in fwdownload.c would try to match a zero-length
     vendor ID, and so return the first entry in the vendor table.  (Which
     used to be HITACHI.)  Fixed by grabbing identify data, passing the
     identify buffer into fw_get_vendor(), and matching against the model
     name.

  3. SATA drives connected via a SAS controller do have Inquiry data
     populated.  The table included a couple of entries -- "ATA ST" and
     "ATA HDS", intended to handle Seagate and Hitachi SATA drives attached
     via a SAS controller.  SCSI to ATA translation layers use a vendor
     ID of "ATA" (which is standard), and then the model name from the ATA
     identify data as the SCSI product name when they are returning data on
     SATA disks.  The cam_strmatch code will match the first part of the
     string (because the length it is given is the length of the vendor,
     "ATA"), and return 0 (i.e. a match).  So all SATA drives attached to
     a SAS controller would be programmed using the Seagate method
     (WRITE BUFFER mode 7) of SCSI firmware downloading.

  4. Issue #2 above covered up a bug in fw_download_img() -- if the
     maximum packet size in the vendor table was 0, it tried to default
     to a packet size of 32K.  But then it didn't actually succeed in
     doing that, because it set the packet size to the value that was
     in the vendor table (0).  Now that we actually have ATA attached
     drives fall use the VENDOR_ATA case, we need a reasonable default
     packet size.  So this is fixed to properly set the default packet size.

  5. Add support for downloading firmware to IBM LTO drives, and add a
     firmware file validation method to make sure that the firmware
     file matches the drive type.  IBM tape drives include a Load ID and
     RU name in their vendor-specific VPD page 0x3.  Those should match
     the IDs in the header of the firmware file to insure that the
     proper firmware file is loaded.

  6. This also adds a new -q option to the camcontrol fwdownload
     subcommand to suppress informational output.  When -q is used in
     combination with -y, the firmware upgrade will happen without
     prompting and without output except if an error condition occurs.

  7. Re-add support for printing out SCSI inquiry information when
     asking the user to confirm that they want to download firmware, and
     add printing of ATA Identify data if it is a SATA disk.  This was
     removed in r237281 when support for flashing ATA disks was added.

  8. Add a new camcontrol(8) "opcodes" subcommand, and use the
     underlying code to get recommended timeout values for drive
     firmware downloads.

     Many SCSI devices support the REPORT SUPPORTED OPERATION CODES
     command, and some support the optional timeout descriptor that
     specifies nominal and recommended timeouts for the commands
     supported by the device.

     The new camcontrol opcodes subcommand allows displaying all
     opcodes supported by a drive, information about which fields
     in a SCSI CDB are actually used by a given SCSI device, and the
     nominal and recommended timeout values for each command.

     Since firmware downloads can take a long time in some devices, and
     the time varies greatly between different types of devices, take
     advantage of the infrastructure used by the camcontrol opcodes
     subcommand to determine the best timeout to use for the WRITE
     BUFFER command in SCSI device firmware downloads.

     If the device recommends a timeout, it is likely to be more
     accurate than the default 50 second timeout used by the firmware
     download code.  If the user specifies a timeout, it will override
     the default or device recommended timeout.  If the device doesn't
     support timeout descriptors, we fall back to the default.

  9. Instead of downloading firmware to SATA drives behind a SAS controller
     using WRITE BUFFER, use the SCSI ATA PASS-THROUGH command to compose
     an ATA DOWNLOAD MICROCODE command and it to the drive.  The previous
     version of this code attempted to send a SCSI WRITE BUFFER command to
     SATA drives behind a SAS controller.  Although that is part of the
     SAT-3 spec, it doesn't work with the parameters used with LSI
     controllers at least.

  10.Add a new mechanism for making common ATA passthrough and
     ATA-behind-SCSI passthrough commands.

     The existing camcontrol(8) ATA command mechanism checks the device
     type on every command executed.  That works fine for individual
     commands, but is cumbersome for things like a firmware download
     that send a number of commands.

     The fwdownload code detects the device type up front, and then
     sends the appropriate commands.

  11.In simulation mode (-s), if the user specifies the -v flag, print out
     the SCSI CDB or ATA registers that would be sent to the drive.  This will
     aid in debugging any firmware download issues.

  sbin/camcontrol/fwdownload.c:
   Add a device type to the fw_vendor structure, so that we can
   specify different download methods for different devices from the
   same vendor.  In this case, IBM hard drives (from when they
   still made hard drives) and tape drives.

   Add a tur_status field to the fw_vendor structure so that we can
   specify whether the drive to be upgraded should be ready, not
   ready, or whether it doesn't matter.  Add the corresponding
   capability in fw_download_img().

   Add comments describing each of the vendor table fields.

   Add HGST and SmrtStor to the supported SCSI vendors list.

   In fw_get_vendor(), look at ATA identify data if we have a SATA
   device to try to identify what the drive vendor is.

   Add IBM firmware file validation.  This gets VPD page 0x3, and
   compares the Load ID and RU name in the page to the values
   included in the header.  The validation code will refuse to load
   a firmware file if the values don't match.  This does allow the
   user to attempt a downgrade; whether or not it succeeds will
   likely depend on the drive settings.

   Add a -q option, and disable all informative output
   (progress bars, etc.) when this is enabled.

   Re-add the inquiry in the confirmation dialog so the user has
   a better idea of which device he is talking to.  Add support for
   displaying ATA identify data.

   Don't automatically disable confirmation in simulation (-s) mode.
   This allows the user to see the inquiry or identify data in the
   dialog, and see exactly what they would see when the command
   actually runs.  Also, in simulation mode, if the user specifies
   the -v flag, print out the SCSI CDB or ATA registers that would
   be sent to the drive.  This will aid in debugging any firmware
   download issues.

   Add a timeout field and timeout type to the firmware download
   vendor table.  This allows specifying a default timeout and allows
   specifying whether we should attempt to probe for a recommended
   timeout from the drive.

   Add a new fuction, fw_get_timeout(), that will determine
   which timeout to use for the WRITE BUFFER command.  If the
   user specifies a timeout, we always use that.  Otherwise,
   we will use the drive recommended timeout, if available,
   and fall back to the default when a drive recommended
   timeout isn't available.

   When we prompt the user, tell him what timeout we're going
   to use, and the source of the timeout.

   Revamp the way SATA devices are handled.

   In fwdownload(), use the new get_device_type() function to
   determine what kind of device we're talking to.

   Allow firmware downloads to any SATA device, but restrict
   SCSI downloads to known devices.  (The latter is not a
   change in behavior.)

   Break out the "ready" check from fw_download_img() into a
   new subfunction, fw_check_device_ready().  This sends the
   appropriate command to the device in question -- a TEST
   UNIT READY or an IDENTIFY.  The IDENTIFY for SATA devices
    a SAT layer is done using the SCSI ATA PASS-THROUGH
   command.

   Use the new build_ata_cmd() function to build either a SCSI or
   ATA I/O CCB to issue the DOWNLOAD MICROCODE command to SATA
   devices.  build_ata_cmd() figures looks at the devtype argument
   and fills in the correct CCB type and CDB or ATA registers.

   Revamp the vendor table to remove the previous
   vendor-specific ATA entries and use a generic ATA vendor
   placeholder.  We currently use the same method for all ATA
   drives, although we may have to add vendor-specific
   behavior once we test this with more drives.

  sbin/camcontrol/progress.c:
   In progress_draw(), make barlength a signed value so that
   we can easily detect a negative value.

   If barlength (the length of the progress bar) would wind up
   negative due to a small TTY width or a large filename,
   set the bar length to the new minimum (10 stars) and
   truncate the user's filename.  We will truncate it down to
   0 characters if necessary.

   Calculate a new prefix_len variable (user's filename length)
   and use it as the precision when printing the filename.

  sbin/camcontrol/camcontrol.c:
   Implement a new camcontrol(8) subcommand, "opcodes".  The
   opcodes subcommand allows displaying the entire list of
   SCSI commands supported by a device, or details on an
   individual command.  In either case, it can display
   nominal and recommended timeout values.

   Add the scsiopcodes() function, which calls the new
   scsigetopcodes() function to fetch opcode data from a
   drive.

   Add two new functions, scsiprintoneopcode() and
   scsiprintopcodes(), which print information about one
   opcode or all opcodes, respectively.

   Remove the get_disk_type() function.  It is no longer used.

   Add a new function, dev_has_vpd_page(), that fetches the
   supported INQUIRY VPD list from a device and tells the
   caller whether the requested VPD page is available.

   Add a new function, get_device_type(), that returns a more
   precise device type than the old get_disk_type() function.
   The get_disk_type() function only distinguished between
   SCSI and ATA devices, and SATA devices behind a SCSI to ATA
   translation layer were considered to be "SCSI".

   get_device_type() offers a third type, CC_DT_ATA_BEHIND_SCSI.
   We need to know this to know whether to attempt to send ATA
   passthrough commands.  If the device has the ATA
   Information VPD page (0x89), then it is an ATA device
   behind a SCSI to ATA translation layer.

   Remove the type argument from the fwdownload() subcommand.

   Add a new function, build_ata_cmd(), that will take one set
   of common arguments and build either a SCSI or ATA I/O CCB,
   depending on the device type passed in.

  sbin/camcontrol/camcontrol.h:
   Add a prototype for scsigetopcodes().

   Add a new enumeration, camcontrol_devtype.

   Add prototypes for dev_has_vpd_page(), get_device_type()
   and build_ata_cmd().

   Remove the type argument from the fwdownload() subcommand.

  sbin/camcontrol/camcontrol.8
   Explain that the fwdownload subcommand will use the drive
   recommended timeout if available, and that the user can
   override the timeout.

   Document the new opcodes subcommand.

   Explain that we will attempt to download firmware to any
   SATA device.

   Document supported SCSI vendors, and models tested if known.

   Explain the commands used to download firmware for the
   three different drive and controller combinations.

   Document that the -v flag in simulation mode for the fwdownload
   subcommand will print out the SCSI CDBs or ATA registers that would
   be used.

  sys/cam/scsi/scsi_all.h:
   Add new bit definitions for the one opcode descriptor for
   the REPORT SUPPORTED OPCODES command.

   Add a function prototype for scsi_report_supported_opcodes().

  sys/cam/scsi/scsi_all.c:
   Add a new CDB building function, scsi_report_supported_opcodes().

Sponsored by: Spectra Logic

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

8 years agoMFC r286975:
kib [Thu, 27 Aug 2015 09:06:14 +0000 (09:06 +0000)]
MFC r286975:
Remove the wrong asserts.

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

8 years agoMFC r286737:
delphij [Thu, 27 Aug 2015 01:02:01 +0000 (01:02 +0000)]
MFC r286737:

Plug a memory leak.

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

8 years agoMFC r286886: Fixing typo as well as improving readability of a few comments.
avatar [Wed, 26 Aug 2015 22:59:58 +0000 (22:59 +0000)]
MFC r286886: Fixing typo as well as improving readability of a few comments.

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

8 years agoMFC r286926:
np [Wed, 26 Aug 2015 01:41:55 +0000 (01:41 +0000)]
MFC r286926:

cxgbe(4):  Save the flags for the last adapter-wide synchronized
operation that was initiated successfully.  (The caller and thread are
already recorded).

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

8 years agoMFC: Fix OpenSSH multiple vulnerabilities.
delphij [Tue, 25 Aug 2015 20:48:44 +0000 (20:48 +0000)]
MFC: Fix OpenSSH multiple vulnerabilities.

Security: FreeBSD-SA-15:22.openssh

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

8 years agoMFC: r286265, r286293, r286328
jkim [Tue, 25 Aug 2015 19:18:38 +0000 (19:18 +0000)]
MFC: r286265, r286293, r286328

Always define __va_list for amd64 and restore pre-r232261 behavior for i386.

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

8 years agoMFC r286808, r286809, r286867, r286868
marcel [Tue, 25 Aug 2015 15:14:50 +0000 (15:14 +0000)]
MFC r286808, r286809, r286867, r286868

-   Improve support for Macs that have a stride not equal to the
    horizonal resolution (width).
-   Support frame buffers that are larger than the default screen
    size.
-   Support large frame buffers: add 24 more page table pages we
    allocate on boot-up.

PR: 193745

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

8 years agoMFC r286667 & r286723
marcel [Tue, 25 Aug 2015 14:39:40 +0000 (14:39 +0000)]
MFC r286667 & r286723

Better support memory mapped console devices, such as VGA and EFI
frame buffers and memory mapped UARTs.

PR: 191564, 194952, 202276

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

8 years agoMFC r286660, r286419, r286417, r286395, r286215, r284883
marcel [Tue, 25 Aug 2015 04:03:51 +0000 (04:03 +0000)]
MFC r286660, r286419, r286417, r286395, r286215, r284883

-   Add the ntfs alias
-   Fix the dynamic VHD format to work with qemu
-   Update manpage

MFH:
Differential Revision:

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

8 years agoMFC: r286409
brueffer [Mon, 24 Aug 2015 14:32:57 +0000 (14:32 +0000)]
MFC: r286409

Manpage cleanup.

- new sentence -> new line
- fix manpage references
- fix macro usage
- fix a typo

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

8 years agoMFH: r284691
julian [Mon, 24 Aug 2015 03:51:18 +0000 (03:51 +0000)]
MFH: r284691
MFH: r284920

  Remove 16 rules and replace by 2 by using a table.
  I've been doing this ever since there were tables.
  I could make more efficient by using "in recv"  and "out xmit" instead of via
  but I'll leave that.

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

8 years agoMFH: r273762
julian [Mon, 24 Aug 2015 03:41:14 +0000 (03:41 +0000)]
MFH: r273762
MFH: r276304

Allow loading of dtraceall without nfscl if what you really want is nfsclient

Obtained from: Panzura tree and Rick Maclem

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

8 years agoMFC: r285133,r285136,r285137,r285156,r285157,r285158,r285256,r285318,r285395,
bapt [Sun, 23 Aug 2015 21:42:27 +0000 (21:42 +0000)]
MFC: r285133,r285136,r285137,r285156,r285157,r285158,r285256,r285318,r285395,
r285396,r285398,r285401,r285403,r285405,r285406,r285408,r285409,r285411,
r285412,r285413,r285415,r285418,r285430,r285433,r285434,r285442,r285948,
r285984,r285985,r285989,r285996,r285997,r286045,r286047,r286066,r286150,
r286151,r286152,r286154,r286155,r286156,r286157,r286173,r286196,r286197,
r286198,r286199,r286200,r286201,r286202,r286203,r286204,r286210,r286211,
r286217,r286218,r286258,r286259,r286341,r286775,r286982,r286986,r286991,
r286993

Validate most pw inputs.
Rewrite the way parsing sub arguments is made to simplify code and improve
maintenability
Add -y (NIS) to userdel/usermod
pw userdel -r <rootdir> now deletes directories in the rootdir
Only parse pw.conf when needed
Reject usermod and userdel if the user concerned is not on the user database
supposed to be manipulated

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

8 years agoMFC r283547:
ian [Sun, 23 Aug 2015 20:50:22 +0000 (20:50 +0000)]
MFC r283547:

  Ensure that all arm kernel configs contain ALT_BREAK_TO_DEBUGGER and not
  BREAK_TO_DEBUGGER if they have a serial console (most do).  A burst of
  serial line noise (such as unplugging a usb serial adapter) can look like
  a break and drop a working system into the debugger.  The alt break sequence
  (<CR>~^B) works fine on both serial and non-serial consoles.

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

8 years agoMFC r286947: Add a new exit-timeout option to watchdogd.
ian [Sun, 23 Aug 2015 20:39:19 +0000 (20:39 +0000)]
MFC r286947:  Add a new exit-timeout option to watchdogd.

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

8 years agoMFC r286942, r286943, r286944: imx watchdog fixes...
ian [Sun, 23 Aug 2015 20:16:13 +0000 (20:16 +0000)]
MFC r286942, r286943, r286944: imx watchdog fixes...

  Add compatible strings for all the hardware this driver works with.

  Also, move the READ/WRITE bus space access macros from the header into the
  source file, and rename them to RD2/WR2 to make it clear they're 16-bit
  accessors.  (READ/WRITE just don't seem like good names to be in a public
  header file.)

  Make the imx watchdog actually work, by setting WDOG_CR_WDE (enable bit).
  Also, follow the rules from watchdog(9) about what values to return in
  various situations (especially, don't touch *error when asked to set a
  non-zero timeout that isn't achievable on the hardware).

  Enable the watchdog driver on imx6, now that it works.

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

8 years agoMFC r286701:
ian [Sun, 23 Aug 2015 18:03:43 +0000 (18:03 +0000)]
MFC r286701:

  If a specific timecounter has been chosen via sysctl, and a new
  timecounter with higher quality registers (presumably in a module that has
  just been loaded), do not undo the user's choice by switching to the new
  timecounter.

  Document that behavior, and also the fact that there is no way to
  unregister a timecounter (and thus no way to unload a module containing
  one).

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

8 years agoAlways compile in PPS capture. Use the same device name used in 11-current.
ian [Sun, 23 Aug 2015 17:54:48 +0000 (17:54 +0000)]
Always compile in PPS capture.  Use the same device name used in 11-current.

This is a direct commit to 10-stable because the corresponding changes in 11
are bound up with all the device-tree rework for beaglebone.  This somewhat
aligns the features between the two branches, from a user's perspective.

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

8 years agoMFC r286469, r286591, r286595, r286596, r286613:
ian [Sun, 23 Aug 2015 17:07:23 +0000 (17:07 +0000)]
MFC r286469, r286591, r286595, r286596, r286613:

  Provide the tty-layer mutex when initializing the pps api.  This allows
  time_pps_fetch() to be used in blocking mode.

  Allow the choice of PPS signal captured by uart(4) to be runtime-configured,
  eliminating the need to build a custom kernel to use the CTS signal.

  Correct the polarity of the PPS assert and clear events with respect to the
  electrical signals on the serial port.

  Document the change in polarity of the uart(4) PPS capture.

  Style fix -- do the braces for switches correctly.

Relnotes: yes

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

8 years agoMFC r286423, r286429:
ian [Sun, 23 Aug 2015 16:22:21 +0000 (16:22 +0000)]
MFC r286423, r286429:

  RFC 2783 requires a status of ETIMEDOUT, not EWOULDBLOCK, on a timeout.

  Only process the PPS event types currently enabled in pps_params.mode.

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

8 years agoMFC r264394, r286382, r286385, r286389:
ian [Sun, 23 Aug 2015 16:17:00 +0000 (16:17 +0000)]
MFC r264394, r286382, r286385, r286389:

  Add support to the uftdi driver for reading and writing the serial eeprom
  that can be attached to the chips, via ioctl() calls.

  Return the current ftdi bitbang mode with the UFTDIIOC_GET_BITMODE ioctl.

  Document the recently added get-bitmode and eeprom read/write functionality.

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

8 years agoMFC r284916: mv: Improve message when moving two or more files to
jilles [Sat, 22 Aug 2015 21:35:35 +0000 (21:35 +0000)]
MFC r284916: mv: Improve message when moving two or more files to
non-directory.

The message text is from cp, which has had a nicer message for this since
2007 (PR bin/50656).

As with cp, the exit status changes from 64 to 1.

PR: 201083

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

8 years agoMFC r286462: Refactor early stages of security negotiation.
mav [Sat, 22 Aug 2015 16:59:27 +0000 (16:59 +0000)]
MFC r286462: Refactor early stages of security negotiation.

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

8 years agoMFC r285020: Disable port multiplier support on Marvell 88SE61xx chips.
mav [Sat, 22 Aug 2015 15:36:20 +0000 (15:36 +0000)]
MFC r285020: Disable port multiplier support on Marvell 88SE61xx chips.

According to report, some recent unrelated changes in the driver triggered
timeouts when testing for absent port multiplier.  Cause of this behavior
channge is unclear, but since these chips are old, rare and buggy, it is
easier to just disable port multiplier support, same as done in Linux.

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

8 years agoMFC r286448: Disable 32-bit PIO for 6Gbit/s Intel SATA controllers.
mav [Sat, 22 Aug 2015 07:45:49 +0000 (07:45 +0000)]
MFC r286448: Disable 32-bit PIO for 6Gbit/s Intel SATA controllers.

For some reason 32-bit PIO writes are not working on 6Gbit/s Intel SATA
ports, while 16/32-bit PIO reads and 16-bit PIO writes are working fine.
3Gbit/s ports on the same controllers have no this problem.

Workaround this by disabling 32-bit PIO for all Intel controllers that may
have 6Gbit/s ports.  It halves PIO performance from 6MB/s to 3MB/s, but
who bother about speed of such rare and slow mode, which is also highly
discouraged by SATA specifications?

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

8 years agoMFC r280451:
mav [Sat, 22 Aug 2015 07:32:47 +0000 (07:32 +0000)]
MFC r280451:
Remove from legacy ata(4) driver support for hardware, supported by newer
and more functional drivers ahci(4), siis(4) and mvs(4).

This removes about 3400 lines of code, unused since FreeBSD 9.0 release.

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

8 years agoMFC: r286805
bapt [Sat, 22 Aug 2015 00:47:05 +0000 (00:47 +0000)]
MFC: r286805

Update to use the latest version of the PCI IDs Repository.

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

8 years agoMFC r286862:
loos [Thu, 20 Aug 2015 14:03:03 +0000 (14:03 +0000)]
MFC r286862:

  Fix the copy of addresses passed from userland in table replace command.

  The size2 is the maximum userland buffer size (used when the addresses are
  copied back to userland).

  Obtained from: pfSense
  Sponsored by: Rubicon Communications (Netgate)

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

8 years agoMFC r285742:
ed [Thu, 20 Aug 2015 08:34:13 +0000 (08:34 +0000)]
MFC r285742:

  Unbreak "last reboot".

  According to the last(1) man page, the "reboot" pseudo-user should print
  all system reboot entries. This got broken by the utmpx import, as
  records are typed.

  Re-add support for "last reboot" by specifically matching against
  SHUTDOWN_TIME and BOOT_TIME records.

PR:           168844
Submitted by: matthew@

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

8 years agoInstant-MFC r286933:
delphij [Wed, 19 Aug 2015 18:32:36 +0000 (18:32 +0000)]
Instant-MFC r286933:

Issue warning and refuse to proceed further if the configured
repository signature_type is unsupported by bootstrap pkg(7).

Previously, when signature_type specified an unsupported method,
the bootstrap pkg(7) would proceed like when signature_type is
"none".  MITM attackers may be able to use this vulnerability and
bypass validation and install their own versions of pkg(8).

At this time, only fingerprint and none are supported by the
bootstrap pkg(7).

FreeBSD's official pkg(8) repository uses the fingerprint method
and is therefore unaffected.

Errata candidate.

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

8 years agoRemove a broken link.
gjb [Wed, 19 Aug 2015 17:51:03 +0000 (17:51 +0000)]
Remove a broken link.
While here, prefer https where possible.

Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r286353: Pass SYNCHRONIZE CACHE command parameters to backends.
mav [Wed, 19 Aug 2015 17:47:47 +0000 (17:47 +0000)]
MFC r286353: Pass SYNCHRONIZE CACHE command parameters to backends.

At this point IMMED flag is translated to MNT_NOWAIT flag of VOP_FSYNC(),
hoping that file system implements that (ZFS seems doesn't).

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

8 years agoMFC r286345: Relax serialization of SYNCHRONIZE CACHE commands.
mav [Wed, 19 Aug 2015 17:43:36 +0000 (17:43 +0000)]
MFC r286345: Relax serialization of SYNCHRONIZE CACHE commands.

Before this change SYNCHRONIZE CACHE commands were executed exclusively,
as if they had ORDERED tag.  But looking through SCSI specs I've found
no any reason to be so strict.  For reads this ordering seems pointless.
For writes it looks less obvious, so I left ordering against preceeding
write commands, while following ones are no longer required to wait.

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

8 years agoDocument two post-release EN items as resolved.
gjb [Wed, 19 Aug 2015 17:42:32 +0000 (17:42 +0000)]
Document two post-release EN items as resolved.

Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r286320: Issue all reads of single XCOPY segment simultaneously.
mav [Wed, 19 Aug 2015 17:41:49 +0000 (17:41 +0000)]
MFC r286320: Issue all reads of single XCOPY segment simultaneously.

During vMotion and Clone VMware by default runs multiple sequential 4MB
XCOPY requests same time.  If CTL issues reads sequentially in 1MB chunks
for each XCOPY command, reads from different commands are not detected
as sequential by serseq option code and allowed to execute simultaneously.
Such read pattern confused ZFS prefetcher, causing suboptimal disk access.
Issuing all reads same time make serseq code work properly, serializing
reads both within each XCOPY command and between them.

My tests with ZFS pool of 14 disks in RAID10 shows prefetcher efficiency
improved from 37% to 99.7%, copying speed improved by 10-60%, average
read latency reduced twice on HDD layer and by five times on zvol layer.

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

8 years agoAdd 10.2-RELEASE to UPDATING, forgotten with prior related commits.
gjb [Wed, 19 Aug 2015 00:26:54 +0000 (00:26 +0000)]
Add 10.2-RELEASE to UPDATING, forgotten with prior related commits.

Submitted by: junovitch
Sponsored by: The FreeBSD Foundation

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

8 years agoDocument SA-15:20, EN-15:11, EN-15:12, EN-15:13.
gjb [Tue, 18 Aug 2015 20:27:03 +0000 (20:27 +0000)]
Document SA-15:20, EN-15:11, EN-15:12, EN-15:13.

Sponsored by: The FreeBSD Foundation

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

8 years agoFix multiple integer overflows in expat.
delphij [Tue, 18 Aug 2015 19:30:05 +0000 (19:30 +0000)]
Fix multiple integer overflows in expat.

Security: CVE-2015-1283
Security: FreeBSD-SA-15:20.expat

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

8 years agoMFC r271490:
np [Tue, 18 Aug 2015 19:15:20 +0000 (19:15 +0000)]
MFC r271490:
cxgbe(4): add support for the SIOCGI2C ioctl.

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

8 years agoMFC r285648:
np [Tue, 18 Aug 2015 19:04:55 +0000 (19:04 +0000)]
MFC r285648:

cxgbe(4): Ask the firmware for the start of the RSS slice for a port and
save it for later.  This enables direct manipulation of the indirection
tables (although the stock driver doesn't do that right now).

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

8 years agoMFC r285527 and r286338. This takes the firmware from 1.11.27.0 to 1.14.4.0.
np [Tue, 18 Aug 2015 18:54:45 +0000 (18:54 +0000)]
MFC r285527 and r286338.  This takes the firmware from 1.11.27.0 to 1.14.4.0.

r286338:
cxgbe(4):  Update T5 and T4 firmwares bundled with the driver to 1.14.4.0.  The
changes in the firmwares since 1.11.27.0 are listed here (straight copy-paste
from the "Release Notes.txt" accompanying the Chelsio Unified Wire 2.11.1.0
release on the website).

22.1. T5 Firmware
+++++++++++++++++++++++++++++++++

Version : 1.14.4.0
Date    : 08/05/2015
================================================================================

FIXES
-----

BASE:
- Fixes a potential data path hang by properly programming PMTX congestion
  threshold settings.
- Fixes a potential initialization error when accessing a configuration file
  stored on the flash.
- Fixes a regression where SGE resources can be miss-sized if iWARP is disabled.

ETH:
- Fixes a timing issue that would prevent CR4 links from coming up with some
  switches.

FOFCoE:
- Defers fcoe linkdown mailbox command handling till LOGO is sent.
- Updates vlan prio for all outstanding IOs during dcbx update.

ENHANCEMENTS
------------

BASE:
- Adds support for PAUSE OFF watchdog.
- Reports devlog access information in PCIE_FW_PF register 7.

ETH:
- Enhances segmentation offload to include VxLAN and Geneve.
- Adds PTP support.
- Adds new interface to allow the driver to query the VI rss table base
  addresses.
- Allows the driver to program the SGE ingrext contxt CongDrop field.

OFLD:
- Adds new interface for the driver to specify offloaded connections TCP snd
  and rcv scale factors.

iSCSI:
- Adds support for iscsi segmentatation offload (ISO).
- Adds support for iscsi t10-dif offload.

FOiSCSI:
- Sets FORCE_BIT for cut through processing for FOiSCSI.

FOFCoE:
- Adds support for FCoE BB6.
- Improves WRITE performance.

================================================================================
================================================================================

Version : 1.13.32.0
Date    : 03/25/2015
================================================================================

FIXES
-----

BASE:
- Fixes FW_CAPS_CONFIG_CMD return value on error (was positive instead of
   negative)
- Fixes FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ indication (was wrong on certain
   adapter configurations)
- Fixes config file based PL_TIMEOUT register programming

ETH:
- Fixes a potential EO UDP SEG header corruption
- Fixes an issue where 1000Base-X was not enabled correctly when using QSA
   modules

OFLD:
- Fixes timeout issue with half-open connections
- Fixes FW_FLOWC_WR processing when state is set to finwait1

FOFCoE:
- Fixes fcoe xchg leaks in linkdown/peer down path
- Fixes cleanup in FCoE linkdown and fixed buf timer flowid abuse
- Fixes fw crash by clearing fcf flowc during bye

FOiSCSI:
- Don't create a new tcp socket if ERL0 attempt has timed out.

ENHANCEMENTS
------------

BASE:
- Adds support for VFs on PFs 4 to 7
- Adds support for QPs/CQs on any physical and virtual function

ETH:
- Stops sending LACP frames on loopback interface
- Adds an AUTOEQU indication to CPL_SGE_EGR_UPDATE
- Adds support for CR4 links (BEAN/AEC on 40G TwinAx cables)

OFLD:
- Improves default settings of LAN and CLUSTER TCP timer settings
- Sends Negative Advice CPLs to software

FOISCSI:
- Adds IPv6 support for foiscsi. Keeps backward compatibility with
   old foiscsi drivers which doesn't support ipv6.

FOFCoE:
- Added fcoe debug support in flowc dump

================================================================================
================================================================================

Version : 1.12.25.0
Date    : 10/22/2014
================================================================================

FIXES
-----

BASE:
- Improves precision of the Weight Round Robing Traffic Management Algorithm
- Fixes an issue where the link would intermittently fail to come up
- Fixes an issue where adapters with an external PHY couldn't run at 100Mbps
- Fixes an issue where active optical cables were not recognized
- Fixes link advertising issues on T520-BT (speed and pause frames) that would
  cause the link to negotiate unexpected settings
- Forces link restart when auto-negotiation is disabled
- Fix an issue where pause frames wouldn't be fully disabled even if requested

ETH:
- Fixes NVGRE Segmentation Offload network header generation.

DCBX:
- Fixes an issue where some settings were not being sent to the switch
  correctly
- Fixes an issue where back-to-back DCBX port updates could get overwritten by
  FW
- Fixes a firmware crash on DCBX APP information request before link up

FOiSCSI:
- Fixes abort task leak in tmf response handling
- Fixes TCP RST handling while in iSCSI ERL0
- Fixes a firmware crash on BYE without INIT

ENHANCEMENTS
-------------

BASE:
- Adds link partner settings reporting when available
- Adds QSA support (in conjunction with QSA VPD)
- Adds T520-BT LED support
- Reports NOTSUPPORTED for modules with an unhandled identifier

DCBX:
- Adds version reporting (indicating which version FW is trying to negotiate)
- Adds IEEE support
- Reports LLDP time outs

FOiSCSI:
- Add support for multiple iSCSI DDP client
- Sends DHCP renew request when lease expires

================================================================================

22.2. T4 Firmware
+++++++++++++++++

Version : 1.14.4.0
Date    : 08/05/2015
================================================================================

FIXES
-----

BASE:
- Fixes a potential initialization error when accessing a configuration file
  stored on the flash.
- Initialize PCIE_DBG_INDIR_REQ.Enable to 0, as hardware failed to do so and
  register dumps could result in errors.

ETH:
- Fixes an issue that sometimes prevented the link from coming up in CR adapters.

ENHANCEMENTS
------------

BASE:
- Adds support for PAUSE OFF watchdog.
- Reports devlog access information in PCIE_FW_PF register 7.

ETH:
- Adds new interface to allow the driver to query the VI rss table base
  addresses.

OFLD:
- Adds new interface for the driver to specify offloaded connections TCP snd
  and rcv scale factors.

================================================================================
================================================================================

Version : 1.13.32.0
Date    : 03/25/2015
================================================================================

FIXES
-----

BASE:
- Fixes FW_CAPS_CONFIG_CMD return value on error (was positive instead of
    negative)
- Fixes FW_PARAMS_PARAM_DEV_FLOWC_BUFFIFO_SZ indication (was wrong on certain
    adapter configurations)
- Fixes config file based PL_TIMEOUT register programming

ETH:
- Fixes a potential EO UDP SEG header corruption

OFLD:
- Fixes timeout issue with half-open connections
- Fixes FW_FLOWC_WR processing when state is set to finwait1

FOiSCSI:
- Don't create a new tcp socket if ERL0 attempt has timed out.

ENHANCEMENTS
------------

ETH:
- Stops sending LACP frames on loopback interface
- Adds an AUTOEQU indication to CPL_SGE_EGR_UPDATE

OFLD:
- Improves default settings of LAN and CLUSTER TCP timer settings
- Sends Negative Advice CPLs to software

================================================================================
================================================================================

Version : 1.12.25.0
Date    : 10/22/2014
================================================================================

FIXES
-----

BASE:
- Improves precision of the Weight Round Robing Traffic Management Algorithm
- Forces link restart when auto-negotiation is disabled
- Fix an issue where pause frames wouldn't be fully disabled even if requested

DCBX:
- Fixes an issue where some settings were not being sent to the switch
  correctly
- Fixes an issue where back-to-back DCBX port updates could get overwritten by
  FW
- Fixes a firmware crash on DCBX APP information request before link up

FOiSCSI:
- Fixes abort task leak in tmf response handling
- Fixes TCP RST handling while in iSCSI ERL0
- Fixes a firmware crash on BYE without INIT

ENHANCEMENTS
------------

BASE:
- Adds link partner settings reporting when available
- Firmware now reports NOTSUPPORTED for modules with an unhandled identifier

DCBX:
- Adds version reporting (indicating which version FW is trying to negotiate)
- Adds IEEE support
- Reports LLDP time outs

FOiSCSI:
- Adds support for multiple iSCSI DDP clients
- Sends DHCP renew request when lease expires

================================================================================

Obtained from: Chelsio Communications
Sponsored by: Chelsio Communications

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

8 years agoMFC r286288:
kib [Tue, 18 Aug 2015 09:09:39 +0000 (09:09 +0000)]
MFC r286288:
Give large kernel stack to the initial thread.

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

8 years agoMFC r286260:
loos [Mon, 17 Aug 2015 19:06:14 +0000 (19:06 +0000)]
MFC r286260:
  Remove the mtx_sleep() from the kqueue f_event filter.

  The filter is called from the network hot path and must not sleep.

  The filter runs with the descriptor lock held and does not manipulate the
  buffers, so it is not necessary sleep when the hold buffer is in use.

  Just ignore the hold buffer contents when it is being copied to user space
  (when hold buffer in use is set).

  This fix the "Sleeping thread owns a non-sleepable lock" panic when the
  userland thread is too busy reading the packets from bpf(4).

  PR:           200323
  Sponsored by: Rubicon Communications (Netgate)

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

8 years agoMFC r286140:
loos [Mon, 17 Aug 2015 18:43:39 +0000 (18:43 +0000)]
MFC r286140:
  Remove the sleep from the buffer allocation routine.

  The buffer must be allocated (or even changed) before the interface is set
  and thus, there is no need to verify if the buffer is in use.

MFC r286142:
  Remove two unnecessary sleeps from the hot path in bpf(4).

  The first one never triggers because bpf_canfreebuf() can only be true for
  zero-copy buffers and zero-copy buffers are not read with read(2).

  The second also never triggers, because we check the free buffer before
  calling ROTATE_BUFFERS().  If the hold buffer is in use the free buffer
  will be NULL and there is nothing else to do besides drop the packet.  If
  the free buffer isn't NULL the hold buffer _is_ free and it is safe to
  rotate the buffers.

  Update the comment in ROTATE_BUFFERS macro to match the logic described
  here.

  While here fix a few typos in comments.

MFC r286243:
  Add a KASSERT() to make sure we wont rotate the buffers twice (rotate the
  buffers while the hold buffer is in use).

  Sponsored by: Rubicon Communications (Netgate)

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

8 years agoMFC r286777:
kib [Mon, 17 Aug 2015 18:36:16 +0000 (18:36 +0000)]
MFC r286777:
Comment only change, fix grammar and somewhat clarify the action.

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

8 years agoMFC r286582:
kib [Mon, 17 Aug 2015 18:34:54 +0000 (18:34 +0000)]
MFC r286582:
Pre-resolve symbols required for the deferred signal processing.

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

8 years agoMFC r286228:
kib [Mon, 17 Aug 2015 18:33:16 +0000 (18:33 +0000)]
MFC r286228:
Clear the IA32_MISC_ENABLE MSR bit on APs.

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

8 years agoMFC r286139:
loos [Mon, 17 Aug 2015 18:21:18 +0000 (18:21 +0000)]
MFC r286139:

  Do not allocate the buffers at opening of the descriptor, because once
  the buffer is allocated we are committed to a particular buffer method
  (BPF_BUFMODE_BUFFER in this case).

  If we are using zero-copy buffers, the userland program must register its
  buffers before set the interface.

  If we are using kernel memory buffers, we can allocate the buffer at the
  time that the interface is being set.

  This fix allows the usage of BIOCSETBUFMODE after r235746.

  Update the comments to reflect the recent changes.

  Sponsored by: Rubicon Communications (Netgate)

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

8 years agoMFC r285715:
ed [Mon, 17 Aug 2015 12:51:46 +0000 (12:51 +0000)]
MFC r285715:

  Add an API for easily creating userspace threads in kernelspace.

  This change refactors the existing create_thread() function to be more
  generic. It replaces almost all of its arguments by a callback that can
  be used to extract the thread ID and copy it out to the right place, but
  also to perform additional initialization steps, such as setting the
  trapframe. This also makes the difference between thr_new() and
  thr_create() more clear in my opinion.

  This function is going to be used by the CloudABI compatibility layer.

  It looks like the OpenSolaris compatibility framework already provides a
  function called thread_create(). Rename this function to
  do_thread_create() and use a macro to deal with the namespacing
  conflict. A similar approach is already used for thread_exit().

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

8 years agoMerge r283612:
glebius [Mon, 17 Aug 2015 10:03:23 +0000 (10:03 +0000)]
Merge r283612:
  Add SIOCGI2C ioctl support to the driver. Would work only on ConnectX-3
  with fresh firmware. The low level code is based on code provided by
  Mellanox.

  Thanks to Mellanox and their distributor Must (http://mustcompany.ru)
  for providing hardware.

  In collaboration with:        Andre Melkoumian <andre mellanox.com>
  Reviewed by:          hselasky
  Sponsored by:         Netflix
  Sponsored by:         Nginx, Inc.

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

8 years agoDocument an error in the release notes regarding revision r282199.
gjb [Sun, 16 Aug 2015 12:09:55 +0000 (12:09 +0000)]
Document an error in the release notes regarding revision r282199.

Submitted by: amdmi3
Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r286719: Revert part of r280687, reporting "1" (true) for empty value.
mav [Sun, 16 Aug 2015 00:37:47 +0000 (00:37 +0000)]
MFC r286719: Revert part of r280687, reporting "1" (true) for empty value.

For example, it made gpart partitions without label report "1" as label.

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

8 years agoMFC r286516: Document kern.cam.ctl.debug sysctl.
mav [Sun, 16 Aug 2015 00:36:48 +0000 (00:36 +0000)]
MFC r286516: Document kern.cam.ctl.debug sysctl.

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

8 years agoMFC r286514: Remove verbose CTL messages.
mav [Sun, 16 Aug 2015 00:35:48 +0000 (00:35 +0000)]
MFC r286514: Remove verbose CTL messages.

Reporting SCSI errors to console is often useless, pollutes logs and may
affect performance.  For debugging there is kern.cam.ctl.debug sysctl

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

8 years agoMFC r284779: sh: Fix some arithmetic undefined behaviour.
jilles [Sat, 15 Aug 2015 19:58:00 +0000 (19:58 +0000)]
MFC r284779: sh: Fix some arithmetic undefined behaviour.

Fix shifts of possibly negative numbers found with ubsan and avoid signed
integer overflow when hashing an extremely long command name.

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

8 years agoMFC r270064,r270068,r270069,r270115,r270129,r270287,r270822,r271014,
melifaro [Sat, 15 Aug 2015 17:52:55 +0000 (17:52 +0000)]
MFC r270064,r270068,r270069,r270115,r270129,r270287,r270822,r271014,
  r271524,r273541,r282967,r283009,r283364.

Add support for reading i2c SFP/SFP+ data from NIC driver and
presenting most interesting fields via ifconfig -v.
This version supports Intel ixgbe driver only.

Tested on:      Cisco,Intel,Mellanox,ModuleTech,Molex transceivers

* Add new net/sff8436.h containing constants used to access
  QSFP+ data via i2c inteface. These constants has been taken
  from SFF-8436 "QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER" standard
  rev 4.8.
* Add support for printing QSFP+ information from 40G NICs
  such as Chelsio T5.

Example:
cxl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,.....>
        ether 00:07:43:28:ad:08
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet 40Gbase-LR4 <full-duplex>
        status: active
        plugged: QSFP+ 40GBASE-LR4 (MPO Parallel Optic)
        vendor: OEM PN: OP-QSFP-40G-LR4 SN: 20140318001 DATE: 2014-03-18
        module temperature: 64.06 C voltage: 3.26 Volts
        lane 1: RX: 0.47 mW (-3.21 dBm) TX: 2.78 mW (4.46 dBm)
        lane 2: RX: 0.20 mW (-6.94 dBm) TX: 2.80 mW (4.47 dBm)
        lane 3: RX: 0.18 mW (-7.38 dBm) TX: 2.79 mW (4.47 dBm)
        lane 4: RX: 0.90 mW (-0.45 dBm) TX: 2.80 mW (4.48 dBm)

Tested on:      Chelsio T5
Tested on:      Mellanox/Huawei passive/active cables/transceivers.

Sponsored by:   Yandex LLC

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

8 years agoMFC r286456: Remove some code duplication.
mav [Sat, 15 Aug 2015 11:08:30 +0000 (11:08 +0000)]
MFC r286456: Remove some code duplication.

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

8 years agoMFC r286447:
mav [Sat, 15 Aug 2015 11:05:44 +0000 (11:05 +0000)]
MFC r286447:
Don't panic if disk lost TRIM support due to switching to PIO mode.

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

8 years agoMFC r285842: truss: follow pdfork()ed descendents with -f
emaste [Fri, 14 Aug 2015 21:44:42 +0000 (21:44 +0000)]
MFC r285842: truss: follow pdfork()ed descendents with -f

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

8 years agoMFC r286404:
kib [Fri, 14 Aug 2015 12:23:20 +0000 (12:23 +0000)]
MFC r286404:
The condition to use direct processing for the unmapped bio is reverted.

MFC r286405:
Minor style cleanup of the code surrounding r286404.

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

8 years agoCall stable/10 STABLE again, now that 10.2-RELEASE is out.
gjb [Fri, 14 Aug 2015 12:08:20 +0000 (12:08 +0000)]
Call stable/10 STABLE again, now that 10.2-RELEASE is out.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r286621, r286622: Fix couple minor typos.
mav [Fri, 14 Aug 2015 04:23:17 +0000 (04:23 +0000)]
MFC r286621, r286622: Fix couple minor typos.

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

8 years agoMFC r286615:
pfg [Fri, 14 Aug 2015 02:45:22 +0000 (02:45 +0000)]
MFC r286615:
Clean up some externally visible "more then" occurences

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

8 years agoPrune the 10-STABLE release notes page after 10.2-RELEASE.
gjb [Fri, 14 Aug 2015 00:19:09 +0000 (00:19 +0000)]
Prune the 10-STABLE release notes page after 10.2-RELEASE.

Sponsored by: The FreeBSD Foundation

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

8 years agoMFC of 286750,tzdata10:
edwin [Thu, 13 Aug 2015 23:59:53 +0000 (23:59 +0000)]
MFC of 286750,tzdata10:

Update to tzdata2015f:

Changes affecting future time stamps

    North Korea switches to +0830 on 2015-08-15.  (Thanks to Steffen Thorsen.)
    The abbreviation remains "KST".  (Thanks to Robert Elz.)
    Uruguay no longer observes DST.  (Thanks to Steffen Thorsen and Pablo Camargo.)
    Changes affecting past and future time stamps
    Moldova starts and ends DST at 00:00 UTC, not at 01:00 UTC. (Thanks to Roman Tudos.)

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

8 years agoMFC r262670 (marcel):
gjb [Thu, 13 Aug 2015 22:29:26 +0000 (22:29 +0000)]
MFC r262670 (marcel):
  Use ${MAKE} so that we always use the same version/implementation
  of make(1).

PR: 202277
Submitted by: John Hein
Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r276282: Support ALT_BREAK_TO_DEBUGGER in vt(4)
emaste [Thu, 13 Aug 2015 19:48:19 +0000 (19:48 +0000)]
MFC r276282: Support ALT_BREAK_TO_DEBUGGER in vt(4)

PR: 196511

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

8 years agoFix the gnome package name.
gjb [Thu, 13 Aug 2015 19:04:41 +0000 (19:04 +0000)]
Fix the gnome package name.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

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

8 years agoDocument a known issue with the VirtualBox Vagrant provider failing
gjb [Thu, 13 Aug 2015 18:50:54 +0000 (18:50 +0000)]
Document a known issue with the VirtualBox Vagrant provider failing
to boot on the first invocation of 'vagrant up'.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

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

8 years agoUpdate the errata article.xml file for 10.2-RELEASE.
gjb [Thu, 13 Aug 2015 18:41:53 +0000 (18:41 +0000)]
Update the errata article.xml file for 10.2-RELEASE.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

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

8 years agoPrune Security Advisories and Errata Notices from the 10.2-RELEASE
gjb [Thu, 13 Aug 2015 18:40:32 +0000 (18:40 +0000)]
Prune Security Advisories and Errata Notices from the 10.2-RELEASE
errata page.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

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

8 years agoUpdate FreeBSD version numbers in preparation of properly creating
gjb [Thu, 13 Aug 2015 18:39:32 +0000 (18:39 +0000)]
Update FreeBSD version numbers in preparation of properly creating
the 10.2-RELEASE errata.html page.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

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

8 years agoMFC r286074:
pfg [Thu, 13 Aug 2015 01:02:57 +0000 (01:02 +0000)]
MFC r286074:
GCC: Add a new option "-fstack-protector-strong"

This includes additional functions to be protected: those that
have local array definitions, or have references to local frame
addresses. This is a new option in GCC-4.9 that was relicensed
by Han Shen from Google under GPLv2.

Obtained from: OpenBSD (2014-01-14)

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

8 years agoMFC r273081
sbruno [Wed, 12 Aug 2015 22:51:08 +0000 (22:51 +0000)]
MFC r273081
brueffer: New sentence -> new line; use macros where appropriate.

MFC r276345
Mikhail <mp@lenta.ru
Correct naming of sysctl pmtud_blackhole_activated_min_mss.

Clarify some statements around PMTUD blackhole detection to make
the behavior more clear in the man page.

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

8 years agoMFC r286519:
dim [Wed, 12 Aug 2015 19:18:54 +0000 (19:18 +0000)]
MFC r286519:

In GNU as, avoid left-shifting negative integers, which is undefined.

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

8 years agoMFC r286515:
dim [Wed, 12 Aug 2015 19:06:35 +0000 (19:06 +0000)]
MFC r286515:

In libm's exp2(3), avoid left-shifting a negative integer, which is
undefined.  Replace it with the intended value, in a defined way.

Reviewed by: bde

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

8 years agoDirect commit
imp [Wed, 12 Aug 2015 16:53:37 +0000 (16:53 +0000)]
Direct commit

When compiling on -current from r284356 to r285986, the host's
crunchgen can't be used because builds of rescue break when STRIP= was
used to prevent stripping of binaries.  Direct commit because -current
code is different. Building 10 on current is common enough to warrnat
a safety belt since this has been broken for two months. The offending
change was never in stable/10.

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

8 years agoMFC r257077:
garga [Tue, 11 Aug 2015 16:01:34 +0000 (16:01 +0000)]
MFC r257077:

Cleanup empty directories

PR: 167133
Approved by: loos
Sponsored by: Netgate

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

8 years agoMFC 256710:
garga [Tue, 11 Aug 2015 15:53:11 +0000 (15:53 +0000)]
MFC 256710:

Add lot of missed files and dirs

Approved by: loos
Sponsored by: Netgate

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

8 years agoMFC r286451:
garga [Tue, 11 Aug 2015 15:25:08 +0000 (15:25 +0000)]
MFC r286451:

Add missing files to sendmail obsolete files list

Approved by: gshapiro
Sponsored by: Netgate
Differential Revision: https://reviews.freebsd.org/D3302

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

8 years agoMerge r285891:
rodrigc [Tue, 11 Aug 2015 01:51:38 +0000 (01:51 +0000)]
Merge r285891:

Pass unsigned long argument to ioctl().

Eliminates "ioctl sign-extension" warnings.

PR:             200896

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

8 years agoMFC r284649: fts_children: preserve errno after running close/fchdir
jilles [Sun, 9 Aug 2015 15:53:02 +0000 (15:53 +0000)]
MFC r284649: fts_children: preserve errno after running close/fchdir

PR: 200942
Submitted by: Conrad Meyer

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

8 years agoMFC: r285260
rmacklem [Sat, 8 Aug 2015 22:06:07 +0000 (22:06 +0000)]
MFC: r285260
Since the case where secflavor < 0 indicates the security flavor is
to be negotiated, it could be a Kerberized mount. As such, filling
in the "principal" argument using the canonized host name makes sense.
If it is negotiated as AUTH_SYS, the "principal" argument is meaningless
but harmless.

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

8 years agoMFC: Reminder to check tools/build/mk/OptionalObsoleteFiles.inc on new
gshapiro [Sat, 8 Aug 2015 16:30:20 +0000 (16:30 +0000)]
MFC: Reminder to check tools/build/mk/OptionalObsoleteFiles.inc on new
     version imports.

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

8 years agoMFC r286106:
kib [Fri, 7 Aug 2015 04:38:13 +0000 (04:38 +0000)]
MFC r286106:
Provide a prefaulting for the userspace i/o buffers, disabled by default.

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

8 years agoMFC r285384:
kib [Fri, 7 Aug 2015 04:33:06 +0000 (04:33 +0000)]
MFC r285384:
Do not allow creation of the dirty buffers for the dead buffer objects.

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

8 years agoMFC r285643:
kib [Fri, 7 Aug 2015 04:31:02 +0000 (04:31 +0000)]
MFC r285643:
When checking for the valid value of the frame pointer, verify that it
belongs to the kernel stack address range for the thread.

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