]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMFC r303763,303791,303869: zfs: honour and make use of vfs vnode locking protocol
avg [Thu, 11 Aug 2016 20:48:03 +0000 (20:48 +0000)]
MFC r303763,303791,303869: zfs: honour and make use of vfs vnode locking protocol

ZFS POSIX Layer is originally written for Solaris VFS which is very
different from FreeBSD VFS.  Most importantly many things that FreeBSD VFS
manages on behalf of all filesystems are implemented in ZPL in a different
way.
Thus, ZPL contains code that is redundant on FreeBSD or duplicates VFS
functionality or, in the worst cases, badly interacts / interferes
with VFS.

The most prominent problem is a deadlock caused by the lock order reversal
of vnode locks that may happen with concurrent zfs_rename() and lookup().
The deadlock is a result of zfs_rename() not observing the vnode locking
contract expected by VFS.

This commit removes all ZPL internal locking that protects parent-child
relationships of filesystem nodes.  These relationships are protected
by vnode locks and the code is changed to take advantage of that fact
and to properly interact with VFS.

Removal of the internal locking allowed all ZPL dmu_tx_assign calls to
use TXG_WAIT mode.

Another victim, disputable perhaps, is ZFS support for filesystems with
mixed case sensitivity.  That support is not provided by the OS anyway,
so in ZFS it was a buch of dead code.

To do:
- replace ZFS_ENTER mechanism with VFS managed / visible mechanism
- replace zfs_zget with zfs_vget[f] as much as possible
- get rid of not really useful now zfs_freebsd_* adapters
- more cleanups of unneeded / unused code
- fix / replace .zfs support

PR: 209158
Approved by: re (gjb)

7 years agoMFC r302836: 6874 rollback and receive need to reset ZPL state to what's on disk
avg [Thu, 11 Aug 2016 20:19:02 +0000 (20:19 +0000)]
MFC r302836: 6874 rollback and receive need to reset ZPL state to what's on disk

Approved by: re (gjb)

7 years agoMFC r303816 r303847
sbruno [Thu, 11 Aug 2016 19:13:30 +0000 (19:13 +0000)]
MFC r303816 r303847
- Update ixl(4) to Intel driver version ixl-1.6.6-k
- Fixup RSS builds of ixl(4) missed during testing.

Approved by: re (gjb)

7 years agoMFC r303457:
gallatin [Thu, 11 Aug 2016 19:05:47 +0000 (19:05 +0000)]
MFC r303457:
Call tcp_notify() directly to shoot down routes

Approved by: re (gjb)

7 years agoMFC r303842:
ae [Thu, 11 Aug 2016 10:41:19 +0000 (10:41 +0000)]
MFC r303842:
  Fix constructing of setdscp opcode with tablearg keyword.

  setdscp's argument can have zero value that conflicts with IP_FW_TARG
  value. Always set high-order bit if parser doesn't find tablearg keyword.

MFC r303845:
  Fix formatting of setfib opcode.

  Zero fib is correct value and it conflicts with IP_FW_TARG.
  Use bprint_uint_arg() only when opcode contains IP_FW_TARG,
  otherwise just print numeric value with cleared high-order bit.

Approved by: re (kib)

7 years agoMFC r303792:
tuexen [Thu, 11 Aug 2016 10:14:03 +0000 (10:14 +0000)]
MFC r303792:
Fix various bugs in relation to the I-DATA chunk support
This is joint work with rrs.

MFC r303793:
Mark an unused parameter as such.

MFC r303798:
Don't modify a structure without holding a reference count on it.

MFC r303813:
Remove stream queue entry consistently from wheel.
While there, improve the handling of drain.

MFC r303819:
Consistently check for unsent data on the stream queues.

MFC r303831:
Fix a locking issue found by stress testing with tsctp.
The inp read lock neeeds to be held when considering control->do_not_ref_stcb.

MFC r303834:
Fix the sending of FORWARD-TSN and I-FORWARD-TSN chunks. The
last SID/SSN pair wasn't filled in.
Thanks to Julian Cordes for providing a packetdrill script
triggering the issue and making me aware of the bug.

Approved by: re (kib)

7 years agoMFC r303583:
mjg [Thu, 11 Aug 2016 09:30:25 +0000 (09:30 +0000)]
MFC r303583:

amd64: implement pagezero using rep stos

The current implementation uses non-temporal writes. This turns out to
be detrimental to performance if the page is used shortly after, which
is the typical case with page faults.

Switch to rep stos.

Approved by: re (gjb)

7 years agoMFC r303562,303563,r303584,r303643,r303652,r303655,r303707:
mjg [Thu, 11 Aug 2016 09:28:49 +0000 (09:28 +0000)]
MFC r303562,303563,r303584,r303643,r303652,r303655,r303707:

    rwlock: s/READER/WRITER/ in wlock lockstat annotation

==

    sx: increment spin_cnt before cpu_spinwait in xlock

    The change is a no-op only done for consistency with the rest of the file.

==

    locks: change sleep_cnt and spin_cnt types to u_int

    Both variables are uint64_t, but they only count spins or sleeps.
    All reasonable values which we can get here comfortably hit in 32-bit range.

==

    Implement trivial backoff for locking primitives.

    All current spinning loops retry an atomic op the first chance they get,
    which leads to performance degradation under load.

    One classic solution to the problem consists of delaying the test to an
    extent. This implementation has a trivial linear increment and a random
    factor for each attempt.

    For simplicity, this first thouch implementation only modifies spinning
    loops where the lock owner is running. spin mutexes and thread lock were
    not modified.

    Current parameters are autotuned on boot based on mp_cpus.

    Autotune factors are very conservative and are subject to change later.

