199287 Commits

Author SHA1 Message Date
slm
ceb5f63b1a MFC: r283661
- Updated all files with 2015 Avago copyright, and updated LSI's copyright
  dates.

- Changed all of the PCI device strings from LSI to Avago Technologies (LSI).

- Added a sysctl variable to control how StartStopUnit behavior works. User can
  select to spin down disks based on if disk is SSD or HDD.

- Inquiry data is required to tell if a disk will support SSU at shutdown or
  not. Due to the addition of mprssas_async, which gets Advanced Info but not
  Inquiry data, the setting of supports_SSU was moved to the
  mprsas_scsiio_complete function, which snoops for any Inquiry commands. And,
  since disks are shutdown as a target and not a LUN, this process was
  simplified by basing it on targets and not LUNs.

- Added a sysctl variable that sets the amount of time to retry after sending a
  failed SATA ID command. This helps with some bad disks and large disks that
  require a lot of time to spin up. Part of this change was to add a callout to
  handle timeouts with the SATA ID command. The callout function is called
  mprsas_ata_id_timeout(). (Fixes PR 191348)

- Changed the way resets work by allowing I/O to continue to devices that are
  not currently under a reset condition. This uses devq's instead of simq's and
  makes use of the MPSSAS_TARGET_INRESET flag. This change also adds a function
  called mprsas_prepare_tm().

- Some changes were made to reduce code duplication when getting a SAS address
  for a SATA disk.

- Fixed some formatting and whitespace.

- Bump version of mpr driver to 9.255.01.00-fbsd

PR:		191348
2015-06-04 16:27:18 +00:00
rmacklem
7e70fa5ddf MFC: r283273
The NFS client wasn't handling getdirentries(2) requests for sizes
that are not an exact multiple of DIRBLKSIZ correctly. Fortunately
readdir(3) always uses an exact multiple of DIRBLKSIZ, so few applications
were affected. This patch fixes this problem by reducing the size
of the directory read to an exact multiple of DIRBLKSIZ.
2015-06-04 12:35:00 +00:00
pkelsey
b8022a7806 MFC r283641:
Add CAP_FCNTL to the lease file capsicum rights, and limit to
CAP_FCNTL_GETFL.  Without CAP_FCNTL_GETFL, the lease file truncation
in rewrite_client_leases() will fail to trim old data when rewriting
the file with a lesser amount of data.
2015-06-04 04:54:54 +00:00
pkelsey
82415e4370 MFC r283652:
Provide an unambiguous description of the potential hazard in calling
pthread_setspecific(3) from a key destructor.
2015-06-04 04:50:52 +00:00
ian
ada95a851c MFC r262955:
Add 3wire and std as terminal types/classes. These are similar to
the existing terminal types/classes that have the baudrate suffix,
but differ in that no baudrate is set/defined.
2015-06-04 01:52:17 +00:00
dteske
f38383848a MFC r268254 (jmg):
Add a hint that you can enable this by default if you want;
necessary if you want the keyboard break to work early in boot.
2015-06-03 22:24:57 +00:00
emaste
d77c39991b MFC r259438 by pjd: Fix syscalls that can be loaded as kernel modules
They were not given the flag allowing to call them from capability
  mode sandbox.

And regenerate init_sysent.c

Sponsored by:	The FreeBSD Foundation
2015-06-03 18:33:47 +00:00
tuexen
e9ec710324 MFC r283784:
Remove trailing whitespaces.

MFC r283785:
Require the embedded packet to contain 8 bytes after the IP header instead
of only 4. This is guaranteed by RFC 792 and the verification of GRE, ICMP
and TCP packets use 8 bytes.

MFC r283786:
There is no payload anymore. So compute the minimum packet length
correctly and use 40 as the default (if the minumum allows it), as
specified in the man page.

MFC r283806:
When the packet verification fails in verbose mode, print the correct
number of words in host byte order. Also remove a stray 'x'.

MFC r283808:
Don't send malformed SCTP probe packets.

