]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agocam iosched: Call cam_iosched_limiter_init() after ios->current is set to the default
Warner Losh [Wed, 20 Sep 2017 21:26:01 +0000 (21:26 +0000)]
cam iosched: Call cam_iosched_limiter_init() after ios->current is set to the default

Previously ios->current was set to 0 until the first
cam_iosched_cl_maybe_steer() call.

PR: 221954
Obtained from: ElectroBSD
Submitted by: Fabian Keil
Differential Revision: https://reviews.freebsd.org/D12349

6 years agocam iosched: Schedule cam_iosched_ticker() quanta times per second
Warner Losh [Wed, 20 Sep 2017 21:25:56 +0000 (21:25 +0000)]
cam iosched: Schedule cam_iosched_ticker() quanta times per second

Previously callout_reset() was called with a "ticks" value that was
off by one.  As a result cam_iosched_ticker() was called a bit too
frequently: On systems with hz=1000 a quanta value of 200 resulted in
~250 calls and a value of 100 in ~111 calls.

For the "queue_depth" and "bandwidth" limiters the difference doesn't
matter but the "iops" limiter depends on the scheduling to enforce the
correct maximum.

PR: 221956
Obtained from: ElectroBSD
Submitted by: Fabian Keil
Differential Revision: https://reviews.freebsd.org/D12350

6 years agocam iosched: Add a handler for the quanta sysctl to enforce valid values
Warner Losh [Wed, 20 Sep 2017 21:19:53 +0000 (21:19 +0000)]
cam iosched: Add a handler for the quanta sysctl to enforce valid values

Invalid values can result in devision-by-zero panics or other
undefined behaviour so lets not allow them.

PR: 221957
Obtained from: ElectroBSD
Submitted by: Fabian Keil
Differential Revision: https://reviews.freebsd.org/D12351

6 years agocam iosched: Use the write queue for BIO_ZONE commands
Warner Losh [Wed, 20 Sep 2017 21:13:20 +0000 (21:13 +0000)]
cam iosched: Use the write queue for BIO_ZONE commands

Use the write queue for BIO_ZONE commands so they can't get executed
ahead of writes that were sent after them. More generally, since they
introduce strong ordering into the list, they need to go to the write
queue (which is the only queue that BIO_ORDERED is honored for at the
moment). In fact, fix mismatch between queueing and dequeueing code by
changing this to queue all non-reads (and non-trims) to the write
queue.

As a side effect this prevents the kernel message:
kernel: Found bio_cmd = 0x9
which cam_iosched_next_bio() emits when finding commands
other than BIO_READ in the read queue.

PR: 221973
Obtained from: ElectroBSD
Submitted by: Fabian Keil
Differential Revision: https://reviews.freebsd.org/D12353

6 years agoFix iflib netmap RX
Stephen Hurd [Wed, 20 Sep 2017 20:40:49 +0000 (20:40 +0000)]
Fix iflib netmap RX

RXQ setup for netmap was broken because netmap_rxq_init was getting called
before IFDI_INIT - thus we ended up with ring tail pointer being reset to zero.

Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12140

6 years ago1. ql_hw.c:
David C Somayajulu [Wed, 20 Sep 2017 20:07:45 +0000 (20:07 +0000)]
1. ql_hw.c:
In ql_hw_send() return EINVAL when TSO framelength exceeds max
supported length by HW.(davidcs)
2. ql_os.c:
In qla_send() call bus_dmamap_unload before freeing mbuf or
recreating dmmamap.(davidcs)
In qla_fp_taskqueue() Add additional checks for IFF_DRV_RUNNING
Fix qla_clear_tx_buf() call bus_dmamap_sync() before freeing
mbuf.

Submitted by:David.Bachu@netapp.com
MFC after:5 days

6 years agoaesni(4): Fix another trivial typo (aensi -> aesni)
Conrad Meyer [Wed, 20 Sep 2017 18:31:36 +0000 (18:31 +0000)]
aesni(4): Fix another trivial typo (aensi -> aesni)

Sponsored by: Dell EMC Isilon

6 years agox86: Decode AMD "Extended Feature Extensions ID EBX" bits
Conrad Meyer [Wed, 20 Sep 2017 18:30:37 +0000 (18:30 +0000)]
x86: Decode AMD "Extended Feature Extensions ID EBX" bits

In particular, this determines CPU support for the CLZERO instruction.

(No, I am not making this name up.)

Sponsored by: Dell EMC Isilon

6 years agoaesni(4): Fix trivial typo (AQUIRE -> ACQUIRE)
Conrad Meyer [Wed, 20 Sep 2017 17:53:25 +0000 (17:53 +0000)]
aesni(4): Fix trivial typo (AQUIRE -> ACQUIRE)

Sponsored by: Dell EMC Isilon

6 years agoMFV r323789: 8473 scrub does not detect errors on active spares
Alan Somers [Wed, 20 Sep 2017 16:31:00 +0000 (16:31 +0000)]
MFV r323789:  8473 scrub does not detect errors on active spares

illumos/illumos-gate@554675eee75dd2d7398d960aa5c81083ceb8505a
https://github.com/illumos/illumos-gate/commit/554675eee75dd2d7398d960aa5c81083ceb8505a

https://www.illumos.org/issues/8473
Scrubbing is supposed to detect and repair all errors in the pool. However,
it wrongly ignores active spare devices. The problem can easily be
reproduced in OpenZFS at git rev 0ef125d with these commands:

truncate -s 64m /tmp/a /tmp/b /tmp/c
sudo zpool create testpool mirror /tmp/a /tmp/b spare /tmp/c
sudo zpool replace testpool /tmp/a /tmp/c
/bin/dd if=/dev/zero bs=1024k count=63 oseek=1 conv=notrunc of=/tmp/c
sync
sudo zpool scrub testpool
zpool status testpool # Will show 0 errors, which is wrong
sudo zpool offline testpool /tmp/a
sudo zpool scrub testpool
zpool status testpool # Will show errors on /tmp/c,
      # which should've already been fixed

FreeBSD head is partially affected: the first scrub will detect some errors, but the second scrub will detect more.

Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

MFC after: 1 week
Sponsored by: Spectra Logic Corp

6 years agoBootstrap etcupdate(8) and mergemaster(8) databases when creating
Glen Barber [Wed, 20 Sep 2017 15:49:12 +0000 (15:49 +0000)]
Bootstrap etcupdate(8) and mergemaster(8) databases when creating
virtual machine images and embedded images, similar to what is
done when extracting base.txz to the target root filesystem in
an new installation.