==

    locks: fix up ifdef guards introduced in r303643

    Both sx and rwlocks had copy-pasted ADAPTIVE_MUTEXES instead of the correct
    define.

==

    locks: fix compilation for KDTRACE_HOOKS && !ADAPTIVE_* case

==

    locks: fix sx compilation on mips after r303643

    The kernel.h header is required for the SYSINIT macro, which apparently
    was present on amd64 by accident.

Approved by: re (gjb)

7 years agoMFH (r303832): check whether each key file exists before adding it
des [Thu, 11 Aug 2016 08:29:15 +0000 (08:29 +0000)]
MFH (r303832): check whether each key file exists before adding it

PR: 208254
Approved by: re (kib)

7 years agoMFC r303773
alc [Wed, 10 Aug 2016 20:31:10 +0000 (20:31 +0000)]
MFC r303773
  Correct a spelling error.

Approved by: re (kib)

7 years agoMFC r303712:
kib [Wed, 10 Aug 2016 13:38:44 +0000 (13:38 +0000)]
MFC r303712:
Merge i386 and amd64 variants of mp_watchdog.c into x86/.

Approved by: re (gjb)

7 years agoMFC r303710:
kib [Wed, 10 Aug 2016 12:53:30 +0000 (12:53 +0000)]
MFC r303710:
Remove unneeded (recursing) Giant acquisition around vprintf(9).

MFC r303715:
Remove ncl_printf(), use printf(9) directly.

Approved by: re (gjb)

7 years agoMFC r303704:
kib [Wed, 10 Aug 2016 12:34:49 +0000 (12:34 +0000)]
MFC r303704:
Some style changes.  Fix a typo in comment.

MFC r303705:
Remove Giant asserts.  Update comment.

Approved by: re (gjb)

7 years agoMFC r303448:
kib [Wed, 10 Aug 2016 12:11:11 +0000 (12:11 +0000)]
MFC r303448:
Do not delegate a work to geom event thread which can be done inline.

MFC r303703:
Explain why swapgeom_close_ev() is delegated.

Approved by: re (gjb)

7 years agoMFC r303488 and r303771:
royger [Wed, 10 Aug 2016 08:05:48 +0000 (08:05 +0000)]
MFC r303488 and r303771:

xen-netfront: fix trying to send packets with disconnected netfront
xen-netfront: improve the logic when handling nic features from ioctl

Approved by: re (kib)

7 years agoMFC r303676:
dim [Tue, 9 Aug 2016 19:20:53 +0000 (19:20 +0000)]
MFC r303676:

Fix a segfault in bsdgrep when parsing the invalid extended regexps "?"
or "+" (these are invalid, because there is no preceding operand).

When bsdgrep attempts to emulate GNU grep in discarding and ignoring the
invalid ? or + operators, some later logic in tre_compile_fast() goes
beyond the end of the buffer, leading to a crash.

Fix this by bailing out, and reporting a bad pattern instead.

Approved by: re (gjb, kib)
Reported by: Steve Kargl

7 years agoMFC 303503: Don't treat NOCPU as a valid CPU to CPU_ISSET.
jhb [Tue, 9 Aug 2016 18:56:29 +0000 (18:56 +0000)]
MFC 303503: Don't treat NOCPU as a valid CPU to CPU_ISSET.

If a thread is created bound to a cpuset it might already be bound before
its very first timeslice, and td_lastcpu will be NOCPU in that case.

Approved by: re (gjb)

7 years agoUpdate the SRCBRANCH for release.sh to use stable/11 as the
gjb [Tue, 9 Aug 2016 15:59:57 +0000 (15:59 +0000)]
Update the SRCBRANCH for release.sh to use stable/11 as the
SRCBRANCH.

This is a direct commit to stable/11.

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

7 years agoMFC r303760:
loos [Tue, 9 Aug 2016 03:39:21 +0000 (03:39 +0000)]
MFC r303760:

Fix a regression in pf.conf while parsing the 'interval' keyword.

The bug was introduced by r287009.

PR: 210924
Submitted by: kp@
Sponsored by: Rubicon Communications (Netgate)
Pointy hat to: loos
Approved by: re (gjb)

7 years agoRegenerate for r303857.
bdrewery [Mon, 8 Aug 2016 21:19:57 +0000 (21:19 +0000)]
Regenerate for r303857.

Approved by: re (gjb, implicit)

7 years agoMFC r303755:
bdrewery [Mon, 8 Aug 2016 21:18:28 +0000 (21:18 +0000)]
MFC r303755:

  Still provide freebsd10_* symbols from libc for COMPAT10.

Approved by: re (gjb)

7 years agoMFC r303729:
bdrewery [Mon, 8 Aug 2016 20:23:11 +0000 (20:23 +0000)]
MFC r303729:

  Correct some comments.

Approved by: re (kib)

7 years agoMFC r303687:
bdrewery [Mon, 8 Aug 2016 20:15:00 +0000 (20:15 +0000)]
MFC r303687:

  Add link for getnetgrent_r(3).

Approved by: re (kib)

7 years agoMFC r303650:
bdrewery [Mon, 8 Aug 2016 19:43:07 +0000 (19:43 +0000)]
MFC r303650:

  opencrypto AES-ICM: Fix heap corruption typo

PR: 204009
Approved by: re (kib)

7 years agoMFC r303726
gonzo [Mon, 8 Aug 2016 17:53:51 +0000 (17:53 +0000)]
MFC r303726

Fix EHCI driver by excluding first 512K from available memory

