]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC r324347: MFV r316933: 5142 libzfs support raidz root pool (loader project)
avg [Mon, 30 Oct 2017 10:32:36 +0000 (10:32 +0000)]
MFC r324347: MFV r316933: 5142 libzfs support raidz root pool (loader project)

FreeBSD note: we have long supported this feature, this commit only
removes a small difference in libzfs.

6 years agoMFC r324346: MFV r316931: 6268 zfs diff confused by moving a file to another directory
avg [Mon, 30 Oct 2017 10:29:26 +0000 (10:29 +0000)]
MFC r324346: MFV r316931: 6268 zfs diff confused by moving a file to another directory

6 years agoMFC r324345: MFV r316877: 7571 non-present readonly numeric ZFS props do not have...
avg [Mon, 30 Oct 2017 09:01:02 +0000 (09:01 +0000)]
MFC r324345: MFV r316877: 7571 non-present readonly numeric ZFS props do not have default value

6 years agoMFC r324344: MFV r316864: 6392 zdb: introduce -V for verbatim import
avg [Mon, 30 Oct 2017 08:58:39 +0000 (08:58 +0000)]
MFC r324344: MFV r316864: 6392 zdb: introduce -V for verbatim import

6 years agoMFC r324343: MFV r316862: 6410 teach zdb to perform object lookups by path
avg [Mon, 30 Oct 2017 08:56:39 +0000 (08:56 +0000)]
MFC r324343: MFV r316862: 6410 teach zdb to perform object lookups by path

6 years agoMFC r324011, r324016: MFV r323535: 8585 improve batching done in zil_commit()
avg [Mon, 30 Oct 2017 08:53:15 +0000 (08:53 +0000)]
MFC r324011, r324016: MFV r323535: 8585 improve batching done in zil_commit()

FreeBSD notes:
- this MFV reverts FreeBSD commit r314549 to make the merge easier
- at present our emulation of cv_timedwait_hires is rather poor,
  so I elected to use cv_timedwait_sbt directly
Please see the differential revision for details.
Unfortunately, I did not get any positive reviews, so there could be
bugs in the FreeBSD-specific piece of the merge.
Hence, the long MFC timeout.

illumos/illumos-gate@1271e4b10dfaaed576c08a812f466f6e81370e5e
https://github.com/illumos/illumos-gate/commit/1271e4b10dfaaed576c08a812f466f6e81370e5e

https://www.illumos.org/issues/8585
  The current implementation of zil_commit() can introduce significant
  latency, beyond what is inherent due to the latency of the underlying
  storage. The additional latency comes from two main problems:
  1. When there's outstanding ZIL blocks being written (i.e. there's
      already a "writer thread" in progress), then any new calls to
      zil_commit() will block waiting for the currently oustanding ZIL
      blocks to complete. The blocks written for each "writer thread" is
      coined a "batch", and there can only ever be a single "batch" being
      written at a time. When a batch is being written, any new ZIL
      transactions will have to wait for the next batch to be written,
      which won't occur until the current batch finishes.
  As a result, the underlying storage may not be used as efficiently
      as possible. While "new" threads enter zil_commit() and are blocked
      waiting for the next batch, it's possible that the underlying
      storage isn't fully utilized by the current batch of ZIL blocks. In
      that case, it'd be better to allow these new threads to generate
      (and issue) a new ZIL block, such that it could be serviced by the
      underlying storage concurrently with the other ZIL blocks that are
      being serviced.
  2. Any call to zil_commit() must wait for all ZIL blocks in its "batch"
      to complete, prior to zil_commit() returning. The size of any given
      batch is proportional to the number of ZIL transaction in the queue
      at the time that the batch starts processing the queue; which
      doesn't occur until the previous batch completes. Thus, if there's a
      lot of transactions in the queue, the batch could be composed of
      many ZIL blocks, and each call to zil_commit() will have to wait for
      all of these writes to complete (even if the thread calling
      zil_commit() only cared about one of the transactions in the batch).

Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

6 years agoMFC r324926:
kib [Mon, 30 Oct 2017 08:25:24 +0000 (08:25 +0000)]
MFC r324926:
Expand explanation of atomicity.

6 years agoMFC r324868:
markj [Sun, 29 Oct 2017 14:57:58 +0000 (14:57 +0000)]
MFC r324868:
Delete declarations of struct pfs_bitmap, removed in r143841.

6 years agoMFC r324853:
kib [Sun, 29 Oct 2017 09:38:42 +0000 (09:38 +0000)]
MFC r324853:
Remove the support for mknod(S_IFMT), which created dummy vnodes with
VBAD type.

6 years agoSync (make same) the offsetof macro definition in include/ with the
cy [Sun, 29 Oct 2017 04:33:50 +0000 (04:33 +0000)]
Sync (make same) the offsetof macro definition in include/ with the
definition of the same in sys/sys/. The problem was discovered while
working on implementing a new C11 gets_s() for libc. (The new gets_s()
requires rsize_t found in include/stddef.h.) The solution to sync the two
definitions was suggested by ed@ while discussing D12667.

Suggested by: ed

6 years agoMFC 324721: Add references to sysrc(8) to SEE ALSO.
se [Sat, 28 Oct 2017 07:06:30 +0000 (07:06 +0000)]
MFC 324721: Add references to sysrc(8) to SEE ALSO.
MFC 324823: Mention sysrc(8) as scripting interface for config files.