Noticed by: marius
Tested with: head@r323729
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

6 years agoRegenerate usb.conf .
Hans Petter Selasky [Wed, 20 Sep 2017 15:00:00 +0000 (15:00 +0000)]
Regenerate usb.conf .

MFC after: 1 week

6 years agoadd vfs_zfs.abd_chunk_size tunable
Andriy Gapon [Wed, 20 Sep 2017 08:36:31 +0000 (08:36 +0000)]
add vfs_zfs.abd_chunk_size tunable

It is reported that the default value of 4KB results in a substantial
memory use overhead (at least, on some configurations).  Using 1KB seems
to reduce the overhead significantly.

PR: 222377
Reported by: Sean Chittenden <sean@chittenden.org>
MFC after: 1 week

6 years agofix memory leak in g_bio zone introduced in r320452, another ABD fallout
Andriy Gapon [Wed, 20 Sep 2017 08:27:21 +0000 (08:27 +0000)]
fix memory leak in g_bio zone introduced in r320452, another ABD fallout

I overlooked the fact that that ZIO_IOCTL_PIPELINE does not include
ZIO_STAGE_VDEV_IO_DONE stage.  We do allocate a struct bio for an ioctl
zio (a disk cache flush), but we never freed it.

This change splits bio handling into two groups, one for normal
read/write i/o that passes data around and, thus, needs the abd data
tranform; the other group is for "data-less" i/o such as trim and cache
flush.

PR: 222288
Reported by: Dan Nelson <dnelson@allantgroup.com>
Tested by: Borja Marcos <borjam@sarenet.es>
MFC after: 10 days

6 years agoMFV r323792: 8602 remove unused "dp_early_sync_tasks" field from "dsl_pool" structure
Andriy Gapon [Wed, 20 Sep 2017 07:26:52 +0000 (07:26 +0000)]
MFV r323792: 8602 remove unused "dp_early_sync_tasks" field from "dsl_pool" structure

illumos/illumos-gate@2bcb5458541cc6e8bf7dc541303da29297b82e8b
https://github.com/illumos/illumos-gate/commit/2bcb5458541cc6e8bf7dc541303da29297b82e8b

https://www.illumos.org/issues/8602
  When I landed the fix for 8558, I incorrectly added the "dp_early_sync_tasks"
  field to the "dsl_pool" structure. This field is used in DelphixOS, but not in
  illumos. It was incorrectly pulled into illumos, so this bug is to remove it
  from the structure.

Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

MFC after: 1 week

6 years ago8602 remove unused "dp_early_sync_tasks" field from "dsl_pool" structure
Andriy Gapon [Wed, 20 Sep 2017 07:24:57 +0000 (07:24 +0000)]
8602 remove unused "dp_early_sync_tasks" field from "dsl_pool" structure

illumos/illumos-gate@2bcb5458541cc6e8bf7dc541303da29297b82e8b
https://github.com/illumos/illumos-gate/commit/2bcb5458541cc6e8bf7dc541303da29297b82e8b

https://www.illumos.org/issues/8602
  When I landed the fix for 8558, I incorrectly added the "dp_early_sync_tasks"
  field to the "dsl_pool" structure. This field is used in DelphixOS, but not in
  illumos. It was incorrectly pulled into illumos, so this bug is to remove it
  from the structure.

Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

6 years agoMFV r323790: 8567 Inconsistent return value in zpool_read_label
Andriy Gapon [Wed, 20 Sep 2017 07:23:50 +0000 (07:23 +0000)]
MFV r323790: 8567 Inconsistent return value in zpool_read_label

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

https://www.illumos.org/issues/8567
  If fstat64 fails, pread64 fails, or the label is unintelligible,
  zpool_read_label will return 0. But if malloc fails, it will return -1. For
  consistency, it should always return -1 on failure or 0 on success.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Alan Somers <asomers@gmail.com>

MFC after: 2 weeks

6 years ago8567 Inconsistent return value in zpool_read_label
Andriy Gapon [Wed, 20 Sep 2017 07:18:09 +0000 (07:18 +0000)]
8567 Inconsistent return value in zpool_read_label

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

https://www.illumos.org/issues/8567
  If fstat64 fails, pread64 fails, or the label is unintelligible,
  zpool_read_label will return 0. But if malloc fails, it will return -1. For
  consistency, it should always return -1 on failure or 0 on success.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Alan Somers <asomers@gmail.com>

6 years ago8473 scrub does not detect errors on active spares
Andriy Gapon [Wed, 20 Sep 2017 06:34:48 +0000 (06:34 +0000)]
8473 scrub does not detect errors on active spares

illumos/illumos-gate@554675eee75dd2d7398d960aa5c81083ceb8505a
https://github.com/illumos/illumos-gate/commit/554675eee75dd2d7398d960aa5c81083ceb8505a

https://www.illumos.org/issues/8473
  Scrubbing is supposed to detect and repair all errors in the pool. However, it
  wrongly ignores active spare devices. The problem can easily be reproduced in
  OpenZFS at git rev 0ef125d with these commands:

  truncate -s 64m /tmp/a /tmp/b /tmp/c
  sudo zpool create testpool mirror /tmp/a /tmp/b spare /tmp/c
  sudo zpool replace testpool /tmp/a /tmp/c
  /bin/dd if=/dev/zero bs=1024k count=63 oseek=1 conv=notrunc of=/tmp/c
  sync
  sudo zpool scrub testpool
  zpool status testpool # Will show 0 errors, which is wrong
  sudo zpool offline testpool /tmp/a
  sudo zpool scrub testpool
  zpool status testpool # Will show errors on /tmp/c, which should've already been fixed

  FreeBSD head is partially affected: the first scrub will detect some errors,
  but the second scrub will detect more.

Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Alan Somers <asomers@gmail.com>

6 years agoIn r288122, we changed vm_page_unwire() so that it returns a Boolean
Alan Cox [Wed, 20 Sep 2017 04:59:52 +0000 (04:59 +0000)]
In r288122, we changed vm_page_unwire() so that it returns a Boolean
indicating whether the page's wire count transitioned to zero.  Use that
return value in zbuf_page_free() rather than checking the wire count.

MFC after: 1 week