On Zynq 256K-512K memory region is not accessible by all bus masters.
EHCI driver fails when trying to use it for DMA transfers. Patching
memory node does not help because ubldr overrides values there with
the ones obtained from u-boot. So as a workaround we just mark first
512K as reserved.

PR: 211484
Submitted by: Thomas Skibo <thoma555-bsd@yahoo.com>
Approved by: re (gjb)

7 years agoMFC r303788
vangyzen [Mon, 8 Aug 2016 15:07:38 +0000 (15:07 +0000)]
MFC r303788

Fix some logic in PCIe HotPlug; display EI status

The interpretation of the Electromechanical Interlock Status was
inverted, so we disengaged the EI if a card was inserted.
Fix it to engage the EI if a card is inserted.

When displaying the slot capabilites/status with pciconf:

- We inverted the sense of the Power Controller Control bit,
  saying the power was off when it was really on (according to
  this bit).  Fix that.

- Display the status of the Electromechanical Interlock:
EI(engaged)
EI(disengaged)

Approved by: re (gjb)
Sponsored by: Dell Inc.

7 years agoMFC r303782:
gjb [Mon, 8 Aug 2016 07:16:13 +0000 (07:16 +0000)]
MFC r303782:
  Fix GCE image publication.  The gcutil utility is deprecated in favor
  of gcloud.

Approved by: re (delphij, kib)
Sponsored by: The FreeBSD Foundation

7 years agoMFC 303737
sephe [Mon, 8 Aug 2016 07:09:40 +0000 (07:09 +0000)]
MFC 303737

    hyperv/storvsc: Claim SPC-3 conformance, thus enable UNMAP support

    The Hyper-V on pre-win10 systems will only report SPC-2 conformance,
    but it actually conforms to SPC-3.  The INQUIRY response is adjusted
    to propagate the SPC-3 version information to CAM.

    Submitted by:   Hongjiang Zhang <honzhan microsoft com>
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D7405

Approved by: re (delphij)

7 years agoMFC r302966:
oshogbo [Mon, 8 Aug 2016 06:33:57 +0000 (06:33 +0000)]
MFC r302966:
  Fix nvlist array memory leak.

  When we change nvl_array_next to NULL it means that we want to destroy
  or take nvlist_array. The nvpair, which stores next nvlist of
  nvlist_array element is no longer needed and can be freed.

  Submitted by: Adam Starak <starak.adam@gmail.com>
  Approved by: re (gjb)

7 years agoMFC r302965:
oshogbo [Mon, 8 Aug 2016 06:29:25 +0000 (06:29 +0000)]
MFC r302965:
  Fix memory leak in the nvlist string array.

  Submitted by: Adam Starak <starak.adam@gmail.com>
  Approved by: re (gjb)

7 years agoMFC 303076,303225: Use MTX_SYSINIT for the VESA lock.
jhb [Sat, 6 Aug 2016 23:52:09 +0000 (23:52 +0000)]
MFC 303076,303225: Use MTX_SYSINIT for the VESA lock.

303076:
vesa: fix panic on suspend

Fix the following panic seen when migrating a FreeBSD guest on Xen:

panic: mtx_lock() of destroyed mutex @ /usr/src/sys/dev/fb/vesa.c:541
cpuid = 0
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe001d2fa4f0
vpanic() at vpanic+0x182/frame 0xfffffe001d2fa570
kassert_panic() at kassert_panic+0x126/frame 0xfffffe001d2fa5e0
__mtx_lock_flags() at __mtx_lock_flags+0x15b/frame 0xfffffe001d2fa630
vesa_bios_save_restore() at vesa_bios_save_restore+0x78/frame 0xfffffe001d2fa680
vga_suspend() at vga_suspend+0xa3/frame 0xfffffe001d2fa6b0
isavga_suspend() at isavga_suspend+0x1d/frame 0xfffffe001d2fa6d0
bus_generic_suspend_child() at bus_generic_suspend_child+0x44/frame
[...]

This is caused because vga_sub_configure (which is called if the VGA adapter
is attached after VESA tried to initialize), points to vesa_configure, which
doesn't initialize the VESA mutex. In order to fix it, make sure
vga_sub_configure points to vesa_load, so that all the needed vesa
components are properly initialized.

303225:
Use MTX_SYSINIT for the VESA lock.

vesa_init_done isn't a reliable guard for the mutex init.  If
vesa_configure() doesn't find valid VESA info it will not set
vesa_init_done, but the lock will remain initialized.  Revert r303076
and use MTX_SYSINIT to deterministically init the lock.

PR: 209203
Approved by: re (gjb)

7 years agoMFC r303702:
kib [Sat, 6 Aug 2016 08:20:58 +0000 (08:20 +0000)]
MFC r303702:
Remove mention of Giant from the fork_return() description.

Approved by: re (gjb)

7 years agoMFC 303406,303501: Fix panic when using aio_fsync().
jhb [Fri, 5 Aug 2016 22:23:04 +0000 (22:23 +0000)]
MFC 303406,303501: Fix panic when using aio_fsync().

303406:
Adjust tests in fsync job scheduling loop to reduce indentation.

303501:
Fix locking issues with aio_fsync().

- Use correct lock in aio_cancel_sync when dequeueing job.
- Add _locked variants of aio_set/clear_cancel_function and use those
  to avoid lock recursion when adding and removing fsync jobs to the
  per-process sync queue.
- While here, add a basic test for aio_fsync().

PR: 211390
Approved by: re (kib)

7 years agoMFC 303497,303559,303645: Disable PCI-e hotplug on bridges with power
jhb [Fri, 5 Aug 2016 18:41:51 +0000 (18:41 +0000)]
MFC 303497,303559,303645: Disable PCI-e hotplug on bridges with power
controllers.