6 years agoMFC r316304 (by tychon):
kib [Fri, 27 Oct 2017 15:33:26 +0000 (15:33 +0000)]
MFC r316304 (by tychon):
Reorder includes to placate MIPS build.

Reported and tested by: David Wolfskill

6 years agoMFC r324804:
markj [Fri, 27 Oct 2017 14:24:35 +0000 (14:24 +0000)]
MFC r324804:
Avoid the nbp lookup in the final loop iteration in flushbuflist().

6 years agoMFC r324809:
markj [Fri, 27 Oct 2017 14:22:56 +0000 (14:22 +0000)]
MFC r324809:
Free the right address range if kmem_back() fails in memguard_alloc().

6 years agoMFC r324793:
kib [Fri, 27 Oct 2017 08:53:09 +0000 (08:53 +0000)]
MFC r324793:
In vm_page_free_phys_pglist(), do not take vm_page_queue_free_mtx if
there is nothing to do.

6 years agoMFC r320481:
bdrewery [Fri, 27 Oct 2017 04:38:42 +0000 (04:38 +0000)]
MFC r320481:

  Store a 32-bit PT_LWPINFO struct for 32-bit process core dumps.

6 years agoMFC r314914:
ian [Thu, 26 Oct 2017 22:19:28 +0000 (22:19 +0000)]
MFC r314914:

Release all previously allocated resources.

6 years agoMFC r323692,r323710,r323714,r324628,r324629,r324635,r324636,r324637
tijl [Thu, 26 Oct 2017 17:45:01 +0000 (17:45 +0000)]
MFC r323692,r323710,r323714,r324628,r324629,r324635,r324636,r324637

Merge Linux emulation changes to support newer Linux libdrm.

6 years agoMFC r324281:
asomers [Wed, 25 Oct 2017 22:25:32 +0000 (22:25 +0000)]
MFC r324281:

Display rotation rate and TRIM/UNMAP support in diskinfo(8)

Bump __FreeBSD_version due to the expansion of struct diocgattr_arg.

Reviewed by: mav, allanjude, imp
Relnotes: yes
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12578

6 years agoMFC: r324506
rmacklem [Wed, 25 Oct 2017 19:27:12 +0000 (19:27 +0000)]
MFC: r324506
Fix forced dismount when a pNFS mount is hung on a DS.

When a "pnfs" NFSv4.1 mount is hung because of an unresponsive DS,
a forced dismount wouldn't work, because the RPC socket for the DS
was not being closed. This patch fixes this.
This will only affect "pnfs" mounts where the pNFS server's DS
is unresponsive (crashed or network partitioned or...).
Found during testing of the pNFS server.

6 years agoMFC r324223:
asomers [Wed, 25 Oct 2017 15:18:09 +0000 (15:18 +0000)]
MFC r324223:

MFV r319743:   8108 zdb -l fails to read labels 2 and 3

illumos/illumos-gate@22c8b9583d07895c16549075a53668d7bc988cf3
https://github.com/illumos/illumos-gate/commit/22c8b9583d07895c16549075a53668d7bc988cf3

https://www.illumos.org/issues/8108

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

6 years agoMFC r324222:
asomers [Wed, 25 Oct 2017 15:15:09 +0000 (15:15 +0000)]
MFC r324222:

MFV r316863: 3871 fix issues introduced by 3604

illumos/illumos-gate@de05b58863498b10283637eb9ac85e92fe85150e
https://github.com/illumos/illumos-gate/commit/de05b58863498b10283637eb9ac85e92fe85150e

https://www.illumos.org/issues/3871
  GCC 4.5.3 on Gentoo Linux did not like a few of the changes made in the issue
  3604 patch. It printed an error and a couple of warnings:
  ../../cmd/zdb/zdb.c: In function 'dump_bpobj':
  ../../cmd/zdb/zdb.c:1257:3: error: 'for' loop initial declarations are only
  allowed in C99 mode
  ../../cmd/zdb/zdb.c:1257:3: note: use option -std=c99 or -std=gnu99 to compile
  your code
  ../../cmd/zdb/zdb.c: In function 'dump_deadlist':
  ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format
  ../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Richard Yao <ryao@gentoo.org>

6 years agoMFC r324221:
asomers [Wed, 25 Oct 2017 15:11:08 +0000 (15:11 +0000)]
MFC r324221:

MFV r316861: 6866 zdb -l should return non-zero if it fails to find any label

illumos/illumos-gate@64723e361134b2a2c45341334174f9d34002f8d0
https://github.com/illumos/illumos-gate/commit/64723e361134b2a2c45341334174f9d34002f8d0

https://www.illumos.org/issues/6866
  Need this for #6865.
  To be generally more scripting-friendly, overload this issue with adding '-q'
  option which should skip printing any label information.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

6 years agoMFC r324220:
asomers [Wed, 25 Oct 2017 14:45:56 +0000 (14:45 +0000)]
MFC r324220:

MFV r316858 7280 Allow changing global libzpool variables in zdb

7280 Allow changing global libzpool variables in zdb and ztest through command line

illumos/illumos-gate@0e60744c982adecd0a1f146f5637475d07ab1069
https://github.com/illumos/illumos-gate/commit/0e60744c982adecd0a1f146f5637475d07ab1069

https://www.illumos.org/issues/7280
  zdb is very handy for diagnosing problems with a pool in a safe and
  quick way. When a pool is in a bad shape, we often want to disable some
  fail-safes, or adjust some tunables in order to open them. In the
  kernel, this is done by changing public variables in mdb. The goal of
  this feature is to add the same capability to zdb and ztest, so that
  they can change libzpool tuneables from the command line.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