6 years agoSync with amd64/arm/arm64/i386/mips pmap change r288256:
Alan Cox [Wed, 20 Sep 2017 04:19:49 +0000 (04:19 +0000)]
Sync with amd64/arm/arm64/i386/mips pmap change r288256:

Exploit r288122 to address a cosmetic issue.  Since PV chunk pages don't
belong to a vm object, they can't be paged out.  Since they can't be paged
out, they are never enqueued in a paging queue.  Nonetheless, passing
PQ_INACTIVE to vm_page_unwire() creates the appearance that these pages
are being enqueued in the inactive queue.  As of r288122, we can avoid
this false impression by passing PQ_NONE.

MFC after: 1 week

6 years agoDefine CPU_XSCALE_CORE3 when relevant.
Olivier Houchard [Tue, 19 Sep 2017 23:41:55 +0000 (23:41 +0000)]
Define CPU_XSCALE_CORE3 when relevant.
It was lost when cpuconf.h was deobirted.

6 years agoMake the nfsrpc_layoutget() function a static.
Rick Macklem [Tue, 19 Sep 2017 23:28:22 +0000 (23:28 +0000)]
Make the nfsrpc_layoutget() function a static.

Make the NFSv4 pNFS client function nfsrpc_layoutget() a static, since it
is only used in sys/fs/nfsclient/nfs_clrpcops.c.
This prepares the code for future patches that add Flex File layout
support.

6 years agoAdd sysctl "enable_minidump" to turn on/off automatic minidump retrieval
David C Somayajulu [Tue, 19 Sep 2017 23:26:27 +0000 (23:26 +0000)]
Add sysctl "enable_minidump" to turn on/off automatic minidump retrieval

MFC after:5 days

6 years agoUpdate minidump template for version 5.4.66
David C Somayajulu [Tue, 19 Sep 2017 22:17:30 +0000 (22:17 +0000)]
Update minidump template for version 5.4.66

MFC after:5 days

6 years agoAdd a new function called nfsm_uiombuflist(), similar to nfsm_uiombuf().
Rick Macklem [Tue, 19 Sep 2017 21:31:36 +0000 (21:31 +0000)]
Add a new function called nfsm_uiombuflist(), similar to nfsm_uiombuf().

This patch adds a new function called nfsm_uiombuflist(), which is
similar to nfsm_uiombuf(), but doesn't not use the fields in
struct nfsrv_descript. This new function will be used by the pNFS client
for writing to mirrors using Flex Files layout.
The function is not yet called anywhere.
Also, get rid of #ifndef APPLE, which is ancient cruft left over from
the Mac OSX port of the NFSv4 client.

6 years agoSimplify nfsrpc_layoutreturn() args.
Rick Macklem [Tue, 19 Sep 2017 20:45:25 +0000 (20:45 +0000)]
Simplify nfsrpc_layoutreturn() args.

Simplify nfsrpc_layoutreturn() args. in preparation for the addition
of Flex File layout support, since File layout uses a 0 length field.
Flex Files does use a longer field, but that will be added in a
subsequent commit.

6 years agoFix indentation for r323068
Josh Paetzel [Tue, 19 Sep 2017 20:40:05 +0000 (20:40 +0000)]
Fix indentation for r323068

PR: 220170
Reported by: lidl
MFC after: 3 days
Pointyhat to: jpaetzel

6 years agoi81342 is little endian, not big endian.
Olivier Houchard [Tue, 19 Sep 2017 20:33:22 +0000 (20:33 +0000)]
i81342 is little endian, not big endian.

6 years agoFix a warning.
Michael Tuexen [Tue, 19 Sep 2017 20:24:13 +0000 (20:24 +0000)]
Fix a warning.

MFC after: 1 week

6 years agoSimplify nfsrpc_layoutcommit() args.
Rick Macklem [Tue, 19 Sep 2017 20:18:41 +0000 (20:18 +0000)]
Simplify nfsrpc_layoutcommit() args.

Simplify nfsrpc_layoutcommit() args. in preparation for the addition
of Flex File layout support, since it also uses a 0 length field.

6 years agoAvoid an overflow when computing the staleness.
Michael Tuexen [Tue, 19 Sep 2017 20:09:58 +0000 (20:09 +0000)]
Avoid an overflow when computing the staleness.
This issue was found by running libfuzz on the userland stack.

MFC after: 1 week

6 years agoDo not do torn writes to active LDTs.
Konstantin Belousov [Tue, 19 Sep 2017 17:57:04 +0000 (17:57 +0000)]
Do not do torn writes to active LDTs.

Care must be taken when updating the active LDT, since parallel
threads might try to load a segment descriptor which is currently
updated. Since the results are undefined, this cannot be ignored by
claiming to be an application race.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D12413

6 years agoDo not vrele() covered vnode under the mp mutex.
Konstantin Belousov [Tue, 19 Sep 2017 16:49:45 +0000 (16:49 +0000)]
Do not vrele() covered vnode under the mp mutex.

If vrele() changes the hold count to zero, it needs to acquire the
vnode lock.

Sponsored by: The FreeBSD Foundation
Discussed with: avg
X-MFC with: r323578

6 years agoFor unlinked files, do not msync(2) or sync on the vnode deactivation.
Konstantin Belousov [Tue, 19 Sep 2017 16:46:37 +0000 (16:46 +0000)]
For unlinked files, do not msync(2) or sync on the vnode deactivation.

One consequence of the patch is that msyncing unlinked file mappings
no longer reduces the amount of the dirty memory in the system, but I
do not think that there are users of msync(2) that utilize it for such
side-effect.

Reported and tested by: tjil
PR: 222356
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D12411

6 years agoAdd myself and mentorship status to committers files.
Eugene Grosbein [Tue, 19 Sep 2017 16:38:54 +0000 (16:38 +0000)]
Add myself and mentorship status to committers files.
This was not done right when I got my ports bit, so do them both in one commit:

my ports mentors were az@ and vsevolod@ and my src mentors are avg@ and mav@

Approved by: avg (mentor)

6 years agoProvide an articulate example of how to properly delete partitions and
Alexey Dokuchaev [Tue, 19 Sep 2017 15:08:31 +0000 (15:08 +0000)]
Provide an articulate example of how to properly delete partitions and
partitioning scheme.

Users often get confused and frustrated when trying to delete partition
table and getting ``Device busy'' error because they forgot (or did not
ever know that they have) to delete all its partitions first, and while
the manual page mentions this briefly, it does not stress it out enough.