MFC r283813:
Use an empty string for field descriptions of unknown protocols.

MFC r283817:
Don't send illegal packets when using UDP-Lite.

MFC r283819:
A TCP checksum of 0 is completely valid. Mapping 0 to 0xffff only
applies to UDP and UDP-Lite.

MFC r283820:
The code starts with base + 1 as the first port. Fix to documentation
to match that.
2015-06-03 17:45:45 +00:00
hselasky
cec9850b29 MFC r283103:
Fix for DWC OTG device side isochronous transfers. The even or odd
isochronous frame bit needs to be flipped.
2015-06-03 15:41:03 +00:00
hselasky
79cd6230a5 MFC r282650 and r282651:
Extend the maximum number of allowed PCM channels in a PCM stream to
127 and decrease the maximum number of sub-channels to 1. These
definitions are only used inside the kernel and can be changed later
if more than one sub-channel is desired. This has been done to allow
so-called USB audio rack modules to work with FreeBSD.

Add support for more than 8 audio channels per PCM stream for USB
audio class compliant devices under FreeBSD. Tested using 16 recording
and 16 playback audio channels simultaneously.

Bump the FreeBSD version to force recompiling all external modules.
2015-06-03 15:32:43 +00:00
emaste
02441119bc MFC r261220 by csjp: Allow sigwait(2) in capabilities mode.
It's common for multi-threaded processes to create a thread for
  the purpose of synchronously processing signals. Allow such processes to
  utilize a capabilities sandbox.
2015-06-03 13:12:08 +00:00
emaste
e6fee85e82 MFC r259436,259437 by pjd: Allow for pselect(2) in capability mode. 2015-06-03 13:10:25 +00:00
emaste
d97b35fcad Regen for r283940. 2015-06-03 11:39:29 +00:00
emaste
2c4dd777cb MFC r257736 (by pjd):
- Remove mac_get_fd/mac_set_fd - those are not syscalls. The
    __mac_get_fd() and __mac_set_fd() syscalls are listed earlier.
  - Correct typo in syscall name. It should be sched_rr_get_interval,
    not sched_rr_getinterval.
2015-06-03 11:36:47 +00:00
ae
78931b5bd8 MFC r283146:
In the reply to SADB_X_SPDGET message use the same sequence number that
  was in the request. Some IKE deamons expect it will the same. Linux and
  NetBSD also follow this behaviour.

  PR:		137309
2015-06-03 02:50:58 +00:00
imp
44bead40e5 MFC:
r283014: Disable unmapped I/O: it is broken for unaligned pages
r283126: Fix comments
2015-06-02 21:36:45 +00:00
imp
a5587d67f9 MFC:
Merge r276846: Add infrastructure to build dtb files from dts files.
2015-06-02 21:24:47 +00:00
pjd
fb6b5e38d8 MFC r265950 (by thomas):
Add mention of metadata version 7 in FreeBSD 10.0.
2015-06-02 20:29:58 +00:00
jhb
017f11d1f3 MFC 281887:
Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.
2015-06-02 19:20:39 +00:00
jhb
042166d482 MFC 282417:
Various updates to the ftruncate(2) documentation:
- Note that ftruncate(2) can operate on shared memory objects and cross
  reference shm_open(2).
- Note that ftruncate(2) does not change the file position pointer (aka
  seek pointer) of the file descriptor.
- ftruncate(2) will fail with EINVAL for all sorts of other fd types than
  just sockets, so instead note that it fails for all but regular files and
  shared memory objects.
- Note that ftruncate(2) also appeared in 4.2BSD along with truncate(2).
  (Or at least the manpage for both appeared in 4.2, I did not check the
  kernel code itself to see if either predated 4.2.)

PR:		199472
2015-06-02 15:12:33 +00:00
jhb
f2e617bb8a MFC 282416:
Partially revert r255486, the first argument to socketpair() is a socket
domain, not a file descriptor.  Use 'domain' instead of the original 'd'
for this argument to match socket(2).