303497:
Add a loader tunable (hw.pci.enable_pcie_hp) to disable PCI-e HotPlug.

Some systems and/or devices (such as riser cards) do not include a
non-compliant implementation of PCI-e HotPlug that can result in devices
not being attached (e.g. the HotPlug code might assume that a card is
being unplugged and will power the slot off and detach it).  This
tunable can be set to 0 to disable support for PCI-e HotPlug ignoring
the incorrect HotPlug state on these slots.

303559:
Try to declare _hw_pci for all sysctl cases needed after r303497.

303645:
Disable PCI hotplug support for slots with power controllers.

After further review of the spec, I do not think the current HotPlug
code handles slots with power controllers correctly.  In particular,
the power state of the slot is to be inferred from other events, not
from examining the state of the power control bit in SLOT_CTL.  For now,
disable PCI hotplug support on such slots.

PR: 211081
Approved by: re (gjb)

7 years agoMFC r303492
alc [Fri, 5 Aug 2016 17:49:13 +0000 (17:49 +0000)]
MFC r303492
  Remove a probe declaration that has been unused since r292469, when
  vm_pageout_grow_cache() was replaced.

Approved by: re (gjb)

7 years agoMFC r302988:
loos [Fri, 5 Aug 2016 16:32:09 +0000 (16:32 +0000)]
MFC r302988:

Fix a random memory overwrite at boot time, simplebus_init() and
simplebus_add_device() expect a simplebus_softc structure associated with
the device.

Add the simplebus_softc as first member in am335x_pwmss_softc structure.

Sponsored by: Rubicon Communications (Netgate)
Approved by: re (gjb)

7 years agoMFH (r303716, r303719): drop SSH1 support, disable DSA by default
des [Fri, 5 Aug 2016 15:32:35 +0000 (15:32 +0000)]
MFH (r303716, r303719): drop SSH1 support, disable DSA by default

PR: 208254
Approved by: re (gjb)
Relnotes: yes

7 years agoMFH (r303289): update example section
des [Fri, 5 Aug 2016 15:30:05 +0000 (15:30 +0000)]
MFH (r303289): update example section

PR: 211361
Approved by: re (gjb)

7 years agoMFC r303657:
ae [Fri, 5 Aug 2016 15:12:29 +0000 (15:12 +0000)]
MFC r303657:
  Fix NULL pointer dereference.
  ro pointer can be NULL when IPSec consumes mbuf.

  PR: 211486
Approved by: re (gjb)

7 years agoMFC r303486:
ed [Fri, 5 Aug 2016 05:50:27 +0000 (05:50 +0000)]
MFC r303486:

  Mention that basename(3) and dirname(3) will change in the future.

  Update the existing manual pages for basename(3) and dirname(3) to
  mention that in future versions of FreeBSD, these functions will no
  longer use internal buffers for storing the results.

Approved by: re@

7 years agoUpdate stable/11 to BETA4 as part of the 11.0-RELEASE cycle.
gjb [Fri, 5 Aug 2016 00:00:02 +0000 (00:00 +0000)]
Update stable/11 to BETA4 as part of the 11.0-RELEASE cycle.

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

7 years agoMFC r303631:
dim [Thu, 4 Aug 2016 17:26:32 +0000 (17:26 +0000)]
MFC r303631:

Fix non-functional bsdinstall services dialog.

The most recent version of bsdinstall does not seem to respect any of
the checkboxes in the "Choose the services you would like to be started
at boot" dialog.  None of the chosen services end up in the rc.conf file
that is installed onto the target system.

This is caused by the bsdinstall/scripts/hardening script, which
implements the new hardening options dialog.  The script starts by
overwriting the previously written rc.conf.services file:

    echo -n > $BSDINSTALL_TMPETC/rc.conf.services

which is obviously incorrect.  It should clear out rc.conf.hardening
instead.

Approved by: re (kib)
Reviewed by: allanjude
PR: 211506
Differential Revision: https://reviews.freebsd.org/D7387

7 years agoMFC r303446:
kib [Thu, 4 Aug 2016 14:34:33 +0000 (14:34 +0000)]
MFC r303446:
Fix style and typo.

Approved by: re (gjb)

7 years agoMFC r303615:
ae [Thu, 4 Aug 2016 11:26:52 +0000 (11:26 +0000)]
MFC r303615:
  An old tables implementation had all tables preallocated,
  so when user did `ipfw table N flush` it always worked, but now
  when table N doesn't exist the kernel returns ESRCH error.
  This isn't fatal error for flush and destroy commands. Do not
  call err(3) when errno is equal to ESRCH. Also warn only when
  quiet mode isn't enabled. This fixes a regression in behavior,
  when old rules are loaded from file.
  Also use correct value for switch in the table_swap().

  Reported by: Kevin Oberman
Approved by: re (kib)

7 years agoMFC r303104, r303106:
brooks [Wed, 3 Aug 2016 16:10:53 +0000 (16:10 +0000)]
MFC r303104, r303106:

Update to reflect the fact that pipe() is a wrapper around the pipe2()
system call.

Reviewed by: jhb, wblock
Sponsored by: DAPRA, AFRL

Change wording to use function rather than system call in the
description
as well.

Authored by: zeising
Reviewed by: brooks

Approved by: re (gjb)
Sponsored by: DAPRA, AFRL

7 years agoMFC r303103:
brooks [Wed, 3 Aug 2016 15:39:58 +0000 (15:39 +0000)]
MFC r303103:

Minor wording improvements to the note about pipe(2) removal.

Approved by: re (gjb)
Sponsored by: DARPA, AFRL