6 years agoMFC r324704:
markj [Wed, 25 Oct 2017 01:07:45 +0000 (01:07 +0000)]
MFC r324704:
Fix a racy VI_DOOMED check in MNT_VNODE_FOREACH_ALL().

6 years agoMFC r324257-r324258
manu [Tue, 24 Oct 2017 14:33:38 +0000 (14:33 +0000)]
MFC r324257-r324258

r324257:
mountd: Convert exportlist to SLIST

Use SLIST from sys/queue.h instead of homebrew linked list for the exportlist.

Reviewed by: bapt, rmacklem
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D12502

r324258:
mountd: Convert mountlist to SLIST

Use SLIST from sys/queue.h instead of homebrew linked list for mountlist.

Reviewed by: bapt, rmacklem
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D12504

6 years agoMFC r324179, r324193:
jch [Tue, 24 Oct 2017 08:56:11 +0000 (08:56 +0000)]
MFC r324179, r324193:

r324179:

Fix an infinite loop in tcp_tw_2msl_scan() when an INP_TIMEWAIT inp has
been destroyed before its tcptw with INVARIANTS undefined.

This is a symmetric change of r307551:

A INP_TIMEWAIT inp should not be destroyed before its tcptw, and INVARIANTS
will catch this case.  If INVARIANTS is undefined it will emit a log(LOG_ERR)
and avoid a hard to debug infinite loop in tcp_tw_2msl_scan().

Reported by:            Ben Rubson, hselasky
Submitted by:           hselasky
Tested by:              Ben Rubson, jch
Sponsored by:           Verisign, inc
Differential Revision:  https://reviews.freebsd.org/D12267

r324193:

Forgotten bits in r324179:  Include sys/syslog.h if INVARIANTS is not defined

6 years agoMFC r324826:
dim [Tue, 24 Oct 2017 06:49:06 +0000 (06:49 +0000)]
MFC r324826:

Pull in r316035 from upstream llvm trunk (by Tim Northover):

  AArch64: account for possible frame index operand in compares.

  If the address of a local is used in a comparison, AArch64 can fold
  the address-calculation into the comparison via "adds".
  Unfortunately, a couple of places (both hit in this one test) are not
  ready to deal with that yet and just assume the first source operand
  is a register.

This should fix an assertion failure while building the test suite of
www/firefox for AArch64.

PR: 223048

6 years agoMFC r318246,r324566,r324668,r324701:
bdrewery [Tue, 24 Oct 2017 00:51:11 +0000 (00:51 +0000)]
MFC r318246,r324566,r324668,r324701:

  r318246:
    Add a regression test for r318191.
  r324566:
    Fix shadowed variable hidden by WARNS changing to 3 in r313006.
  r324668:
    This child is expected to exit on SIGTRAP, don't leave a core behind.
  r324701:
    Add a test for r324671 along with some other masked tests.

6 years agoMFC r324683: write.2: correct maximum nbytes size for EINVAL error
emaste [Tue, 24 Oct 2017 00:32:20 +0000 (00:32 +0000)]
MFC r324683: write.2: correct maximum nbytes size for EINVAL error

In FreeBSD 11 and later debug.iosize_max_clamp defaults to 0, and the
maximum nbytes count for write(2) is SSIZE_MAX. Update the man page to
document this, and mention the sysctl that can be set to obtain the
previous behaviour.

PR: 196666
Sponsored by: The FreeBSD Foundation

6 years agoMFC r324241:
asomers [Mon, 23 Oct 2017 22:50:37 +0000 (22:50 +0000)]
MFC r324241:

Fix copy/paste error in diskinfo.8 from r320555

Sponsored by: Spectra Logic Corp

6 years agoMFC r324671:
kib [Mon, 23 Oct 2017 19:15:51 +0000 (19:15 +0000)]
MFC r324671:
Re-evaluate thread' signal mask after ptracestop().

6 years agoFix struct thread padding field names.
bdrewery [Mon, 23 Oct 2017 19:03:36 +0000 (19:03 +0000)]
Fix struct thread padding field names.

Direct commit to stable/11.

6 years agostruct ksiginfo has MD size, so use it as the padding type to avoid the wrong size.
bdrewery [Mon, 23 Oct 2017 19:00:17 +0000 (19:00 +0000)]
struct ksiginfo has MD size, so use it as the padding type to avoid the wrong size.

This is a direct commit to stable/11 to fix r324932.

Spotted by: kib

6 years agoMFC r316286:
bdrewery [Mon, 23 Oct 2017 18:25:21 +0000 (18:25 +0000)]
MFC r316286:

  Add support for capturing 'struct ptrace_lwpinfo' for signals resulting in a
  process dumping core in the corefile.

  Direct stable changed: Padding added to struct thread and td_si added to end
  with explicit bzeroing when forking/initializing a thread to preserve KBI.

6 years agoMFC r324670:
kib [Mon, 23 Oct 2017 08:14:41 +0000 (08:14 +0000)]
MFC r324670:
Improve assertion that an ignored or blocked signal is not delivered.

6 years agoMFC r324669:
kib [Mon, 23 Oct 2017 08:13:23 +0000 (08:13 +0000)]
MFC r324669:
Style.

6 years agoMFC r324665:
kib [Mon, 23 Oct 2017 08:09:19 +0000 (08:09 +0000)]
MFC r324665:
Fix the pv_chunks pc_lru tailq handling in reclaim_pv_chunk().