Approved by: ae, manpages (bjk)
PR (as inspiration): 196102
Differential Revision: https://reviews.freebsd.org/D12336

6 years agoRemove a no longer used variable.
Michael Tuexen [Tue, 19 Sep 2017 15:00:19 +0000 (15:00 +0000)]
Remove a no longer used variable.

Reported by: Felix Weinrank
MFC after: 1 week

6 years agohyperv/hn: Incease max supported MTU
Sepherosa Ziehau [Tue, 19 Sep 2017 06:46:00 +0000 (06:46 +0000)]
hyperv/hn: Incease max supported MTU

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D12365

6 years agohyperv/hn: Fix MTU setting
Sepherosa Ziehau [Tue, 19 Sep 2017 06:38:57 +0000 (06:38 +0000)]
hyperv/hn: Fix MTU setting

- Add size of an ethernet header to the value configured to NVS.  This
  does not seem to have any effects if MTU is 1500, but fix hypervisor
  side's setting if MTU > 1500.
- Override the MTU setting according to the view from the hypervisor
  side.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D12352

6 years agohyperv/hn: Apply VF's RSS setting
Sepherosa Ziehau [Tue, 19 Sep 2017 06:29:38 +0000 (06:29 +0000)]
hyperv/hn: Apply VF's RSS setting

Since in Azure SYN and SYN|ACK go through the synthetic parts while the
rest of the same TCP flow goes through the VF, apply VF's RSS settings
to synthetic parts to have a consistent hash value/type for the same TCP
flow.

MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D12333

6 years agoEnable support for lookaside crypto operations by default.
John Baldwin [Mon, 18 Sep 2017 23:50:34 +0000 (23:50 +0000)]
Enable support for lookaside crypto operations by default.

This permits ccr(4) to be used with the default firmware configuration
file.

Discussed with: np
Sponsored by: Chelsio Communications

6 years agoAdd UFS_LINK_MAX for the UFS-specific limit on link counts.
John Baldwin [Mon, 18 Sep 2017 23:30:39 +0000 (23:30 +0000)]
Add UFS_LINK_MAX for the UFS-specific limit on link counts.

ino64 expanded nlink_t to 64 bits, but the on-disk format for UFS is still
limited to 16 bits.  This is a nop currently but will matter if LINK_MAX is
increased in the future.

Reviewed by: kib
Sponsored by: Chelsio Communications

6 years agoFix handling of the segment registers on i386.
Konstantin Belousov [Mon, 18 Sep 2017 20:22:42 +0000 (20:22 +0000)]
Fix handling of the segment registers on i386.

Suppose that userspace is executing with the non-standard segment
descriptors.  Then, until exception or interrupt handler executed
SET_KERNEL_SEGS, kernel is still executing with user %ds, %es and %fs.
If an interrupt occurs in this window, the interrupt handler is
executed unsafely, relying on usability of the usermode registers.  If
the interrupt results in the context switch on return, the
contamination of the kernel state spreads to the thread we switched
to.  As result, kernel data accesses might fault or, if only the base
is changed, completely messed up.

More, if the user segment was allocated in LDT, another thread might
mark the descriptor as invalid before doreti code tried to reload
them.  In this case kernel panics.

The issue exists for all exception entry points which use trap gate,
and thus do not automatically disable interrupts on entry, and for
lcall_handler.

Fix is two-fold: first, we need to disable interrupts for all kernel
entries, changing the IDT descriptor types from trap gate to interrupt
gate.  Interrupts are re-enabled not earlier than the kernel segments
are loaded into the segment registers.  Second, we only load the
segment registers from the trap frame when returning to usermode.  For
the later, all interrupt return paths must happen through the doreti
common code.

There is no way to disable interrupts on call gate, which is the
supposed mode of servicing for lcall $7,$0 syscalls.  Change the LDT
descriptor 0 into a code segment type and point it to the userspace
trampoline which redirects the syscall to int $0x80.

All the measures make the segment register handling similar to that of
amd64.  We do not apply amd64 optimizations of not reloading segment
registers on return from the syscall.

Reported by: Maxime Villard <max@m00nbsd.net>
Tested by: pho (the non-lcall part)
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D12402

6 years agoAdd kern.features flag for MMCCAM
Ilya Bakulin [Mon, 18 Sep 2017 20:17:08 +0000 (20:17 +0000)]
Add kern.features flag for MMCCAM

kern.features.mmcam will be present and equal to 1 if the kernel has been
compiled with option MMCCAM.
This will help sdio-related userland tools to fail-fast if running on the kernel
without MMCCAM enabled.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D12386

6 years agoMake basic Broadcom I/O space reading functions work
Ilya Bakulin [Mon, 18 Sep 2017 20:01:01 +0000 (20:01 +0000)]
Make basic Broadcom I/O space reading functions work

It's now possible to use Broadcom functions to read the I/O registers of
SDIO card. The functions were copied from the BSD-licensed Broadcom Linux driver
as-is. To make it possible, a small Linux compatibility layer was introduced.

Currently the card responds with the correct version number ("magic")
when reading the corresponding address.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D12111

6 years agoDon't use an apostrophe in a possesive pronoun.
Cy Schubert [Mon, 18 Sep 2017 19:16:41 +0000 (19:16 +0000)]
Don't use an apostrophe in a possesive pronoun.

MFC after: 3 days

6 years agolinsysfs: quiet gcc -Wformat after r323692
Ryan Libby [Mon, 18 Sep 2017 19:09:40 +0000 (19:09 +0000)]
linsysfs: quiet gcc -Wformat after r323692

Reviewed by: cem
Sponsored by: Dell EMC Isilon

6 years agoHide a normal probe warning message under bootverbose, similar to atkbdc
Scott Long [Mon, 18 Sep 2017 18:42:28 +0000 (18:42 +0000)]
Hide a normal probe warning message under bootverbose, similar to atkbdc

Sponsored by: Netflix

6 years agolinsysfs(5): Fix two unrelated issues
Conrad Meyer [Mon, 18 Sep 2017 17:14:13 +0000 (17:14 +0000)]
linsysfs(5): Fix two unrelated issues

1. Swap the order of device_get_ivars with device_get_devclass and devclass
   name validation.  This bug was introduced in r323692.

2. Error check device_get_children and free the returned list.  This bug was
   introduced in the original linsysfs commit.