7 years agoMFC r303490, r303491:
royger [Wed, 3 Aug 2016 13:19:58 +0000 (13:19 +0000)]
MFC r303490, r303491:

xen-intr: fix removal of event channels during resume
Revert r291022: x86/intr: allow mutex recursion in intr_remove_handler

Approved by: re (kib)

7 years agoMFC r303393:
kib [Wed, 3 Aug 2016 10:18:52 +0000 (10:18 +0000)]
MFC r303393:
Remove empty initializer for the once facility.

Approved by: re (gjb)

7 years agoMFC r303171: Fix per-connection L2 caching in fast path
karels [Wed, 3 Aug 2016 06:32:44 +0000 (06:32 +0000)]
MFC r303171: Fix per-connection L2 caching in fast path

r301217 re-added per-connection L2 caching from a previous change,
but it omitted caching in the fast path.  Add it.

Reviewed By: gallatin
Approved by: gnn (mentor)
Approved by: re (kostikbel)
Differential Revision: https://reviews.freebsd.org/D7239

7 years agoMFC r302550,r302551,r302552,r302553:
ngie [Wed, 3 Aug 2016 01:06:51 +0000 (01:06 +0000)]
MFC r302550,r302551,r302552,r302553:

Approved by: re (gjb)

r302550:

Deobfuscate cleanup path in clnt_dg_create(..)

Similar to r300836 and r301800, cl and cu will always be non-NULL as they're
allocated using the mem_alloc routines, which always use
`malloc(..., M_WAITOK)`.

Deobfuscating the cleanup path fixes a leak where if cl was NULL and
cu was not, cu would not be free'd, and also removes a duplicate test for
cl not being NULL.

CID: 10070331007344

r302551:

Deobfuscate cleanup path in clnt_vc_create(..)

Similar to r300836, r301800, and r302550, cl and ct will always
be non-NULL as they're allocated using the mem_alloc routines,
which always use `malloc(..., M_WAITOK)`.

CID: 1007342

r302552:

Convert `svc_xprt_alloc(..)` and `svc_xprt_free(..)`'s prototypes to
ANSI C style prototypes

r302553:

Don't test for xpt not being NULL before calling svc_xprt_free(..)

svc_xprt_alloc(..) will always return initialized memory as it uses
mem_alloc(..) under the covers, which uses malloc(.., M_WAITOK, ..).

CID: 1007341

7 years agoMFC r302576:
ngie [Wed, 3 Aug 2016 00:19:52 +0000 (00:19 +0000)]
MFC r302576:

Approved by: re (gjb)

r302576:

(Re-do r302574 with corrected commit message..)

Remove redundant declaration for tcp_dooptions

netinet/tcp_var.h already defines this function

PR: 209920
Tested with: clang 3.8.0, gcc 4.2.1, gcc 5.3.0

7 years agoMFC r302571,r302572,r302577,r302841:
ngie [Wed, 3 Aug 2016 00:03:03 +0000 (00:03 +0000)]
MFC r302571,r302572,r302577,r302841:

Approved by: re (gjb)

r302571:

Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix
-Wredundant-decls warning

PR: 209924
Tested with: devel/amd64-gcc (5.3.0)

r302572:

Remove redundant declarations for intel_fbc_enabled(..) and
i915_gem_dump_object(..) to fix -Wredundant-decls warning

PR: 209924
Tested with: devel/amd64-gcc (5.3.0)

r302577:

Add missing default case to capable(..) function definition

By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN
aren't possible. Add in a KASSERT safety belt and return false in
!INVARIANTS case if an invalid value is passed in, as it would be a
programmer error.

This fixes a -Wreturn-type error with gcc 5.3.0.

r302841:

Always panic if an invalid capability is passed to `capable(..)` instead of
just with INVARIANTS

rwatson's point was valid in the sense that if the data passed at runtime is
invalid, it should always trip the invariant, not just in the debug case.
This is a deterrent against malicious input, or input caused by hardware
errors.

Requested by: rwatson

7 years agoMFC r302581:
ngie [Tue, 2 Aug 2016 23:34:59 +0000 (23:34 +0000)]
MFC r302581:

Remove redundant declaration for tcp_dooptions, similar to r302576

netinet/tcp_var.h already defines this function

Approved by: re (gjb)
PR: 209920

7 years agoMFC r303414,r303415,r303417:
bdrewery [Tue, 2 Aug 2016 20:56:00 +0000 (20:56 +0000)]
MFC r303414,r303415,r303417:

  r303414:
    opt_random.h was removed in r287558 for opt_global.h
  r303415:
    opt_apic.h is only used on i386.
  r303417:
    opt_bdg.h was removed in r150636.

Approved by: re (gjb)

7 years agoMFC r303410,r303419:
bdrewery [Tue, 2 Aug 2016 20:18:43 +0000 (20:18 +0000)]
MFC r303410,r303419:

  r303410:
    Reconnect pmcstudy, lost in r291021
  r303419:
    Fix non-amd64 build from r292043 after reconnecting in r303410.

Approved by: re (kib)

7 years agoMFC r303328:
bdrewery [Tue, 2 Aug 2016 19:41:54 +0000 (19:41 +0000)]
MFC r303328:

  Add links for bit_ffc_at(3) and bit_ffs_at(3).

Approved by: re (kib)

7 years agoMFC r303343: Fix the case for some sysctl descriptions.
brd [Tue, 2 Aug 2016 18:46:11 +0000 (18:46 +0000)]
MFC r303343:  Fix the case for some sysctl descriptions.

Approved by: re (gjb)