6 years agoMFC r324661: Add Creative vendor ID.
mav [Mon, 23 Oct 2017 07:41:44 +0000 (07:41 +0000)]
MFC r324661: Add Creative vendor ID.

6 years agoMFC r324659: Update details of interface capabilities changed by bridge(4).
mav [Mon, 23 Oct 2017 07:39:04 +0000 (07:39 +0000)]
MFC r324659: Update details of interface capabilities changed by bridge(4).

PR: 221122

6 years agoMFC r323772, r324302-r324308, r324310, r324313, r324315, r324326, r324330,
kib [Sun, 22 Oct 2017 08:47:13 +0000 (08:47 +0000)]
MFC r323772, r324302-r324308, r324310, r324313, r324315, r324326, r324330,
    r324334, r324354-r324355, r324366, r324432-r324433, r324437-r324439:
Fixes and improvements for x86 LDT handling.

6 years agoMFC r323860:
oshogbo [Sat, 21 Oct 2017 19:38:36 +0000 (19:38 +0000)]
MFC r323860:
Plug memory leak in case when nvlist allocation succeeds, but nvpair
allocation fails.

Submitted by: pjd@
Sponsored by: Wheel Systems

6 years agoMFC r323858:
oshogbo [Sat, 21 Oct 2017 19:37:25 +0000 (19:37 +0000)]
MFC r323858:
IMHO it is possible that failure will be treated as success because we don't
initialize nvp on every loop iteration and the code under 'fail'(!) label
detects success by checking of nvp != NULL.

Submitted by: pjd@
Sponsored by: Wheel Systems

6 years agoMFC r323856:
oshogbo [Sat, 21 Oct 2017 19:36:22 +0000 (19:36 +0000)]
MFC r323856:
Free 'value' only once we are done freeing all individual

Submitted by: pjd@
Found by: scan-build
Sponsored by: Wheel Systems

6 years agoMFC r323851:
oshogbo [Sat, 21 Oct 2017 19:34:54 +0000 (19:34 +0000)]
MFC r323851:
Remove redundant initialization. Don't use variable - just return the value.
Make scan-build happy by casting to 'void *' instead of 'void **'.

Submitted by: pjd@
Found by:     scan-build and cppcheck
Sponsored by: Wheel Systems

6 years agoMFC r323854:
oshogbo [Sat, 21 Oct 2017 19:33:31 +0000 (19:33 +0000)]
MFC r323854:
Because nvp wasn't initialized on every loop iteration once we jumped
to 'fail' on error it was treated as success, because nvp!=NULL. Fix this
by not handling success under 'fail' label and by using separate variable
for parent nvpair.

If we succeeded to allocate nvlist, but failed to allocated nvpair we
would leak nvls[ii] on return. Destroy it when we cannot allocate nvpair,
before we goto fail.

Submitted by: pjd@ and oshogbo@ (minor changes)
Found by: scan-build
Sponsored by: Wheel Systems

6 years agoMFC r323853:
oshogbo [Sat, 21 Oct 2017 19:31:59 +0000 (19:31 +0000)]
MFC r323853:
Make the code consistent by always using 'fail' label.

Submitted by: pjd@ and oshogbo@
Sponsored by: Wheel Systems

6 years agoMFC r323852:
oshogbo [Sat, 21 Oct 2017 19:30:33 +0000 (19:30 +0000)]
MFC r323852:
The 'while (array != NULL) { }' suggests scan-build that array may be
initially NULL, which is not possible. Change the loop to
'do {} while (array != NULL)' to satisfy scan-build and assert that
array really cannot be NULL just in case.

Submitted by: pjd@
Found by: scan-build
MFC after: 1 month
Sponsored by: Wheel Systems

6 years agoMFC r323859:
oshogbo [Sat, 21 Oct 2017 19:26:47 +0000 (19:26 +0000)]
MFC r323859:
Simplify the code by _not_ expecting success under 'fail'.

Submitted by: pjd@ and oshogbo@
MFC after: 1 month
Sponsored by: Wheel Systems

6 years agoMFC r324672:
avos [Sat, 21 Oct 2017 10:21:34 +0000 (10:21 +0000)]
MFC r324672:
ifnet(9): split ifc_alloc_unit() (should simplify code flow)

Allocate smallest unit number from pool via ifc_alloc_unit_next()
and exact unit number (if available) via ifc_alloc_unit_specific().

While here, address possible deadlock (mentioned in PR).

PR: 217401
Differential Revision: https://reviews.freebsd.org/D12551

6 years agoMFC r324445:
hselasky [Fri, 20 Oct 2017 10:04:43 +0000 (10:04 +0000)]
MFC r324445:
When showing the sleepqueues from the in-kernel debugger,
properly dump all the sleepqueues and not just the first one

History:
It appears that in the commit which introduced the code,
r165272, the array indexes of "sq_blocked[0]" and "td_name[i]"
were interchanged. In r180927 "td_name[i]" was corrected to
"td_name[0]", but "sq_blocked[0]" was left unchanged.

PR: 222624
Discussed with: kmacy @
Sponsored by: Mellanox Technologies

6 years agoMFC r323916:
hselasky [Fri, 20 Oct 2017 09:59:39 +0000 (09:59 +0000)]
MFC r323916:
Extend sysctl description for hw.usb.disable_enumeration .

PR: 222505
Submitted by: Julian H. Stacey <jhs@berklix.com>
Sponsored by: Mellanox Technologies