Reported by: Oleg V. Nauman <oleg AT theweb.org.ua>, hselasky (1); hselasky (2)
Reviewed by: hselasky
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12407

6 years agoRevert tcpdump to using the source manpage instead of having a copy here.
Gordon Tetlow [Mon, 18 Sep 2017 16:42:13 +0000 (16:42 +0000)]
Revert tcpdump to using the source manpage instead of having a copy here.

This helps future maintainability of tcpdump so we don't forget to update
the manpage (like we have previously).

Stolen from: usr.bin/file/Makefile
Reviewed by: jilles
Approved by: delphij (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D12403

6 years agoloader: biosmem allocate heap just below 4GB
Toomas Soome [Mon, 18 Sep 2017 15:17:01 +0000 (15:17 +0000)]
loader: biosmem allocate heap just below 4GB

The current biosmem code is walking bios smap entries and looking for smap
entry just below 4GB line, if there is such entry, its base and size is set
for heap base and size. Instead of entry base, we should use last HEAP_MIN
(currently 64MB) bytes just below 4GB, to make maximum space for kernel and
modules.

The problem was revealed on ASUS B350M-A system board, an AMD Ryzen 3 1200 CPU

memory map:

SMAP type=01 base=0000000000000000 len=000000000009d400 attr=01
SMAP type=02 base=000000000009d400 len=0000000000002c00 attr=01
SMAP type=02 base=00000000000e0000 len=0000000000020000 attr=01
SMAP type=01 base=0000000000100000 len=0000000009c00000 attr=01
SMAP type=02 base=0000000009d00000 len=0000000000300000 attr=01
SMAP type=01 base=000000000a000000 len=00000000be69b000 attr=01
SMAP type=03 base=00000000c869b000 len=0000000000016000 attr=01
SMAP type=01 base=00000000c86b1000 len=00000000124e7000 attr=01
SMAP type=02 base=00000000dab98000 len=0000000000138000 attr=01
SMAP type=03 base=00000000dacd0000 len=0000000000008000 attr=01
SMAP type=01 base=00000000dacd8000 len=0000000000100000 attr=01
SMAP type=04 base=00000000dadd8000 len=00000000003b3000 attr=01
SMAP type=02 base=00000000db18b000 len=0000000000d42000 attr=01
SMAP type=01 base=00000000dbecd000 len=0000000002133000 attr=01
SMAP type=01 base=0000000100000000 len=000000011f380000 attr=01
SMAP type=02 base=00000000de000000 len=0000000002000000 attr=01
SMAP type=02 base=00000000f8000000 len=0000000004000000 attr=01
SMAP type=02 base=00000000fdf00000 len=0000000000100000 attr=01
SMAP type=02 base=00000000fea00000 len=0000000000010000 attr=01
SMAP type=02 base=00000000feb80000 len=0000000000082000 attr=01
SMAP type=02 base=00000000fec10000 len=0000000000001000 attr=01
SMAP type=02 base=00000000fec30000 len=0000000000001000 attr=01
SMAP type=02 base=00000000fed00000 len=0000000000001000 attr=01
SMAP type=02 base=00000000fed40000 len=0000000000005000 attr=01
SMAP type=02 base=00000000fed80000 len=0000000000010000 attr=01
SMAP type=02 base=00000000fedc2000 len=000000000000e000 attr=01
SMAP type=02 base=00000000fedd4000 len=0000000000002000 attr=01
SMAP type=02 base=00000000fee00000 len=0000000000100000 attr=01
SMAP type=02 base=00000000ff000000 len=0000000001000000 attr=01

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D12368

6 years agoBump the __FreeBSD_version after recent LinuxKPI changes.
Hans Petter Selasky [Mon, 18 Sep 2017 13:39:51 +0000 (13:39 +0000)]
Bump the __FreeBSD_version after recent LinuxKPI changes.

MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoThe LinuxKPI atomics do not have acquire nor release semantics unless
Hans Petter Selasky [Mon, 18 Sep 2017 13:37:14 +0000 (13:37 +0000)]
The LinuxKPI atomics do not have acquire nor release semantics unless
specified. Fix code to use READ_ONCE() and WRITE_ONCE() where appropriate.

Suggested by: kib @
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoOnly wire pages in the LinuxKPI instead of holding and wiring them.
Hans Petter Selasky [Mon, 18 Sep 2017 13:23:59 +0000 (13:23 +0000)]
Only wire pages in the LinuxKPI instead of holding and wiring them.
This prevents the page daemon from regularly scanning the held pages.

Suggested by: kib @
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agoAdd support for shared memory functions to the LinuxKPI.
Hans Petter Selasky [Mon, 18 Sep 2017 13:17:23 +0000 (13:17 +0000)]
Add support for shared memory functions to the LinuxKPI.

Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies

6 years agolinsysfs(5): Add support for recent libdrm
Conrad Meyer [Sun, 17 Sep 2017 23:40:16 +0000 (23:40 +0000)]
linsysfs(5): Add support for recent libdrm

Expose more information about PCI devices (and GPUs in particular) via
linsysfs to libdrm.

This allows unmodified modern 64-bit Linux libdrm to work, which allows
modern Linux Mesa to work.  The submitter reports that he tested the change
with an Ubuntu 16.04 chroot + amdgpu from graphics/drm-next-kmod.

PR: 222375
Submitted by: Greg V <greg AT unrelenting.technology>

6 years agoGive icee(4) a detach() method so it can be used as a module. Add a
Ian Lepore [Sun, 17 Sep 2017 22:58:13 +0000 (22:58 +0000)]
Give icee(4) a detach() method so it can be used as a module.  Add a
module makefile for it.

6 years agoMCA: Expand AMD Thresholding support to cover all banks
Conrad Meyer [Sun, 17 Sep 2017 22:58:13 +0000 (22:58 +0000)]
MCA: Expand AMD Thresholding support to cover all banks

When it was added in r314636, AMD Thresholding was hardcoded to only
bank 4 (Northbridge) for some reason.  However, even on family 10h the
MCAx_MISC register Valid/Present bits determine whether thresholding is
supported on that bank.

Expand thresholding support to monitor all monitorable banks.  This
simplifies some of the logic and makes it more consistent with our Intel
CMCI support.

Reviewed by: markj (earlier version)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12321

6 years agoFix bogus FREAD with NFSV4OPEN_ACCESSREAD. No functional change.
Rick Macklem [Sun, 17 Sep 2017 22:18:01 +0000 (22:18 +0000)]
Fix bogus FREAD with NFSV4OPEN_ACCESSREAD. No functional change.

The code in nfscl_doflayoutio() bogusly used FREAD instead of
NFSV4OPEN_ACCESSREAD. Since both happen to be defined as "1", this
worked and the patch doesn't result in a functional change.
Found by inspection during development of Flex File Layout support.

MFC after: 2 weeks

6 years agoDon't use a non-zero argument for __builtin_frame_address
Justin Hibbits [Sun, 17 Sep 2017 20:07:20 +0000 (20:07 +0000)]
Don't use a non-zero argument for __builtin_frame_address

__builtin_frame_address with a non-zero argument is unsafe and rejected by
newer gcc.  Since it doesn't seem to impact the stacktrace, don't bother
with gymnastics to unwind to a different frame for starting.

PR: kern/220118
MFC after: 2 weeks

6 years agoPrint the correct bitmask for the running Book-E CPU
Justin Hibbits [Sun, 17 Sep 2017 19:40:17 +0000 (19:40 +0000)]
Print the correct bitmask for the running Book-E CPU

All the Book-E world is no longer e500v{1,2}.  e500mc the 64-bit derivatives do
not use the DOZE/NAP bits with MSR[WE], instead using the `wait' instruction to
wait for interrupts, and SoC plane controls (via CCSR) for power management.

MFC after: 1 week

6 years agoMFV r323678: file 5.32
Gordon Tetlow [Sun, 17 Sep 2017 19:14:38 +0000 (19:14 +0000)]
MFV r323678: file 5.32

Approved by: emaste (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D12400

6 years agoVendor import of file 5.32.
Gordon Tetlow [Sun, 17 Sep 2017 15:57:06 +0000 (15:57 +0000)]
Vendor import of file 5.32.

6 years agoImplement mmu_page_init for AIM platforms.
Mark Johnston [Sun, 17 Sep 2017 15:40:12 +0000 (15:40 +0000)]
Implement mmu_page_init for AIM platforms.

As of r323290 we cannot rely on the vm_page array being
zero-initialized.

Reported and tested by: andreast
MFC after: 1 week

6 years agolibsysdecode: report invalid cap_rights_t
Ed Maste [Sun, 17 Sep 2017 14:03:54 +0000 (14:03 +0000)]
libsysdecode: report invalid cap_rights_t

Previously we'd have an assertion failure in cap_rights_is_set if
sysdecode_cap_rights is called with an invalid cap_rights_t, so test for
validity first.

PR: 222258
Reviewed by: cem
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12391

6 years agoFix language used in the r322923.
Mariusz Zaborski [Sun, 17 Sep 2017 10:28:45 +0000 (10:28 +0000)]
Fix language used in the r322923.

Pointed out by: wblock@
MFC after:      1 week
X-MFC-with:     r322923

6 years agoFix an accounting bug and use sctp_timer_start to start a timer.
Michael Tuexen [Sun, 17 Sep 2017 09:27:27 +0000 (09:27 +0000)]
Fix an accounting bug and use sctp_timer_start to start a timer.

MFC after: 1 week

6 years agoRemove code not used on any platform currently supported.
Michael Tuexen [Sat, 16 Sep 2017 21:26:06 +0000 (21:26 +0000)]
Remove code not used on any platform currently supported.

MFC after: 1 week

6 years agoModify blst_leaf_alloc to take only the cursor argument.
Alan Cox [Sat, 16 Sep 2017 18:12:15 +0000 (18:12 +0000)]
Modify blst_leaf_alloc to take only the cursor argument.

Modify blst_leaf_alloc to find allocations that cross the boundary between
one leaf node and the next when those two leaves descend from the same
meta node.

Update the hint field for leaves so that it represents a bound on how
large an allocation can begin in that leaf, where it currently represents
a bound on how large an allocation can be found within the boundaries of
the leaf.

The first phase of blst_leaf_alloc currently shrinks sequences of
consecutive 1-bits in mask until each has been shrunken by count-1 bits,
so that any bits remaining show where an allocation can begin, or until
all the bits have disappeared, in which case the allocation fails. This
change amends that so that the high-order bit is copied, as if, when the
last block was free, it was followed by an endless stream of free
blocks. It also amends the early stopping condition, so that the shrinking
of 1-sequences stops early when there are none, or there is only one
unbounded one remaining.

The search for the first set bit is unchanged, and the code path
thereafter is mostly unchanged unless the first set bit is in a position
that makes some of those copied sign bits matter. In that case, we look
for a next leaf, and at what blocks it can provide, to see if a
cross-boundary allocation is possible.

The hint is updated on a successful allocation that clears the last bit,
but it not updated on a failed allocation that leaves the last bit
set. So, as long as the last block is free, the hint value for the leaf is
large. As long as the last block is free, and there's a next leaf, a large
allocation can begin here, perhaps. A stricter rule than this would mean
that allocations and frees in one leaf could require hint updates to the
preceding leaf, and this change seeks to leave the freeing code
unmodified.

Define BLIST_BMAP_MASK, and use it for bit masking in blst_leaf_free and
blist_leaf_fill, as well as in blst_leaf_alloc.

Correct a panic message in blst_leaf_free.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: markj (an earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11819

6 years agoAdd missing links to the nv man page.
Mariusz Zaborski [Sat, 16 Sep 2017 17:52:25 +0000 (17:52 +0000)]
Add missing links to the nv man page.

MFC after: 1 week

6 years agoFix names of the array functions in the nv man page.
Mariusz Zaborski [Sat, 16 Sep 2017 17:50:24 +0000 (17:50 +0000)]
Fix names of the array functions in the nv man page.

Submitted by: def@
MFC after: 1 week

6 years agokern.osreldate is an integer, not a string
Allan Jude [Sat, 16 Sep 2017 16:23:00 +0000 (16:23 +0000)]
kern.osreldate is an integer, not a string

PR: 217501
Submitted by: Yavuz Tanriverdi <stemix@gmail.com>
MFC after: 1 week

6 years agoAdd a missing header file to SRCS to fix out-of-kernel builds.
Ian Lepore [Sat, 16 Sep 2017 16:09:05 +0000 (16:09 +0000)]
Add a missing header file to SRCS to fix out-of-kernel builds.

PR: 222354
Submitted by: eugen@
Pointy hat: ian@

6 years agoAllwinner usb phy: Rework resource allocation
Emmanuel Vadot [Sat, 16 Sep 2017 15:58:20 +0000 (15:58 +0000)]
Allwinner usb phy: Rework resource allocation

The usbphy node for allwinner have two kind of resources, one for the
phy_ctrl and one per phy. Instead of blindy allocating resources, alloc
the phy_ctrl and pmu ones separately.
Also add a configuration struct for all different phy that hold the difference
between them (number of phys, unknow needed register write etc ...).

While here remove A83T code as upstream and FreeBSD dts don't have
nodes for USB.

This (plus 323640) re-enable OHCI on Pine64 on the bottom USB port.
The top USB port is routed to the OHCI0/EHCI0 which is by default in OTG mode.
While the phy code can handle the re-route to standard OHCI/EHCI we still need
a driver for musb to probe and configure it in host mode.

EHCI is still buggy on Pine64 (hang the board) so do not enable it for now.

Tested On: Bananapi (A20), BananapiM2 (A31S), OrangePi One (H3) Pine64 (A64)

6 years agoA64 CCUNG: Correct gate and reset for OHCI0/1
Emmanuel Vadot [Sat, 16 Sep 2017 15:50:31 +0000 (15:50 +0000)]
A64 CCUNG: Correct gate and reset for OHCI0/1

Reported by: jmcneill
Pointy Hat: manu

6 years agoAllwinner: a10_gpio Fix panic on multiple lock
Emmanuel Vadot [Sat, 16 Sep 2017 14:08:20 +0000 (14:08 +0000)]
Allwinner: a10_gpio Fix panic on multiple lock

r323392 introduce gpio_pin_get/gpio_pin_set for a10_gpio driver.
When called via gpio method they must aquire the device lock while
when they are called via gpio_pin_configure the lock is already aquire.

Introduce a10_gpio_pin_{s,g}et_locked and call them in pin_gpio_configure
instead.

Tested On: BananaPi (A20)

Reported by: Richard Puga richard@puga.net

6 years agoUse OBJS_SRCS_FILTER to control setting OBJS from SRCS
Simon J. Gerraty [Sat, 16 Sep 2017 05:42:27 +0000 (05:42 +0000)]
Use OBJS_SRCS_FILTER to control setting OBJS from SRCS

Some makefiles do reachover builds.
In some cases it is convenient to list subdirs of the distribution
in SRCS.

It is not very convenient, or always even desirable to have corresponding
subdirs in .OBJDIR, so OBJS_SRCS_FILTER allows the makefile to choose.
The default value 'R' matches existing practice.

But a makefile can set OBJS_SRCS_FILTER= T (the R gets added by
bsd.init.mk) to avoid the need for subdirs in .OBJDIR

Differential Revision: https://reviews.freebsd.org/D12218
Reviewed by: bdrewery

6 years agoRevert r323516 (iflib rollup)
Stephen Hurd [Sat, 16 Sep 2017 02:41:38 +0000 (02:41 +0000)]
Revert r323516 (iflib rollup)

This was really too big of a commit even if everything worked, but there
are multiple new issues introduced in the one huge commit, so it's not
worth keeping this until it's fixed.

I'll work on splitting this up into logical chunks and introduce them one
at a time over the next week or two.

Approved by: sbruno (mentor)
Sponsored by: Limelight Networks

6 years agoAdd missing newline after unknown MIPS-specific dynamic entries.
John Baldwin [Fri, 15 Sep 2017 22:56:39 +0000 (22:56 +0000)]
Add missing newline after unknown MIPS-specific dynamic entries.

Reviewed by: emaste
Sponsored by: DARPA / AFRL
Differential Revision: https://reviews.freebsd.org/D12384

6 years agoAdd an -a flag to getconf.
John Baldwin [Fri, 15 Sep 2017 22:55:15 +0000 (22:55 +0000)]
Add an -a flag to getconf.

When -a is specified, the name and value of all system or path
configuration values is reported to standard output.

Reviewed by: kib (earlier version)
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D12373

6 years agoAvoid reusing the wrong buffer for a DDP AIO request.
John Baldwin [Fri, 15 Sep 2017 22:40:57 +0000 (22:40 +0000)]
Avoid reusing the wrong buffer for a DDP AIO request.

To optimize the case of ping-ponging between two buffers, the DDP code
caches the last two buffers used keeping the pages wired and page pods
stored in the NIC's RAM.  If a new aio_read() request uses one of the
same buffers, then the work of holding pages, etc. can be avoided.
However, the starting virtual address of an aio buffer was not saved,
only the page count, length, and initial page offset.  Thus, an
aio_read() request could match a different buffer in the address
space.  (Earlier during development vm_fault_hold_quick_pages() was
always called and the vm_page_t values were compared, but that was
eventually removed without being adequately replaced.)  Fix by storing
the starting virtual address and comparing that (along with other
fields) to determine if a buffer can be reused.

MFC after: 3 days
Sponsored by: Chelsio Communications

6 years agoFix line wrap issues.
Scott Long [Fri, 15 Sep 2017 20:58:52 +0000 (20:58 +0000)]
Fix line wrap issues.

Sponsored by: Netflix

6 years agoRemove tailing whitespace.
Michael Tuexen [Fri, 15 Sep 2017 20:46:51 +0000 (20:46 +0000)]
Remove tailing whitespace.

6 years agoRemove empty line accidently introduced in r323626.
Michael Tuexen [Fri, 15 Sep 2017 20:41:12 +0000 (20:41 +0000)]
Remove empty line accidently introduced in r323626.

6 years agoAdd references. Suggested by Maxim Konovalov.
Michael Tuexen [Fri, 15 Sep 2017 20:34:52 +0000 (20:34 +0000)]
Add references. Suggested by Maxim Konovalov.

Sponsored by: Netflix, Inc.

6 years agoAllow multiple TRIMs to be done for nda
Warner Losh [Fri, 15 Sep 2017 20:16:06 +0000 (20:16 +0000)]
Allow multiple TRIMs to be done for nda

Don't call cam_iosched_trim_done or cam_iosched_submit_trim for nda
since its hardware can handle almost an arbitrary number of TRIMs and
we don't have to be careful to only ever do one.

Sponsored by: Netflix

6 years agoUpdate comments on what the CAM_IOSCHED_FLAG_TRIM_ACTIVE means.
Warner Losh [Fri, 15 Sep 2017 20:15:55 +0000 (20:15 +0000)]
Update comments on what the CAM_IOSCHED_FLAG_TRIM_ACTIVE means.

It's intended only for those situations where the periph driver
ones to limit the number of trims active to one and only one.
Also update comments on associated functions.

Sponsored by: Netflix

6 years agorename(2): document capability mode errors
Ed Maste [Fri, 15 Sep 2017 20:12:38 +0000 (20:12 +0000)]
rename(2): document capability mode errors

Reviewed by: allanjude
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12339

6 years agoopen(2): update ENOTCAPABLE description for .. lookups
Ed Maste [Fri, 15 Sep 2017 20:05:55 +0000 (20:05 +0000)]
open(2): update ENOTCAPABLE description for .. lookups

After r308212 Capsicum permits .. lookups in capability mode, as long as
path component traversal does not escape the directory corresponding to
the provided file descriptor.

We should add a description of the vfs.lookup_cap_dotdot and
vfs.lookup_cap_dotdot_nonlocal sysctls, perhaps as a cross-reference to
capsicum(4). I intend to look at that soon.

Reviewed by: bjk, cem, kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12343

6 years agoAdd MIPS32/64 Rev2 CP0 intctl register definitions.
Landon J. Fuller [Fri, 15 Sep 2017 19:56:21 +0000 (19:56 +0000)]
Add MIPS32/64 Rev2 CP0 intctl register definitions.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D12300

6 years agoFix the raise tests.
Bryan Drewery [Fri, 15 Sep 2017 19:48:48 +0000 (19:48 +0000)]
Fix the raise tests.

- The exit probe was not appropriately filtered to only the known pid so it
  was firing on any random process that would exit rather the only the one
  we cared about.
- The dtest script executes the tst.raise*.exe in the background from
  POSIX sh without jobs control.  POSIX mandates that SIGINT be set to
  SIG_IGN in this case.  The test executable never actually tested that
  SIGINT could be caught despite trying to block and delay the signal.
  So the SIGINT sent from raise() is never actually received since it
  is ignored.  This could be fixed by calling 'trap - INT' from dtest
  before running the executable but I've opted to just use SIGUSR1
  instead in these specific tests rather than adding more logic to
  test that SIGINT is not ignored at startup.

These 2 issues meant that the tests would randomly work but only if a process
coincidentally exited during the test.

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

6 years agoMiscellaneous fixes and improvements to MMCCAM stack
Ilya Bakulin [Fri, 15 Sep 2017 19:47:44 +0000 (19:47 +0000)]
Miscellaneous fixes and improvements to MMCCAM stack

 * Demote the level of several debug messages to CAM_DEBUG_TRACE
 * Add detection for SDHC cards that can do 1.8V. No voltage switch sequence
   is issued yet;
 * Don't create a separate LUN for each SDIO function. We need just one to make
   pass(4) attach;
 * Remove obsolete mmc_sdio* files. SDIO functionality will be moved into the
   separate device that will manage a new sdio(4) bus;
 * Terminate probing if got no reply to CMD0;
 * Make bcm2835 SDHCI host controller driver compile with 'option MMCCAM'.

Approved by: imp (mentor)
Differential Revision: https://reviews.freebsd.org/D12109

6 years agoBatch freeing of the pages in vm_object_page_remove() under the same
Konstantin Belousov [Fri, 15 Sep 2017 16:07:09 +0000 (16:07 +0000)]
Batch freeing of the pages in vm_object_page_remove() under the same
free queue mutex lock owning session, same as it was done for the
object termination in r323561.

Reported and tested by: mjg
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 years agobsdgrep: disable TRE implementation by default
Kyle Evans [Fri, 15 Sep 2017 15:57:15 +0000 (15:57 +0000)]
bsdgrep: disable TRE implementation by default

Start the phasing out of TRE by disabling it by default. r317254 introduced
a BSD_GREP_FASTMATCH knob (defaulting to on) for testing of bsdgrep with and
without TRE enabled. More bugs have cropped up since then, and
WITHOUT_BSD_GREP_FASTMATCH has shown in testing to be more stable than its
counterpart.

Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D12381

6 years agoAdd support for parsing the Watchdog Descriptor Table (WDDT)
Scott Long [Fri, 15 Sep 2017 15:41:07 +0000 (15:41 +0000)]
Add support for parsing the Watchdog Descriptor Table (WDDT)

Sponsored by: Netflix

6 years agoInclude _bitset.h to get BITSET_DEFINE, used to define struct slabbits.
Mark Johnston [Fri, 15 Sep 2017 14:59:35 +0000 (14:59 +0000)]
Include _bitset.h to get BITSET_DEFINE, used to define struct slabbits.

MFC after: 1 week

6 years agogmirror: treat ENXIO as disk disconnect, not media error
Andriy Gapon [Fri, 15 Sep 2017 13:57:08 +0000 (13:57 +0000)]
gmirror: treat ENXIO as disk disconnect, not media error

In theory, all data access errors mean that a member is out of sync
at most.  But they were treated as more serious errors to avoid the
situation where a flaky disk gets repeatedly disconnected, re-synchronized,
reconnected and then disconnected again.

ENXIO is a special error that means that the member disk disappeared,
so it should get the same handling as the GEOM orphaning event.
There is a better chance that when the disk is reconnected, it will be
a good member again.

When ENXIO happens on a read we use the exisiting G_MIRROR_BUMP_SYNCID
mechanism which means that the mirror's syncid is increased as soon
as there is a write to the mirror.  That's because no data has got out
of sync yet, but the problematic memeber is disconnected, so the future
write will make it stale.

When ENXIO happens on a write we use a new G_MIRROR_BUMP_SYNCID_NOW
mechanism which means that we update the mirror metadata as soon as
possible because the problematic memeber is already behind.

Reviewed by: markj, imp
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9463

6 years agofastmatch.h: remove duplicate #defines
Ed Maste [Fri, 15 Sep 2017 13:34:00 +0000 (13:34 +0000)]
fastmatch.h: remove duplicate #defines

Reviewed by: kevans
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D12375

6 years agoAdd the ARMv8.3 ID register fields. These were found in the A-Profile
Andrew Turner [Fri, 15 Sep 2017 12:57:34 +0000 (12:57 +0000)]
Add the ARMv8.3 ID register fields. These were found in the A-Profile
exploration tools documentation:
https://developer.arm.com/products/architecture/a-profile/exploration-tools

Sponsored by: DARPA, AFRL