7 years agoMFC r303638
sbruno [Tue, 2 Aug 2016 15:43:18 +0000 (15:43 +0000)]
MFC r303638

Unbreak NETMAP usage with em(4) broken in r293331.

Approved by: re (gjb)

7 years agoMerge r303264 and corrections:
glebius [Tue, 2 Aug 2016 14:14:36 +0000 (14:14 +0000)]
Merge r303264 and corrections:
  The date format for ru_RU.UTF-8 locale has changed some time ago, adjust
  the ru_RU.UTF-8 calendar files.

Approved by: re (kib)

7 years agoMerge r303263:
glebius [Tue, 2 Aug 2016 13:57:20 +0000 (13:57 +0000)]
Merge r303263:
  Partially revert r257696/r257713, which have an issue with writing to user
  controlled address. Restore the old code that emulated OSIOCGIFCONF in if.c.

Approved by: re (kib)

7 years agoMFC r303356 and r303465
alc [Mon, 1 Aug 2016 21:21:26 +0000 (21:21 +0000)]
MFC r303356 and r303465
  Remove any mention of cache (PG_CACHE) pages from the comments in
  vm_pageout_scan().  That function has not cached pages since r284376.

Approved by: re (kib)

7 years agoMFC r303396: rename ARM's libunwind.S to to avoid conflict with llvm libunwind
emaste [Mon, 1 Aug 2016 20:02:59 +0000 (20:02 +0000)]
MFC r303396: rename ARM's libunwind.S to to avoid conflict with llvm libunwind

llvm libunwind includes a libunwind.cpp, but on ARM libunwind.S is found
first in .PATH. Rename the latter one, since it is not going to be
updated again.

Approved by: re (kib)

7 years agoMFC r303338: vt: lock Giant around kbd calls in CONS_GETINFO
emaste [Mon, 1 Aug 2016 19:50:28 +0000 (19:50 +0000)]
MFC r303338:   vt: lock Giant around kbd calls in CONS_GETINFO

Note that keyboards are stored in an array and are not freed (just
"unregistered" by clearing some fields) so a race would be limited to
obtaining stale information about an unregistered keyboard.

Reported by: CTurt
Approved by: re (gjb, kib)

7 years agoMFC r303322,303326,303327,303345,303413,303416,303418,303557
sbruno [Mon, 1 Aug 2016 17:51:35 +0000 (17:51 +0000)]
MFC r303322,303326,303327,303345,303413,303416,303418,303557

Update iwm(4) and iwmfw(4) to current in order to stabilize and improve
functionality.

Approved by:    re (gjb)

7 years agoMFC r303520
vangyzen [Mon, 1 Aug 2016 16:39:40 +0000 (16:39 +0000)]
MFC r303520

Fix markup for -j in cpuset(1) synopsis

Approved by: re (kib)
Sponsored by: Dell Inc.

7 years agoMFC r303519
vangyzen [Mon, 1 Aug 2016 16:24:46 +0000 (16:24 +0000)]
MFC r303519

Fix two return types in the cpuset(9) and bitset(9) man pages

The *_FFS() and *_COUNT() functions return int, not size_t.

Approved by: re (gjb)
Sponsored by: Dell Inc.

7 years agoiMFC r303400: libcxxrt: fix demangling of wchar_t
emaste [Mon, 1 Aug 2016 16:18:01 +0000 (16:18 +0000)]
iMFC r303400: libcxxrt: fix demangling of wchar_t