6 years agoMFC r324600, r324716:
kib [Fri, 20 Oct 2017 09:21:37 +0000 (09:21 +0000)]
MFC r324600, r324716:
Evaluate the real size of the sblk_zone.

6 years agoMFC r324592:
ae [Fri, 20 Oct 2017 07:42:00 +0000 (07:42 +0000)]
MFC r324592:
  Return 'errno' value from the table_do_modify_record(), it is expected
  by table_modify_record().

  This makes quiet operations with tables really quiet.

  PR: 222953

6 years agoMFC r324593:
ae [Fri, 20 Oct 2017 07:40:11 +0000 (07:40 +0000)]
MFC r324593:
  Fix regression in handling O_FORWARD_IP opcode after r279948.

  To properly handle 'fwd tablearg,port' opcode, copy sin_port value from
  sockaddr_in structure stored in the opcode into corresponding hopstore
  field.

  PR: 222953

6 years agoMFC r324595: ANSIfy vm_kern.c
emaste [Fri, 20 Oct 2017 00:36:25 +0000 (00:36 +0000)]
MFC r324595: ANSIfy vm_kern.c

PR: 222673
Submitted by: ota@j.email.ne.jp

6 years agoMFC r324594: truss: mention 'H' in usage
emaste [Fri, 20 Oct 2017 00:29:39 +0000 (00:29 +0000)]
MFC r324594: truss: mention 'H' in usage

r295930 (MFC of r295930) introduced the 'H' option to display thread
IDs, but did not add the option to usage().

PR: 222837
Submitted by: Oliver Kiddle <okiddle@yahoo.co.uk>

6 years agoMFC r322695:
wulf [Thu, 19 Oct 2017 20:28:04 +0000 (20:28 +0000)]
MFC r322695:

Add support for generic MS Windows 7/8/10-compatible USB HID touchscreens
found in many laptops.

Reviewed by: hps, gonzo, bcr (manpages)
Approved by: gonzo (mentor)
Differential Revision: https://reviews.freebsd.org/D12017

6 years agoMFC r321397-r321399
wulf [Thu, 19 Oct 2017 20:16:40 +0000 (20:16 +0000)]
MFC r321397-r321399

r321397:
evdev: style(9), sort headers alphabetically

r321398:
evdev: Macroize common locking sequences

r321399:
Change my email address to wulf@FreeBSD.org in copyright headers.

Approved by: gonzo (mentor)

6 years agoMFC r324538
davidcs [Thu, 19 Oct 2017 17:30:20 +0000 (17:30 +0000)]
MFC r324538
Added support driver state capture/retrieval

6 years agoMFC r324535
davidcs [Thu, 19 Oct 2017 17:28:09 +0000 (17:28 +0000)]
MFC r324535
Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots
in Tx Ring map to empty slot in Tx_buf array before Transmits. If the
checks fail further Transmission on that Tx Ring is prevented.

6 years agoMFC r323997-r323998
ian [Thu, 19 Oct 2017 17:26:26 +0000 (17:26 +0000)]
MFC r323997-r323998

r323997:
Fix handling of uncaught exceptions in a std::terminate() handler on arm.

When raising an exception, the unwinder searches for a catch handler and if
none is found it should invoke std::terminate() with the uncaught exception
as the "current" exception.  Before this change, the terminate handler was
invoked with no exception as current (abi::__cxa_current_exception_type()
returned NULL), because the return value from the unwinder indicated an
internal failure in unwinding.  It turns out that was because all errors
from get_eit_entry() were translated to _URC_FAILURE.  Now the error is
returned untranslated, which allows _URC_END_OF_STACK to percolate upwards
to throw_exception() in libcxxrt.  When it sees that return status it
properly calls std::terminate() with the uncaught exception installed
as the current exception, allowing custom terminate handlers to work
with it.

r323998:
Fix the return value from _Unwind_Backtrace() on arm.

If unwinding stops due to hitting the end of the call chain, the return
value is supposed to be _URC_END_OF_STACK; other values indicate internal
errors.  The return value from get_eit_entry() is now returned without
translating it to _URC_FAILURE, so that callers can see _URC_END_OF_STACK
when it happens.

6 years agoMFC r323985:
ian [Thu, 19 Oct 2017 16:16:26 +0000 (16:16 +0000)]
MFC r323985:

Use nstosbt() instead of multiplying by SBT_1NS to avoid roundoff errors.

Differential Revision: https://reviews.freebsd.org/D11779

6 years agoMFC r323392:
ian [Thu, 19 Oct 2017 16:07:57 +0000 (16:07 +0000)]
MFC r323392:

Add gpio methods to read/write/configure up to 32 pins simultaneously.

Sometimes it is necessary to combine several gpio pins into an ad-hoc bus
and manipulate the pins as a group. In such cases manipulating the pins
individualy is not an option, because the value on the "bus" assumes
potentially-invalid intermediate values as each pin is changed in turn. Note
that the "bus" may be something as simple as a bi-color LED where changing
colors requires changing both gpio pins at once, or something as complex as
a bitbanged multiplexed address/data bus connected to a microcontroller.

In addition to the absolute requirement of simultaneously changing the
output values of driven pins, a desirable feature of these new methods is to
provide a higher-performance mechanism for reading and writing multiple
pins, especially from userland where pin-at-a-time access incurs a noticible
syscall time penalty.