PR:		199491
2015-06-02 15:09:33 +00:00
jhb
91b174b8cf MFC 282552:
Remove the note about seekdir() removing telldir() cookies.  That was
removed back in r269204.
2015-06-02 15:07:06 +00:00
jhb
dfdf80b57a MFC 281170:
vfork() first appeared in 3BSD which pre-dates 2.9BSD.  Verified via the
copy of 3BSD on disc 1 of "The CSRG Archives".

PR:		198612
2015-06-02 15:02:28 +00:00
jhb
a5ce7c460f MFC 281601:
Remove THRMISC_VERSION.  The thrmisc structure doesn't include a version
number, so this wasn't used (and can't easily be added).  If at some point
we want to extend thrmisc, we will probably need to just add a new note
type and ensure that the new type includes a version number.
2015-06-02 14:55:55 +00:00
jhb
cb2edec922 MFC 281266:
Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>
and export them to userland.
- Define __HAVE_REG32 on platforms that define a reg32 structure and check
  for this in <sys/procfs.h> to control when to export prstatus32, etc.
- Add prstatus32_t and prpsinfo32_t typedefs for the 32-bit structures.
  libbfd looks for these types, and having them fixes 'gcore' in gdb of a
  32-bit process on a 64-bit platform.
- Use the structure definitions from <sys/procfs.h> in gcore's elf32 core
  dump code instead of duplicating the definitions.
2015-06-02 14:54:53 +00:00
jhb
c89b9bba43 MFC 269128:
Create 32-bit core files for 32-bit processes on 64-bit machines.
The 64-bit machine supported right now is amd64, but it's not too
hard to add powerpc64.
2015-06-02 13:07:22 +00:00
tijl
3fe26be600 MFC r283406,283418:
Fix decoding of UTF-7 when a base64 encoded chunk appears at the end of
the input buffer.

_citrus_UTF7_mbtoutf16 stored the decoder state at the beginning so it
could restore this state on an incomplete character such that the next
call would restart the decoding.  The problem was that "-" (end of base64
mode) at the end of a string was also treated as an incomplete character
but was also removed from the state buffer.  So the initial state would be
restored (with base64 mode) and the next call would no longer see the "-"
so it continued in base64 mode.

This state saving/restoring isn't needed here.  It's already handled
elsewhere (citrus_iconv_std.c:_citrus_iconv_std_iconv_convert) so just
remove it.

Also initialise *nresult.

When only 2 bytes can be read from a 4 byte UTF-16 character in a base64
encoded chunk of a UTF-7 string, treat that as an incomplete character and
return an error instead of a shift sequence and no error.

Also check that the low 2 bytes have a valid value.

PR:		200398
2015-06-02 09:42:00 +00:00
hiren
651b599a09 MFC: r282866
Fix pmcstat symbol resolution for userland processes.

When examining existing processes pmcstat fails to
correctly determine the locations of executable sections
of the process due to a miscalculated virtual load address.
This does not affect the newly launched processes as the
same value passed as a "start address" to the pmcstat_image_link()
thus nullifying the effect of it.  The issue manifests itself
in processes not being reported in the pmcstat(8) output and
"dubious frames" being reported.

Fix it for now by ignoring all the sections except the executable
one.  This won't fix the issue for objects with multiple
executable sections but helps in majority of real world usecases.
The real solution would be to modify the MAP-IN event to include
the appropriate load address so pmcstat(8) won't have to manually
parse object files to try to determine it.

PR:		198147, 198148
Submitted by:	stas
2015-06-02 08:03:28 +00:00
ae
3c9fd21963 MFC r283101:
Teach key_expire() send SADB_EXPIRE message with the SADB_EXT_LIFETIME_HARD
  extension header type. The key_flush_sad() now will send SADB_EXPIRE
  message when HARD lifetime expires. This is required by RFC 2367 and some
  keying daemons rely on these messages. HARD lifetime messages have
  precedence over SOFT lifetime messages, so now they will be checked first.
  Also now SADB_EXPIRE messages will be send even the SA has not been used,
  because keying daemons might want to rekey such SA.

  PR:		200282, 200283