'wchar_t' is 7 characters long, not 6. r303297 (MFC'd in r303398) fixed
this in libelftc, but not the second copy of this file that we have in
libcxxrt.

PR: 208661
Approved by: re (gjb)

7 years agoMFC r303521: libunwind: correct return code in unwinding trace log message
emaste [Mon, 1 Aug 2016 16:03:20 +0000 (16:03 +0000)]
MFC r303521: libunwind: correct return code in unwinding trace log message

Approved by: re (gjb)

7 years agoMFC r303282: avoid building otusfw when WITHOUT_SOURCELESS_UCODE set
emaste [Mon, 1 Aug 2016 15:49:50 +0000 (15:49 +0000)]
MFC r303282: avoid building otusfw when WITHOUT_SOURCELESS_UCODE set

PR: 204748
Approved by: re (kib)

7 years agoMFC r302614:
kib [Mon, 1 Aug 2016 06:34:55 +0000 (06:34 +0000)]
MFC r302614:
Revive the check, disabled in r197963.

MFC r302999:
On first exec after vfork(), call signotify() to handle pending
reenabled signals.

Approved by: re (delphij)

7 years agoMFC r303424:
kib [Sun, 31 Jul 2016 15:13:51 +0000 (15:13 +0000)]
MFC r303424:
Fix typo in comment.

Approved by: re (gjb)

7 years agoMFC r303456:
dim [Sun, 31 Jul 2016 15:03:31 +0000 (15:03 +0000)]
MFC r303456:

Add tblgen to ObsoleteFiles.inc, as it was renamed to llvm-tblgen.

Approved by: re (kib)
Noticed by: pluknet

7 years agoMFC r302929: Now that potentially buggy versions of Xen are automatically
cperciva [Sat, 30 Jul 2016 20:02:08 +0000 (20:02 +0000)]
MFC r302929: Now that potentially buggy versions of Xen are automatically
detected (see r302635, MFCed as r302895), there is no need to force msix
interrupt migration off via loader.conf.

Reverts: r302184
Approved by: re (gjb)

7 years agoMFC r303213:
kib [Sat, 30 Jul 2016 09:46:29 +0000 (09:46 +0000)]
MFC r303213:
Add missed required call to xo_finish() when only header is printed.

Approved by: re (gjb)

7 years agoMFC r303211:
kib [Sat, 30 Jul 2016 09:28:13 +0000 (09:28 +0000)]
MFC r303211:
Implement mtx_trylock_spin(9).

Approved by: re (gjb)

7 years agoUpdate stable/11 to BETA3 as part of the 11.0-RELEASE cycle.
gjb [Fri, 29 Jul 2016 00:00:54 +0000 (00:00 +0000)]
Update stable/11 to BETA3 as part of the 11.0-RELEASE cycle.

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

7 years agoMFC 303202: Update to note that operations on local files are safe.
jhb [Thu, 28 Jul 2016 21:16:18 +0000 (21:16 +0000)]
MFC 303202: Update to note that operations on local files are safe.

Approved by: re (gjb)

7 years agoMFC 303164: Add more documentation regarding unsafe AIO requests.
jhb [Thu, 28 Jul 2016 20:31:30 +0000 (20:31 +0000)]
MFC 303164: Add more documentation regarding unsafe AIO requests.

The asynchronous I/O changes made previously result in different
behavior out of the box. Previously all AIO requests failed with
ENOSYS / SIGSYS unless aio.ko was explicitly loaded. Now, some AIO
requests complete and others ("unsafe" requests) fail with EOPNOTSUPP.

Reword the introductory paragraph in aio(4) to add a general
description of AIO before describing the vfs.aio.enable_unsafe sysctl.

Remove the ENOSYS error description from aio_fsync(2), aio_read(2),
and aio_write(2) and replace it with a description of EOPNOTSUPP.

Remove the ENOSYS error description from aio_mlock(2).

Log a message to the system log the first time a process requests an
"unsafe" AIO request that fails with EOPNOTSUPP. This is modeled on
the log message used for processes using the legacy pty devices.

Approved by: re (gjb)

7 years agoMFC r302897:
robak [Thu, 28 Jul 2016 15:54:17 +0000 (15:54 +0000)]
MFC r302897:

Add new System Hardening menu and options to bsdinstall.

This patch add new 'hardening' file responsible for new bsdinstall
'System Hardening' menu allowing users to set some sane and carefully
picked system security options (like random process id's, hiding
other users/groups processes and others).

All options are OFF by default in this patch due to POLA principle
with intention to turn change some of them to ON by default in future.

Reviewed by: adrian, allanjude, bdrewery, nwhitehorn
Approved by: re@, adrian, allanjude

7 years agoMFC r303154:
kib [Thu, 28 Jul 2016 12:06:40 +0000 (12:06 +0000)]
MFC r303154:
Declare aio requests on files from local filesystems safe.

Approved by: re (gjb)

7 years agoMFC r303151:
kib [Thu, 28 Jul 2016 11:43:25 +0000 (11:43 +0000)]
MFC r303151:
Provide counter_warning(9) KPI.

MFC r303155:
Hide counted_warning(9) under #ifdef _KERNEL braces.

Approved by: re (gjb)

7 years agoMFC r303160.
cy [Wed, 27 Jul 2016 19:39:25 +0000 (19:39 +0000)]
MFC r303160.

Update leap-seconds to leap-seconds.3676752000.

As per https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16:

                                  UTC TIME STEP
                            on the 1st of January 2017

 A positive leap second will be introduced at the end of December 2016.
 The sequence of dates of the UTC second markers will be:

                          2016 December 31, 23h 59m 59s
                          2016 December 31, 23h 59m 60s
                          2017 January   1,  0h  0m  0s

 The difference between UTC and the International Atomic Time TAI is:

  from 2015 July 1, 0h UTC, to 2017 January 1 0h UTC   : UTC-TAI = - 36s
  from 2017 January 1, 0h UTC, until further notice    : UTC-TAI = - 37s

Obtained from: ftp://tycho.usno.navy.mil/pub/ntp/leap-seconds.3676752000
See also: https://www.iers.org/SharedDocs/News/EN/BulletinC.html
https://datacenter.iers.org/web/guest/eop/-/somos/5Rgv/latest/16

Relnotes: yes

Approved by: re@ (delphij@)

7 years agoMFC 303109: Update crashinfo to work with newer gdb from ports.
jhb [Wed, 27 Jul 2016 17:55:14 +0000 (17:55 +0000)]
MFC 303109: Update crashinfo to work with newer gdb from ports.

If gdb from ports is installed, use it instead of the base system gdb
to extract variables from a kernel.  Note that base gdb and ports gdb
do not support the same options for invoking a single command in batch
mode, so a wrapper shell function is used.  In addition, prefer kgdb
from ports when generating a backtrace if present.

PR: 193335
Approved by: re (gjb)

7 years agoMFC r303279: libelftc: fix demangling of wchar_t
emaste [Wed, 27 Jul 2016 17:10:09 +0000 (17:10 +0000)]
MFC r303279: libelftc: fix demangling of wchar_t

"wchar_t" is 7 characters long, not 6.

PR: 208661
Submitted by: Daniel McRobb
Approved by: re (kib)
Obtained from: ELF Tool Chain r3480

7 years agoMFC r303090:
kib [Wed, 27 Jul 2016 08:47:24 +0000 (08:47 +0000)]
MFC r303090:
Ensure that the UFS directory vnode' vm_object is properly sized
before UFS_BALLOC() is called.

Approved by: re (delphij)

7 years agoMFC r302842:
ngie [Wed, 27 Jul 2016 06:29:41 +0000 (06:29 +0000)]
MFC r302842:

Don't delete usr/share/local/kk_KZ.UTF-8 with "make delete-old" after r302329

kk_KZ.UTF-8 was originally removed in r290494, but restored as an alias to
en_US.UTF-8 in r302329

Approved by: re (kib)
PR: 211046

7 years agoMFC r303274:
bdrewery [Wed, 27 Jul 2016 05:38:09 +0000 (05:38 +0000)]
MFC r303274:

  Don't disable binutils/elftoolchain bootstrapping with external compiler.

Approved by: re (kib)

7 years agoMFC r303272,r303273:
bdrewery [Wed, 27 Jul 2016 05:17:55 +0000 (05:17 +0000)]
MFC r303272,r303273:

  r303272:
    SYSTEM_COMPILER: Rework the logic to allow a 'make test-system-compiler'.
  r303273:
    Fix empty WANT_COMPILER_TYPE when neither compiler is bootstrapped.

Approved by: re (kib)

7 years agoMFC r303115:
avos [Tue, 26 Jul 2016 20:26:03 +0000 (20:26 +0000)]
MFC r303115:

urtwn: fix A-MSDU tx aggregation when encryption is used.

Clear unused (undocumented) CAM bytes while setting a key;
without that, hardware does weird things when A-MSDU bit in QoS header
is set.

Tested with RTL8188CUS (AP) -> RTL8188EU (STA) (A-MSDU transmit).

Reported by: many
Approved by: re (gjb)
Obtained from: https://github.com/s3erios/urtwm

7 years agoMFC r303034: Include makewhatis in ITOOLS when MK_MAN_UTILS is true
emaste [Tue, 26 Jul 2016 15:22:21 +0000 (15:22 +0000)]
MFC r303034: Include makewhatis in ITOOLS when MK_MAN_UTILS is true

Previously it was conditional on MK_MAN. It's possible to build
FreeBSD with man pages but without man page tools. MK_MAN_UTILS
is the conditional used in share/man/Makefile for determining whether
makewhatis is executed at install time, so it is the proper one for
ITOOLS as well.

PR: 210142
Approved by: re (gjb)

7 years agoMFC r303046:
pfg [Tue, 26 Jul 2016 14:12:11 +0000 (14:12 +0000)]
MFC r303046:
libc: tag the rune initialization function prototypes visibility as hidden.

It is good practice to export as few symbols as possible from your shared
libraries, so use the GCC visibility attribute in this case, matching what
Apple's libc does.

Reference:
https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html

Hinted by: Apple's libc 1082.20.4
Approved by: re (gjb)

7 years agoMFC: r303039
manu [Tue, 26 Jul 2016 05:52:53 +0000 (05:52 +0000)]
MFC: r303039

Do not use TERM_EMU on arm and arm64 as it doesn't behave
well with serial console.

Approved by: re (gjb)

7 years agoMFC: r302790, r302795
allanjude [Tue, 26 Jul 2016 05:27:26 +0000 (05:27 +0000)]
MFC: r302790, r302795

Add new menu to bsdinstall to allow user to set date and time after
selecting timezone. The 'skip' button is the default selection.

Submitted by: des
Approved by: re (gjb)

7 years agoMFC: r302940
allanjude [Tue, 26 Jul 2016 05:26:53 +0000 (05:26 +0000)]
MFC: r302940

Fix error in bsdinstall triggered when doing a GELI encrypted install to
an MBR formatted disk

Approved by: re (gjb)
Sponsored by: ScaleEngine Inc.

7 years agoMFC: r302941
allanjude [Tue, 26 Jul 2016 05:26:07 +0000 (05:26 +0000)]
MFC: r302941

At the start of the installation process, all ZFS pools are exported and
all GELI instances are detached, to allow a restarted install to proceed.

PR: 210814
Approved by: re (gjb)

7 years agoMFC 302899: Add documentation for the sigevent structure.
jhb [Mon, 25 Jul 2016 23:37:47 +0000 (23:37 +0000)]
MFC 302899: Add documentation for the sigevent structure.

- Add a sigevent(3) manpage to give a general overview of the sigevent
  structure and the available notification mechanisms.
- Document that AIO requests contain a nested sigevent structure that can
  be used to request completion notification.
- Expand the sigevent details in other manuals to note details such as
  the extra values stored in a queued signal's information or in a posted
  kevent.

Approved by: re (gjb)

7 years agoMFC r303091
asomers [Mon, 25 Jul 2016 20:02:11 +0000 (20:02 +0000)]
MFC r303091

Fix camdd for host-aware and host-managed SMR disks.
This should've gone in as part of r300207

Approved by: re (gjb)

7 years agoMerge LLVM libunwind fixes
emaste [Mon, 25 Jul 2016 19:37:10 +0000 (19:37 +0000)]
Merge LLVM libunwind fixes

r302475: libunwind: limit stack usage in unwind cursor

This may be reworked upstream but in the interim should address the
stack usage issue reported in the PR.

r303061: libunwind: Properly align _Unwind_Exception.

_Unwind_Exception is required to be double word aligned.  GCC has
interpreted this to mean "use the maximum useful alignment for the
target" so follow that lead.

PR: 206384 (r302475)
Obtained from: LLVM review D22543 (r303061)
Approved by: re (gjb)

7 years agoMFC 302861: Fix rendering issues.
jhb [Mon, 25 Jul 2016 19:16:49 +0000 (19:16 +0000)]
MFC 302861: Fix rendering issues.

- Use Ta to separate column headers.
- Correct width of the 'Code' column in the last table.

Approved by: re (gjb)

7 years agoMFC r303195:
bdrewery [Mon, 25 Jul 2016 18:25:19 +0000 (18:25 +0000)]
MFC r303195:

  Don't run find(1) for __MPATH with NO_MODULES set.

Approved by: re (gjb)