These new interfaces are NOT intended to abstract away all the ugly details
of how gpio is implemented on any given platform. In fact, to use these
properly you absolutely must know something about how the gpio hardware is
organized. Typically there are "banks" of gpio pins controlled by registers
which group several pins together. A bank may be as small as 2 pins or as
big as "all the pins on the device, hundreds of them." In the latter case, a
driver might support this interface by allowing access to any 32 adjacent
pins within the overall collection. Or, more likely, any 32 adjacent pins
starting at any multiple of 32. Whatever the hardware restrictions may be,
you would need to understand them to use this interface.

In additional to defining the interfaces, two example implementations are
included here, for imx5/6, and allwinner. These represent the two primary
types of gpio hardware drivers. imx6 has multiple gpio devices, each
implementing a single bank of 32 pins. Allwinner implements a single large
gpio number space from 1-n pins, and the driver internally translates that
linear number space to a bank+pin scheme based on how the pins are grouped
into control registers. The allwinner implementation imposes the restriction
that the first_pin argument to the new functions must always be pin 0 of a
bank.

Differential Revision: https://reviews.freebsd.org/D11810

6 years agoMFC r324590: i2c(8): clean up and clarify read operation
avg [Thu, 19 Oct 2017 08:17:32 +0000 (08:17 +0000)]
MFC r324590: i2c(8): clean up and clarify read operation

6 years agoReally MFC r309357,r309409: Speling fixes and fix line endings for err_msg output
avg [Thu, 19 Oct 2017 08:15:41 +0000 (08:15 +0000)]
Really MFC r309357,r309409: Speling fixes and fix line endings for err_msg output

Note: somehow these revisions were in mergeinfo but the actual changes
were not merged.

6 years agoMFC r324311: sysctl-s in a module should be accessible only when the module is initia...
avg [Thu, 19 Oct 2017 07:54:04 +0000 (07:54 +0000)]
MFC r324311: sysctl-s in a module should be accessible only when the module is initialized

Sponsored by: Panzura

6 years agoMFC r324312: fix the misleading log facility used in devd/zfs.conf
avg [Thu, 19 Oct 2017 07:23:26 +0000 (07:23 +0000)]
MFC r324312: fix the misleading log facility used in devd/zfs.conf

6 years agoMFC r324309: remove heuristic error detection from ddi_strto*()
avg [Thu, 19 Oct 2017 07:21:23 +0000 (07:21 +0000)]
MFC r324309: remove heuristic error detection from ddi_strto*()

6 years agoMFC r324623:
bapt [Wed, 18 Oct 2017 08:18:01 +0000 (08:18 +0000)]
MFC r324623:

Fix ctld segfaulting when using ucl conf file format and having duplicated
lun or target

Submitted by: Nikita Kozlov <nikita.kozlov at blade-group.com>
Sponsored by: blade
Differential Revision: https://reviews.freebsd.org/D12646

6 years agoMFC r324528:
kib [Wed, 18 Oct 2017 08:05:46 +0000 (08:05 +0000)]
MFC r324528:
In tc_windup(), do not re-calculate bintime.

6 years agoMFC r324696: Update wpa_supplicant/hostapd for 2017-01 vulnerability release.
gordon [Tue, 17 Oct 2017 17:30:18 +0000 (17:30 +0000)]
MFC r324696: Update wpa_supplicant/hostapd for 2017-01 vulnerability release.

hostapd: Avoid key reinstallation in FT handshake
Prevent reinstallation of an already in-use group key
Extend protection of GTK/IGTK reinstallation of WNM-Sleep Mode cases
Fix TK configuration to the driver in EAPOL-Key 3/4 retry case
Prevent installation of an all-zero TK
Fix PTK rekeying to generate a new ANonce
TDLS: Reject TPK-TK reconfiguration
WNM: Ignore Key Data in WNM Sleep Mode Response frame if no PMF in use
WNM: Ignore WNM-Sleep Mode Response if WNM-Sleep Mode has not been used
WNM: Ignore WNM-Sleep Mode Response without pending request
FT: Do not allow multiple Reassociation Response frames
TDLS: Ignore incoming TDLS Setup Response retries

Submitted by: jhb
Obtained from:        https://w1.fi/security/2017-01/ (against later version)
Security:     FreeBSD-SA-17:07
Security:     CERT VU#228519
Security:     CVE-2017-13077
Security:     CVE-2017-13078
Security:     CVE-2017-13079
Security:     CVE-2017-13080
Security:     CVE-2017-13081
Security:     CVE-2017-13082
Security:     CVE-2017-13086
Security:     CVE-2017-13087
Security:     CVE-2017-13088

6 years agoMFC r324497:
ngie [Tue, 17 Oct 2017 15:53:22 +0000 (15:53 +0000)]
MFC r324497:

Mute gcc warning about p not being possibly initialized

I'm running into this warning on a tinderbox run with gcc 4.2.1 with mips and
powerpc.

6 years agoMFC r324478:
ngie [Tue, 17 Oct 2017 15:52:02 +0000 (15:52 +0000)]
MFC r324478:

Check the exit code from fsck_ffs instead of relying on MODIFIED being in the output

^/head@r323923 changed when MODIFIED is printed at exit. It's better to follow the
documented way of determining whether or not a filesystem is clean per fsck_ffs, i.e.,
ensure that the exit code is either 0 or 7.

The pass/fail determination is brittle prior to this commit, and ^/head@r323923 made
the issue apparent -- thus this needs to be fixed independent of ^/head@r323923.

PR: 222780
MFC with: r323923

6 years agoMFC 323579,323585: Add AT_HWCAP and AT_EHDRFLAGS on all platforms.
jhb [Tue, 17 Oct 2017 12:45:51 +0000 (12:45 +0000)]
MFC 323579,323585: Add AT_HWCAP and AT_EHDRFLAGS on all platforms.