MFC r283102:
  Change SA's state before sending SADB_EXPIRE message. This state will
  be reported to keying daemon.
2015-06-02 03:51:33 +00:00
ae
bf9acc9587 MFC r275390:
Remove unused declartations.

MFC r275437:
  ANSIfy function declarations.

MFC r275438:
  Remove __P() macro.

Sponsored by:	Yandex LLC
2015-06-02 03:43:36 +00:00
ae
fcbaea9548 MFC r275392:
Remove route chaching support from ipsec code. It isn't used for some time.
  * remove sa_route_union declaration and route_cache member from struct secashead;
  * remove key_sa_routechange() call from ICMP and ICMPv6 code;
  * simplify ip_ipsec_mtu();
  * remove #include <net/route.h>;

Sponsored by:	Yandex LLC
2015-06-02 03:14:42 +00:00
ae
f780971d93 MFC r283104:
Read GEOM_UNCOMPRESS metadata using several requests that fit into
  MAXPHYS. For large compressed images the metadata size can be bigger
  than MAXPHYS and this triggers KASSERT in g_read_data().
  Also use g_free() to free memory allocated by g_read_data().

  PR:		199476
2015-06-02 02:05:32 +00:00
ae
8fe024e563 MFC r283577:
Print leading zeroes of UFS2 fs_id like we do for UFS1.

PR:		156908
2015-06-02 01:55:54 +00:00
jkim
045ad2b6bb MFC: r283261
Do not probe Intel PIIX4 south bridge quirks on amd64.
2015-06-01 19:26:24 +00:00
jhb
34dd7e04e0 MFC 283123:
Fix two bugs that could result in PMC sampling effectively stopping.
In both cases, the the effect of the bug was that a very small positive
number was written to the counter. This means that a large number of
events needed to occur before the next sampling interrupt would trigger.
Even with very frequently occurring events like clock cycles wrapping all
the way around could take a long time. Both bugs occurred when updating
the saved reload count for an outgoing thread on a context switch.

First, the counter-independent code compares the current reload count
against the count set when the thread switched in and generates a delta
to apply to the saved count. If this delta causes the reload counter
to go negative, it would add a full reload interval to wrap it around to
a positive value. The fix is to add the full reload interval if the
resulting counter is zero.

Second, occasionally the raw counter value read during a context switch
has actually wrapped, but an interrupt has not yet triggered. In this
case the existing logic would return a very large reload count (e.g.
2^48 - 2 if the counter had overflowed by a count of 2). This was seen
both for fixed-function and programmable counters on an E5-2643.
Workaround this case by returning a reload count of zero.

PR:		198149
Sponsored by:	Norse Corp, Inc.
2015-06-01 18:08:56 +00:00
jhb
ed437ec23c MFC 282643:
Use the kern.bootfile sysctl to set the default kernel path rather than
hardcoding /boot/kernel. This allows pmcstat(8) to work without -k when
using nextboot -k or 'boot foo' at the loader to boot alternate kernels.

Sponsored by:	Norse Corp, Inc.
2015-06-01 18:05:30 +00:00
jhb
7a2aa2a780 MFC 282641,282658:
- Move hwpmc(4) debugging code under a new HWPMC_DEBUG option instead of
  the broader DEBUG option.
- Convert hwpmc(4) debug printfs over to KTR.

Sponsored by:	Norse Corp, Inc.
2015-06-01 17:57:05 +00:00
gjb
7b0fefdcb1 MFC r283673, r283674:
r283673:
  Sort configuration options for consistency with other boards.

 r283674:
  Export 'BOARDNAME' when differs from the KERNCONF.

Sponsored by:	The FreeBSD Foundation
2015-06-01 16:46:51 +00:00
smh
3236725806 MFC r282208:
Standardise chmod, chflags, chown and chgrp recursive symlink processing