To preserve KBI on stable/11, a new SV_HWCAP flag is added which
indicates if the sv_hwcap field is present and valid to avoid examining
the field in old modules.  Only sysentvec's which wish to use sv_hwcap
need to set the flag in stable/11.

323579:
Add AT_HWCAP and AT_EHDRFLAGS on all platforms.

A new 'u_long *sv_hwcap' field is added to 'struct sysentvec'.  A
process ABI can set this field to point to a value holding a mask of
architecture-specific CPU feature flags.  If an ABI does not wish to
supply AT_HWCAP to processes the field can be left as NULL.

The support code for AT_EHDRFLAGS was already present on all systems,
just the #define was not present.  This is a step towards unifying the
AT_* constants across platforms.

323585:
Add AT_EHDRFLAGS and AT_HWCAP on amd64.

x86 has two separate (but identical) list of AT_* constants and the
earlier commit to add AT_HWCAP only updated the i386 list.

6 years agoMFC r322648:
tuexen [Tue, 17 Oct 2017 12:42:17 +0000 (12:42 +0000)]
MFC r322648:

Ensure inp_vflag is consistently set for TCP endpoints.

Make sure that the flags INP_IPV4 and INP_IPV6 are consistently set
for inpcbs used for TCP sockets, no matter if the setting is derived
from the net.inet6.ip6.v6only sysctl or the IPV6_V6ONLY socket option.
For UDP this was already done right.

PR: 221385

6 years agoMFC r324509: sysctl.9: document CTLFLAG_CAPRD and CTLFLAG_CAPWR
emaste [Tue, 17 Oct 2017 00:25:44 +0000 (00:25 +0000)]
MFC r324509: sysctl.9: document CTLFLAG_CAPRD and CTLFLAG_CAPWR

Reported by: Shawn Webb
Sponsored by: The FreeBSD Foundation

6 years agoMFC of 324456.
mckusick [Mon, 16 Oct 2017 21:53:29 +0000 (21:53 +0000)]
MFC of 324456.

Do not report filesystem as modified if only timestamp updated in superblock.

6 years agoMFC r321256:
brooks [Sun, 15 Oct 2017 22:43:56 +0000 (22:43 +0000)]
MFC r321256:

Include ARCH_FLAGS in CFLAGS when building modules.

Without this change, modules will match the default compiler
configuration which may not be the same as the kernel values.

Reviewed by: imp
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11633

6 years agoMFC r320999:
brooks [Sun, 15 Oct 2017 22:34:12 +0000 (22:34 +0000)]
MFC r320999:

Add 32-bit compat for kinfo_proc's ki_tdaddr.

This appears to have been an oversight in r213536.

Reviewed by: markj
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11521

6 years agoMFC r324064:
fsu [Sun, 15 Oct 2017 14:03:53 +0000 (14:03 +0000)]
MFC r324064:
Add check to avoid raw inode iblocks fields overflow in case of huge_file feature.
Use the Linux logic for now.

Approved by:    pfg (mentor)
Differential Revision: https://reviews.freebsd.org/D12131

6 years agoMFC r324156:
kib [Sun, 15 Oct 2017 10:59:31 +0000 (10:59 +0000)]
MFC r324156:
Improve smb(4) devfs interactions.

6 years agoMFC r324146:
markj [Sat, 14 Oct 2017 17:51:25 +0000 (17:51 +0000)]
MFC r324146:
Have uiomove_object_page() keep accessed pages in the active queue.

6 years agoMFC r324243:
brooks [Sat, 14 Oct 2017 16:23:25 +0000 (16:23 +0000)]
MFC r324243:

Remove an unneeded and incorrect memset().

On Variant I TLS architectures (aarch64, arm, mips, powerpc, and riscv)
the __libc_allocate_tls function allocates thread local storage memory
with calloc(). It then copies initialization data over the portions with
non-zero initial values. Before this change it would then pointlessly
zero the already zeroed remainder of the storage. Unfortunately the
calculation was wrong and it would zero TLS_TCB_SIZE (2*sizeof(void *))
additional bytes.

In practice, this overflow only matters if the TLS segment is sized such
that calloc() allocates less than TLS_TCB_SIZE extra memory. Even
then, the likely result will be zeroing part of the next bucket. This
coupled with the impact being confined to Tier II platforms means there
will be no security advisory for this issue.

Reviewed by: kib, dfr
Discussed with: security-officer (delphij)
Found by: CHERI
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12547

6 years agoMFC 324039: Don't defer wakeup()s for completed journal workitems.
jhb [Fri, 13 Oct 2017 22:40:57 +0000 (22:40 +0000)]
MFC 324039: Don't defer wakeup()s for completed journal workitems.

Normally wakeups() are performed for completed softupdates work items
in workitem_free() before the underlying memory is free()'d.
complete_jseg() was clearing the "wakeup needed" flag in work items to
defer the wakeup until the end of each loop iteration.  However, this
resulted in the item being free'd before it's address was used with
wakeup().  As a result, another part of the kernel could allocate this
memory from malloc() and use it as a wait channel for a different
"event" with a different lock.  This triggered an assertion failure
when the lock passed to sleepq_add() did not match the existing lock
associated with the sleep queue.  Fix this by removing the code to
defer the wakeup in complete_jseg() allowing the wakeup to occur
slightly earlier in workitem_free() before free() is called.