Relnotes:	Yes
Sponsored by:	Multiplay
2015-06-01 09:04:57 +00:00
kib
082794a940 MFC r283515:
Remove excess Giant acquisition around the dounmount() call.
2015-06-01 06:56:49 +00:00
dteske
d2338369a2 MFC SVN revisions 280310-280311,281160,281167,282443,283023,283288:
r280310: Whitespace cleanup(s)
r280311: Update copyright(s)
r281160: [mergeinfo only] Fix root encryption key permissions (see r281230)
r281167: [mergeinfo only] Unbreak ZFS+GELI install option (see r281230)
r282443: Add swap size sanity check (allanjude)
r283023: Skip adding swap to fstab(5) if unused (allanjude)
r283288: Fix a syntax error (allanjude)
2015-06-01 01:50:09 +00:00
dteske
274e0fc8a5 MFC SVN revisions 280234-280235:
r280234: Fix the handbook install option in bsdinstall (allanjude)
r280235: Fixup to previous (allanjude)
2015-06-01 01:31:50 +00:00
dteske
7cf02110b8 MFC SVN revisions 272278,272379,275874:
r272278: Prevent buffer overflow(s) + style(9) nits
r272379: Optimize program performance + style(9) nits
r275874: Improve feedback to user by using dpv(3)
2015-06-01 01:06:33 +00:00
dteske
88051ad98d MFC r280921: Fix typo in a comment. 2015-06-01 00:09:21 +00:00
np
b62b670049 MFC r273480, r273750, r273753, r273797, and r274461.
r273480:
cxgbe/iw_cxgbe: wake up waiters after flushing the qp.

r273750:
Some cxgbe/iw_cxgbe fixes:
- Free rt in c4iw_connect only if it is allocated.
- Call soclose instead of so_shutdown if there is an abort from the peer.
- Close socket and return failure if TOE is not enabled.

r273753:
iwcm_event status needs to be populated for close_complete_upcall

r273797:
Always request a completion for every work request for iWARP.  The
initial MPA exchange must be tracked this way so that t4_tom's state for
the tid is all clean at the time the tid transitions to RDMA mode.  Once
it does, t4_tom is out of the way and iw_cxgbe uses the qp endpoints
directly.

r274461:
iw_cxgbe: don't forget to close the socket in c4iw_connect if soconnect
fails.
2015-05-31 23:47:08 +00:00
ae
e38e54f9c4 MFC r283313:
Properly update TX statistics for wlan(4).
  ieee80211_pwrsave() can fail due to queue overflow, check its return code
  and increment oerrors counter when it fails. Also handle more error cases
  and update oerrors counter when we don't send mbuf due to some errors.
  Return ENETDOWN when parent interface isn't ready. Update obytes and omcasts
  counters in corresponding places.

PR:		184626
Differential Revision:	https://reviews.freebsd.org/D2621
2015-05-31 23:29:04 +00:00
np
5b5fec6948 MFC r272719:
cxgbe/tom: don't leak resources tied to an active open request that
cannot be sent to the chip because a prerequisite L2 resolution
failed.
2015-05-31 23:11:25 +00:00
ngie
c6889f35c8 MFC r283147:
Build cddl/{sbin,usr.bin,usr.sbin} in parallel as all of the applications are
freestanding (they require libraries build via make libraries in buildworld)

Sponsored by: EMC / Isilon Storage Division
2015-05-31 23:00:35 +00:00
ae
8272d42d32 MFC r282965:
Add an ability accept encapsulated packets from different sources by one
  gif(4) interface. Add new option "ignore_source" for gif(4) interface.
  When it is enabled, gif's encapcheck function requires match only for
  packet's destination address.

  Differential Revision:	https://reviews.freebsd.org/D2004
  Sponsored by:	Yandex LLC
2015-05-31 22:58:41 +00:00
ngie
b6f9f373d0 MFC r283357:
Remove directory for test that has been integrated in under tests/sys/...
2015-05-31 22:56:03 +00:00