6 years agoMFC 324073: Use UMA_ALIGNOF() for name cache UMA zones.
jhb [Fri, 13 Oct 2017 21:58:44 +0000 (21:58 +0000)]
MFC 324073: Use UMA_ALIGNOF() for name cache UMA zones.

This fixes kernel crashes due to misaligned accesses to the 64-bit
time_t embedded in struct namecache_ts in MIPS n32 kernels.

6 years agoMFC 324072: Add UMA_ALIGNOF().
jhb [Fri, 13 Oct 2017 17:11:08 +0000 (17:11 +0000)]
MFC 324072: Add UMA_ALIGNOF().

This is a wrapper around _Alignof() that sets the alignment for a zone
to the alignment required by a given type.  This allows the compiler to
determine the proper alignment rather than having the programmer try to
guess.

6 years agoMFC r324373:
markj [Fri, 13 Oct 2017 13:56:44 +0000 (13:56 +0000)]
MFC r324373:
Avoid adding an extra "0x" prefix before pointer formats.

6 years agoMFC r323612: gmirror: treat ENXIO as disk disconnect, not media error
avg [Fri, 13 Oct 2017 09:13:08 +0000 (09:13 +0000)]
MFC r323612: gmirror: treat ENXIO as disk disconnect, not media error

6 years agoMFC r323528: MFV r323527: 5815 libzpool's panic function doesn't set global panicstr
avg [Fri, 13 Oct 2017 09:10:37 +0000 (09:10 +0000)]
MFC r323528: MFV r323527: 5815 libzpool's panic function doesn't set global panicstr

6 years agoMFC r323525: MFV r323523: 8331 zfs_unshare returns wrong error code for smb unshare...
avg [Fri, 13 Oct 2017 09:06:57 +0000 (09:06 +0000)]
MFC r323525: MFV r323523: 8331 zfs_unshare returns wrong error code for smb unshare failure

6 years agoMFC r323524: MFV r316932: 6280 libzfs: unshare_one() could fail with EZFS_SHARENFSFAILED
avg [Fri, 13 Oct 2017 09:05:32 +0000 (09:05 +0000)]
MFC r323524: MFV r316932: 6280 libzfs: unshare_one() could fail with EZFS_SHARENFSFAILED

6 years agoMFC: r324362
bapt [Fri, 13 Oct 2017 07:50:44 +0000 (07:50 +0000)]
MFC: r324362

Import mandoc 1.14.3

6 years agoMFC 324517
sephe [Fri, 13 Oct 2017 05:14:54 +0000 (05:14 +0000)]
MFC 324517

    hyperv/hn: Enable transparent VF by default.

    Sponsored by:   Microsoft

6 years agoMFC 324489,324516
sephe [Fri, 13 Oct 2017 05:09:56 +0000 (05:09 +0000)]
MFC 324489,324516

324489
    hyperv/hn: Workaround erroneous hash type observed on WS2016.

    Background:
    - UDP 4-tuple hash type is unconditionally enabled in Hyper-V on WS2016,
      which is _not_ affected by NDIS_OBJTYPE_RSS_PARAMS.
    - Non-fragment UDP/IPv4 datagrams' hash type is delivered to VM as
      TCP_IPV4.

    Currently this erroneous behavior only applies to WS2016/Windows10.

    Force l3/l4 protocol check, if the RXed packet's hash type is TCP_IPV4,
    and the Hyper-V is running on WS2016/Windows10.  If the RXed packet is
    UDP datagram, adjust mbuf hash type to UDP_IPV4.

    Sponsored by:   Microsoft

324516
    hyperv/hn: Workaround erroneous hash type observed on WS2016 for VF.

    The background was described in r324489.

    Sponsored by:   Microsoft

6 years agoMFC 324488
sephe [Fri, 13 Oct 2017 05:02:39 +0000 (05:02 +0000)]
MFC 324488

    hyperv/vmbus: Expose Hyper-V major version.

    Sponsored by:   Microsoft

6 years agoMFC 324487
sephe [Fri, 13 Oct 2017 04:55:54 +0000 (04:55 +0000)]
MFC 324487

    hyperv/vmbus: Add tunable to pin/unpin event tasks.

    Event tasks are pinned to their respective CPU by default, in the same
    fashion as they were.

    Unpin the event tasks by setting hw.vmbus.pin_evttask to 0, if certain
    CPUs serve special purpose.

    Sponsored by:   Microsoft

6 years agoMFC 324088:
n_hibma [Thu, 12 Oct 2017 14:08:55 +0000 (14:08 +0000)]
MFC 324088:

Make smc compile with DEVICE_POLLING set.

smc_poll had the wrong prototype.

Reviewed by: benno

6 years agoMFC r324320:
hselasky [Thu, 12 Oct 2017 08:27:57 +0000 (08:27 +0000)]
MFC r324320:
Add support for new cuse(3) error code, CUSE_ERR_NO_DEVICE.
This error code is useful when emulating Linux input event
devices from userspace.

PR: 218626
Submitted by: jan.kokemueller@gmail.com
Sponsored by: Mellanox Technologies

6 years agoMFC: r324074
rmacklem [Wed, 11 Oct 2017 13:20:24 +0000 (13:20 +0000)]
MFC: r324074
Fix a memory leak that occurred in the pNFS client.

When a "pnfs" NFSv4.1 mount was unmounted, it didn't free up the layouts
and deviceinfo structures. This leak only affects "pnfs" mounts and only
when the mount is umounted.
Found while testing the pNFS Flexible File layout client code.