]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
7 years agoMFC r302484: NewBus'ify NTB subsystem.
mav [Thu, 18 Aug 2016 10:39:00 +0000 (10:39 +0000)]
MFC r302484: NewBus'ify NTB subsystem.

This follows NTB subsystem modularization in Linux, tuning it to FreeBSD
native NewBus interfaces.  This change allows to support different types
of hardware with different drivers, support multiple NTB instances in a
system, ntb_transport module use for needs other then if_ntb, etc.

Sponsored by:   iXsystems, Inc.

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

7 years agoMFC r302483: Remove some dead code found by Clang static analyzer.
mav [Thu, 18 Aug 2016 10:25:07 +0000 (10:25 +0000)]
MFC r302483: Remove some dead code found by Clang static analyzer.

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

7 years agoMFC r302482: Fix NTB_SDOORBELL_LOCKUP workaround.
mav [Thu, 18 Aug 2016 10:24:31 +0000 (10:24 +0000)]
MFC r302482: Fix NTB_SDOORBELL_LOCKUP workaround.

Since SBARxSZ register can be write-once, it can be unusable for disabling
the SBAR.  For such case also set SBARxBASE to zero to not intersect with
config BAR.

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

7 years agoMFC r302014: Fix if_ntb interface setup to include IFF_MULTICAST.
mav [Thu, 18 Aug 2016 10:23:51 +0000 (10:23 +0000)]
MFC r302014: Fix if_ntb interface setup to include IFF_MULTICAST.

This allows IPv6 link local addresses (and other IPv6 functionality) to work.

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

7 years agoMFC r304149
sbruno [Thu, 18 Aug 2016 07:32:02 +0000 (07:32 +0000)]
MFC r304149

e1000:  Add support for Kaby Lake IDs

Fixup some errors when transitioning to/from low power states.

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

7 years agoMFC r289932, r289940:
kp [Wed, 17 Aug 2016 15:14:21 +0000 (15:14 +0000)]
MFC r289932, r289940:

PF_ANEQ() macro will in most situations returns TRUE comparing two identical
IPv4 packets (when it should return FALSE). It happens because PF_ANEQ() doesn't
stop if first 32 bits of IPv4 packets are equal and starts to check next 3*32
bits (like for IPv6 packet). Those bits containt some garbage and in result
PF_ANEQ() wrongly returns TRUE.

Fix: Check if packet is of AF_INET type and if it is then compare only first 32
bits of data.

PR:             204005
Submitted by:   Miłosz Kaniewski

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

7 years agoMFC r302497:
kp [Wed, 17 Aug 2016 09:24:46 +0000 (09:24 +0000)]
MFC r302497:

pf: Map hook returns onto the correct error values

pf returns PF_PASS, PF_DROP, ... in the netpfil hooks, but the hook callers
expect to get E<foo> error codes.
Map the returns values. A pass is 0 (everything is OK), anything else means
pf ate the packet, so return EACCES, which tells the stack not to emit an ICMP
error message.

PR:     207598

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

7 years agoMFC r303663:
kp [Wed, 17 Aug 2016 09:21:55 +0000 (09:21 +0000)]
MFC r303663:

pfctl: Allow TOS bits to be cleared

TOS value 0 is valid, so use 256 as an invalid value rather than zero.
This allows users to enforce TOS == 0 with pf.

Reported by:    Radek Krejča <radek.krejca@starnet.cz>

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

7 years agoMFC r303916:
kib [Wed, 17 Aug 2016 07:17:16 +0000 (07:17 +0000)]
MFC r303916:
Convert another tmpfs assert into runtime check.

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

7 years agoMFC r303914:
kib [Wed, 17 Aug 2016 07:13:25 +0000 (07:13 +0000)]
MFC r303914:
Re-schedule signals after kthread exits.

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

7 years agoMFC r303913:
kib [Wed, 17 Aug 2016 07:09:22 +0000 (07:09 +0000)]
MFC r303913:
Unconditionally perform checks that FPU region was entered, when #NM
exception is caught in kernel mode.

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

7 years agoMFstable/11 r304208:
ngie [Tue, 16 Aug 2016 08:30:28 +0000 (08:30 +0000)]
MFstable/11 r304208:

MFC r303830:

Remove vestigal references to __alpha__

Replace alpha reference in getconf(1) with amd64 [*]

PR:   211300 [*]

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

7 years agoMFC r302943,r302944,r303004,r303010,r303011,r303013,r303014,r303074,
ache [Tue, 16 Aug 2016 07:14:09 +0000 (07:14 +0000)]
MFC r302943,r302944,r303004,r303010,r303011,r303013,r303014,r303074,
    r303088,r303142,r303208,r303210,r303530,r303536,r303564,r303565,
    r303706

In short:

1) All situations with glob(3) error return codes are well defined by
POSIX, so rewrite old sporadic errors processing to match those
definitions.

Including subcases:

Both C99 and POSIX directly prohibits any standard function to set errno
to 0. Breaking this rule in 2001 NetBSD hack was imported which attempts
to workaround very limited glob(3) return codes amount.
Use POSIX-compatible workaround now with E2BIG which can't comes from
other functions used instead of prohibited 0.

Process errors happpens in (*readdirfunc)() too, as POSIX requires.

Per POSIX GLOB_NOCHECK should return original pattern,
unmodified, if no matches found. But our code strips all '\'
returning it. Rewrite the code to allow to return original pattern.

GLOB_ERR and gl_errfunc are supposed to work only for real directories
per POSIX, so don't act on missing or plain files for ENOENT or ENOTDIR
(as TODO in the code suggested).
Remove the hack in the manpage describing how to skip ENOENT and ENOTDIR
in gl_errfunc, it is unneeded now.

Per POSIX GLOB_ERR must be considered even if gl_errfunc is not set,
old code skips it in that case.

2) For near MAXPATHLEN long pathes old glob(3) code can operate on
truncated results, prevent it in several places.

3) Results was not sorted according to collate as POSIX requires.

4) globtilde() forget to convert expanded user home dir from multibyte to
wide chars. Moreover, those chars are addded as not protected, so
can be treated as special chars.

5) Backward hack for EILSEQ in g_Ctoc() was not implemented, so all
pathes with illegal byte sequences are skipped as result, implement it now.

6) GLOB_BRACE was somehow broken. First it repeatedly calls glob0() in
globexp1() recursive calls, but glob0() was not supposed to be called
repeatedly in the original code. It finalize results by possible adding
original pattern for no match case, may return GLOB_NOMATCH error and
by sorting all things. Original pattern adding or GLOB_NOMATCH error
can happens each time glob0() called repeatedly, and sorting happens
for one item only, all things are never sorted. Second, f.e. "a{a"
pattern does not match "a{a" file but match "a" file instead.
Third, some errors (f.e. for limits or overflow) can be ignored
by GLOB_BRACE code because it forces return (0).

Add non-finalizing flag to glob0() and make globexp0() wrapper around
recursively called globexp1() to finalize things like glob0() does.
Reorganize braces code to work correctly.

7) Don't allow MB_CUR_MAX * strlen overallocation hits GLOB_LIMIT_STRING
(ARG_MAX) limit, use final string length, not malloced space for it.

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

7 years agoMFC r303423:
kib [Mon, 15 Aug 2016 21:44:06 +0000 (21:44 +0000)]
MFC r303423:
Force SIGSTOP to be the first signal reported after the attach.

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

7 years agoMFC 302900,302902,302921,303461,304009:
jhb [Mon, 15 Aug 2016 21:10:41 +0000 (21:10 +0000)]
MFC 302900,302902,302921,303461,304009:
Add a mask of optional ptrace() events.

302900:
Add a test for user signal delivery.

This test verifies we get the correct ptrace event details when a signal
is posted to a traced process from userland.

302902:
Add a mask of optional ptrace() events.

ptrace() now stores a mask of optional events in p_ptevents.  Currently
this mask is a single integer, but it can be expanded into an array of
integers in the future.

Two new ptrace requests can be used to manipulate the event mask:
PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK
sets the current event mask.

The current set of events include:
- PTRACE_EXEC: trace calls to execve().
- PTRACE_SCE: trace system call entries.
- PTRACE_SCX: trace syscam call exits.
- PTRACE_FORK: trace forks and auto-attach to new child processes.
- PTRACE_LWP: trace LWP events.

The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have
been replaced by PTRACE_SCE and PTRACE_SCX.  PTRACE_FORK replaces
P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS.

The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for
compatibility but now simply toggle corresponding flags in the
event mask.

While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both
modify the event mask and continue the traced process.

302921:
Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL.

303461:
Note that not all optional ptrace events use SIGTRAP.

New child processes attached due to PTRACE_FORK use SIGSTOP instead of
SIGTRAP.  All other ptrace events use SIGTRAP.

304009:
Remove description of P_FOLLOWFORK as this flag was removed.

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

7 years agoMFC r303934,r303937,r303942:
bdrewery [Mon, 15 Aug 2016 11:54:29 +0000 (11:54 +0000)]
MFC r303934,r303937,r303942:

  r303934:
    Support rmdir(2).
  r303937:
    Use proper argument length for rmdir(2) for r303934.
  r303942:
    Fix sorting in r303934.

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

7 years agoMFC r303964:
bdrewery [Mon, 15 Aug 2016 09:39:26 +0000 (09:39 +0000)]
MFC r303964:

  PROGS: Support INTERNALPROG.prog=yes to not install it.

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

7 years agoMFC r302838: 6513 partially filled holes lose birth time
avg [Mon, 15 Aug 2016 09:19:26 +0000 (09:19 +0000)]
MFC r302838: 6513 partially filled holes lose birth time

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

7 years agoMFC r302837: 6844 dnode_next_offset can detect fictional holes
avg [Mon, 15 Aug 2016 09:16:08 +0000 (09:16 +0000)]
MFC r302837: 6844 dnode_next_offset can detect fictional holes

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

7 years agoMFC r302836: 6874 rollback and receive need to reset ZPL state to what's on disk
avg [Mon, 15 Aug 2016 09:12:54 +0000 (09:12 +0000)]
MFC r302836: 6874 rollback and receive need to reset ZPL state to what's on disk

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

7 years agoMFC r303870:
hselasky [Mon, 15 Aug 2016 09:09:01 +0000 (09:09 +0000)]
MFC r303870:
Fix for use after free.

Clear the device description to avoid use after free because the
bsddev is not destroyed when the mlx5en module is unloaded. Only when
the parent mlx5 module is unloaded the bsddev is destroyed. This fixes
a panic on listing sysctls which refer strings in the bsddev after the
mlx5en module has been unloaded.

Sponsored by: Mellanox Technologies

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

7 years agoMFC r302835: fix-up for configuration of AMD Family 10h processors
avg [Mon, 15 Aug 2016 09:04:31 +0000 (09:04 +0000)]
MFC r302835: fix-up for configuration of AMD Family 10h processors
borrowed from Linux

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

7 years agoMFC r302840: 6878 Add scrub completion info to "zpool history"
avg [Mon, 15 Aug 2016 09:02:09 +0000 (09:02 +0000)]
MFC r302840: 6878 Add scrub completion info to "zpool history"

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

7 years agoMFC r303765:
hselasky [Mon, 15 Aug 2016 09:00:46 +0000 (09:00 +0000)]
MFC r303765:
Keep a reference count on USB keyboard polling to allow recursive
cngrab() during a panic for example, similar to what the AT-keyboard
driver is doing.

Found by: Bruce Evans <brde@optusnet.com.au>

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

7 years agoMFC r302839: 6940 Cannot unlink directories when over quota
avg [Mon, 15 Aug 2016 08:53:30 +0000 (08:53 +0000)]
MFC r302839: 6940 Cannot unlink directories when over quota

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

7 years agoMFC r303086: 7164 zdb should be able to open the root dataset
avg [Mon, 15 Aug 2016 08:49:07 +0000 (08:49 +0000)]
MFC r303086: 7164 zdb should be able to open the root dataset

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

7 years agoMFC r303084: 6391 Override default SPA config location via environment
avg [Mon, 15 Aug 2016 08:44:48 +0000 (08:44 +0000)]
MFC r303084: 6391 Override default SPA config location via environment

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

7 years agoMFC r303059
markj [Sun, 14 Aug 2016 19:02:57 +0000 (19:02 +0000)]
MFC r303059
Release the second critical section in uma_zfree_arg() slightly earlier.

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

7 years agoMFC r303516
markj [Sun, 14 Aug 2016 19:01:15 +0000 (19:01 +0000)]
MFC r303516
Use vm_page_undirty() instead of manually setting a page field.

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

7 years agoMFC r303244, r303399
markj [Sun, 14 Aug 2016 18:59:22 +0000 (18:59 +0000)]
MFC r303244, r303399
De-pluralize "queues" in the pagedaemon code.

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

7 years agoMFC r303971:
smh [Sun, 14 Aug 2016 15:27:59 +0000 (15:27 +0000)]
MFC r303971:

Fix vtnet hang with max_virtqueue_pairs > VTNET_MAX_QUEUE_PAIRS

Sponsored by: Multiplay

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

7 years agoMFC r303806:
cy [Sat, 13 Aug 2016 01:33:53 +0000 (01:33 +0000)]
MFC r303806:

Add Logitech Unifying receiver.

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

7 years agoDocument EN-16:10 through EN-16:16.
gjb [Fri, 12 Aug 2016 22:00:13 +0000 (22:00 +0000)]
Document EN-16:10 through EN-16:16.

Sponsored by: The FreeBSD Foundation

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

7 years agoMFC 292894,292896: Add ptrace(2) reporting for LWP events.
jhb [Fri, 12 Aug 2016 19:43:06 +0000 (19:43 +0000)]
MFC 292894,292896: Add ptrace(2) reporting for LWP events.

292894:
Add ptrace(2) reporting for LWP events.

Add two new LWPINFO flags: PL_FLAG_BORN and PL_FLAG_EXITED for reporting
thread creation and destruction. Newly created threads will stop to report
PL_FLAG_BORN before returning to userland and exiting threads will stop to
report PL_FLAG_EXIT before exiting completely. Both of these events are
only enabled and reported if PT_LWP_EVENTS is enabled on a process.

292896:
Document the recently added support for ptrace(2) LWP events.

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

7 years agoMFC r303897:
gjb [Fri, 12 Aug 2016 19:06:29 +0000 (19:06 +0000)]
MFC r303897:
  Pass overrides to make(1) when building ports for arm/armv6
  targets, similar to what is done for the run-autotools-fixup
  override for non-arm targets.

Sponsored by: The FreeBSD Foundation

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

7 years agoMFC r302371:
hselasky [Fri, 12 Aug 2016 08:05:40 +0000 (08:05 +0000)]
MFC r302371:
Fix regression issue with XHCI on 32-bit ARMv7 Armada-38x. Make sure
"struct xhci_dev_ctx_addr" fits into a single 4K page until further.

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

7 years agoMFC r301039:
hselasky [Fri, 12 Aug 2016 07:57:27 +0000 (07:57 +0000)]
MFC r301039:
Add support for simplex USB MIDI devices, which only provide BULK or
INTERRUPT endpoints for moving data in one direction, like the KeyRig
49 from M-Audio.

Requested by: Ivan Klymenko <fidaj@ukr.net>

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

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

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

7 years agoMFC 273102:
jhb [Wed, 10 Aug 2016 16:31:15 +0000 (16:31 +0000)]
MFC 273102:
Use '-e' to check if the virtio backing file has already been created.

The '-f' check works fine on a regular file but not if the backing file is
a device (e.g., /dev/md0). In this case it would print a misleading but
otherwise benign message about the backing file not being present.

PR: 210410

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

7 years agoMFC r303782:
gjb [Wed, 10 Aug 2016 14:00:07 +0000 (14:00 +0000)]
MFC r303782:
  Fix GCE image publication.  The gcutil utility is deprecated in favor
  of gcloud.

Sponsored by: The FreeBSD Foundation

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

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

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

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

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

MFC r303705:
Remove Giant asserts.  Update comment.

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

7 years agoMFC 303503: Don't treat NOCPU as a valid CPU to CPU_ISSET.
jhb [Tue, 9 Aug 2016 18:59:16 +0000 (18:59 +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.

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

7 years agoMFC r270132 (by gabor):
dim [Tue, 9 Aug 2016 18:49:19 +0000 (18:49 +0000)]
MFC r270132 (by gabor):

- Do not look for more matching lines if -L is specified

Submitted by:   eadler (based on)

MFC r296799 (by ian):

Fix a bug in bsdgrep that caused the program to hang in a tight loop for
some combinations of command line options and search patterns.  The code was
examining regexec flags looking for a regcomp flag value.  The fix is to
look in the struct field where the decoded regcomp flag was stored when the
regex was compiled.

With this fix, it's possible to build WITHOUT_GNU_GREP_COMPAT and
WITH_BSDGREP and have a usable GPL-free grep (which of course lacks gnugrep
extensions).  It now passes the kyua tests except for one test that requires
the -z/--null-data gnu extension, and one test involving outputting context
lines across multiple files which appears to sometimes output an extra
delimiter line ("--") between matches (a rather obscure failure of a rather
obscure feature, so bsdgrep should be generally usable now).

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.

Reported by: Steve Kargl

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

7 years agoMFC r303760:
loos [Tue, 9 Aug 2016 03:47:38 +0000 (03:47 +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)

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

7 years agoDocument missing ENs and SAs.
gjb [Mon, 8 Aug 2016 23:18:27 +0000 (23:18 +0000)]
Document missing ENs and SAs.

Reviewed by: brd
Sponsored by: The FreeBSD Foundation

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

7 years agoIncrease the IMX (CUBOX-HUMMINGBOARD, WANDBOARD) image size to
gjb [Mon, 8 Aug 2016 20:29:32 +0000 (20:29 +0000)]
Increase the IMX (CUBOX-HUMMINGBOARD, WANDBOARD) image size to
successfully build.

While here, add the SRCBRANCH to the CUBOX-HUMMINGBOARD.conf and
GUMSTIX.conf.

This is a direct commit to stable/10, as the images for stable/11
are already larger than this.

Sponsored by: The FreeBSD Foundation

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

7 years agoMFC r290521:
kp [Mon, 8 Aug 2016 19:44:13 +0000 (19:44 +0000)]
MFC r290521:

pf: Fix broken rule skip calculation

r289932 accidentally broke the rule skip calculation. The address family
argument to PF_ANEQ() is now important, and because it was set to 0 the macro
always evaluated to false.
This resulted in incorrect skip values, which in turn broke the rule
evaluations.

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

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

  cred: add proc_set_cred_init helper

PR: D7431

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

7 years agoMFC r280330,r282567:
bdrewery [Mon, 8 Aug 2016 18:10:59 +0000 (18:10 +0000)]
MFC r280330,r282567:

  r280330:
    fork: assign refed credentials earlier
  r282567:
    Fix up panics when fork fails due to hitting proc limit

PR: D7431

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

7 years agoMFC 303737
sephe [Mon, 8 Aug 2016 06:33:59 +0000 (06:33 +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

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

7 years agoMFC 303076,303225: Use MTX_SYSINIT for the VESA lock.
jhb [Sat, 6 Aug 2016 23:53:33 +0000 (23:53 +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

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

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

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

7 years agoMFC 302181,302635: Disable MSI-X migration on older Xen hypervisors.
jhb [Fri, 5 Aug 2016 17:13:25 +0000 (17:13 +0000)]
MFC 302181,302635: Disable MSI-X migration on older Xen hypervisors.

302181:
Add a tunable to disable migration of MSI-X interrupts.

The new 'machdep.disable_msix_migration' tunable can be set to 1 to
disable migration of MSI-X interrupts.

Xen versions prior to 4.6.0 do not properly handle updates to MSI-X
table entries after the initial write.  In particular, the operation
to unmask a table entry after updating it during migration is not
propagated to the "real" table for passthrough devices causing the
interrupt to remain masked.  At least some systems in EC2 are
affected by this bug when using SRIOV.  The tunable can be set in
loader.conf as a workaround.

302635:
xen: automatically disable MSI-X interrupt migration

If the hypervisor version is smaller than 4.6.0. Xen commits 74fd00 and
70a3cb are required on the hypervisor side for this to be fixed, and those
are only included in 4.6.0, so stay on the safe side and disable MSI-X
interrupt migration on anything older than 4.6.0.

It should not cause major performance degradation unless a lot of MSI-X
interrupts are allocated.

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

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

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

7 years agoMFC r302330:
ngie [Wed, 3 Aug 2016 01:25:44 +0000 (01:25 +0000)]
MFC r302330:

Remove ftp(1) related files when MK_FTP == no

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

7 years agoMFstable/11 r303691:
ngie [Wed, 3 Aug 2016 01:19:10 +0000 (01:19 +0000)]
MFstable/11 r303691:

MFC r302550,r302551,r302552,r302553:

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

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

7 years agoMFC r288306
mr [Tue, 2 Aug 2016 22:33:29 +0000 (22:33 +0000)]
MFC r288306
Add support to systat to display zfs arc cache status/info

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

7 years agoMFC r301710:
markj [Tue, 2 Aug 2016 21:17:34 +0000 (21:17 +0000)]
MFC r301710:
Fix an infinite loop in setnetgrent(3) with NIS netgroups.

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

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

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

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

7 years agoMFC r303338: vt: lock Giant around kbd calls in CONS_GETINFO
emaste [Mon, 1 Aug 2016 19:53:18 +0000 (19:53 +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

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

7 years agoMFC r303400: libcxxrt: fix demangling of wchar_t
emaste [Mon, 1 Aug 2016 16:16:48 +0000 (16:16 +0000)]
MFC r303400: libcxxrt: fix demangling of wchar_t

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

PR: 208661

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

7 years agoMFC r288071:
ngie [Mon, 1 Aug 2016 06:59:35 +0000 (06:59 +0000)]
MFC r288071:

- arm64 change was omitted due to lack of architecture support
- ia64 change was added as the architecture was removed from ^/head

Sponsored by: EMC / Isilon Storage Division

r288071 (by emaste):

Move kbd.c to main sys/conf/files list

It is (optionally) used on all architectures.

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

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

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

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

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

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

7 years agoDirect commit of adapted r303581.
ache [Sun, 31 Jul 2016 10:37:09 +0000 (10:37 +0000)]
Direct commit of adapted r303581.
Fix date.

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

7 years agoMFC r303211:
kib [Sat, 30 Jul 2016 14:47:04 +0000 (14:47 +0000)]
MFC r303211:
Implement mtx_trylock_spin(9).

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

7 years agoMFC r299829
sbruno [Thu, 28 Jul 2016 20:11:34 +0000 (20:11 +0000)]
MFC r299829
Use Node Information flag names instead of hard-coding their values.

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

7 years agoMFC r296063 r297397 r299213
sbruno [Thu, 28 Jul 2016 20:08:01 +0000 (20:08 +0000)]
MFC r296063 r297397 r299213

296063:
Lock the NDP default router list and count defrouter references.

This addresses a number of race conditions that can cause crashes as a
result of unsynchronized access to the list.

297397
Modify nd6_llinfo_timer() to acquire the nd6 lock before the LLE lock.

When expiring a neighbour cache entry we may need to look up the associated
default router, which requires the nd6 read lock. To avoid an LOR, the nd6
lock should be acquired first.

299213
Clean up callers of nd6_prelist_add().

nd6_prelist_add() sets *newp if and only if it is successful, so there's no
need for code that handles the case where the return value is 0 and
*newp == NULL. Fix some style bugs in nd6_prelist_add() while here.

Submitted by: Jason Wolfe <j@nitrology.com>

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

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

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

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

7 years agoMFC r303160.
cy [Wed, 27 Jul 2016 19:40:25 +0000 (19:40 +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

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

7 years agoMFC 303109: Update crashinfo to work with newer gdb from ports.
jhb [Wed, 27 Jul 2016 17:55:40 +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

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

7 years agoMFH: r303287
julian [Wed, 27 Jul 2016 16:27:41 +0000 (16:27 +0000)]
MFH: r303287

Split MAKE_SYSENT into two parts so that the initializer part can be
used separately if one wants to embed the sysent into a larger structure.

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

7 years agoMFC r286873:
jch [Wed, 27 Jul 2016 13:53:15 +0000 (13:53 +0000)]
MFC r286873:

Make clear that TIME_WAIT timeout expiration is managed solely by
tcp_tw_2msl_scan().

Sponsored by: Verisign, Inc.

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

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

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

7 years agoMFC r271119, r272081:
jch [Wed, 27 Jul 2016 07:51:58 +0000 (07:51 +0000)]
MFC r271119, r272081:

r271119:

In tcp_input(), don't acquire the pcbinfo global write lock for SYN
packets targeting a listening socket.  Permit to reduce TCP input
processing starvation in context of high SYN load (e.g. short-lived TCP
connections or SYN flood).

Submitted by: Julien Charbon <jcharbon@verisign.com>
Reviewed by: adrian, hiren, jhb, Mike Bentkofsky

r272081:

Catch up with r271119.

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

7 years agoMFC r273014:
jch [Wed, 27 Jul 2016 06:31:40 +0000 (06:31 +0000)]
MFC r273014:

A connection in TIME_WAIT state before calling close() actually did not
received any RST packet.  Do not set error to ECONNRESET in this case.

Differential Revision: https://reviews.freebsd.org/D879
Reviewed by: rpaulo, adrian
Approved by: jhb (mentor)
Sponsored by: Verisign, Inc.

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

7 years agoMFC 302899: Add documentation for the sigevent structure.
jhb [Mon, 25 Jul 2016 23:38:14 +0000 (23:38 +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.

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

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

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

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

7 years agoMFC r302911:
pfg [Mon, 25 Jul 2016 15:04:15 +0000 (15:04 +0000)]
MFC r302911:
mail(1): Avoid closing negative file descriptors.

CID: 10081051008106

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

7 years agoFix bspatch heap overflow vulnerability.
delphij [Mon, 25 Jul 2016 14:53:04 +0000 (14:53 +0000)]
Fix bspatch heap overflow vulnerability.

Obtained from: Chromium
Reported by: Lu Tung-Pin
Security: FreeBSD-SA-16:25.bspatch

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

7 years agoMFC r297871: boot1.efifat: provide a fallback startup.nsh
emaste [Mon, 25 Jul 2016 14:36:55 +0000 (14:36 +0000)]
MFC r297871: boot1.efifat: provide a fallback startup.nsh

In case the firmware falls through to executing startup.sh, populate it
with the name of our boot loader. In normal operation this should not be
necessary but may allow the system to boot if it would otherwise just
remain at a shell prompt.

Sponsored by: The FreeBSD Foundation

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

7 years agoMFC r301974: ar: enable reproducible output by default when invoked as 'ar -s'
emaste [Mon, 25 Jul 2016 14:35:14 +0000 (14:35 +0000)]
MFC r301974: ar: enable reproducible output by default when invoked as 'ar -s'

ar output is already deterministic by default for ar -q and ar -r, and
when invoked as ranlib. Make ar -s equivalent to ranlib and enable
deterministic output by default in that case too.

PR: 210330
Sponsored by: The FreeBSD Foundation

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

7 years agoMFC r302335: boot1.efi: fix assignment / comparison expression
emaste [Mon, 25 Jul 2016 14:28:50 +0000 (14:28 +0000)]
MFC r302335: boot1.efi: fix assignment / comparison expression

PR: 210706
Submitted by: David Binderman <dcb314@hotmail.com>

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

7 years agoMFC r302278: libcxxrt: correct mangled "typeinfo name" symbols in Version.map
emaste [Mon, 25 Jul 2016 14:26:33 +0000 (14:26 +0000)]
MFC r302278:   libcxxrt: correct mangled "typeinfo name" symbols in Version.map

r261644 (MFC of r260553) added missing C++ typinfos to libcxxrt's
version script. It appears that a number of duplicate mangled symbols
were added due to a cut and paste error. Switch the second instances to
_ZTS*, typeinfo name for *.

Found by lld, which produces an error or warning for duplicate symbols.

Sponsored by: The FreeBSD Foundation

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

7 years agoMFC r302567:
kib [Mon, 25 Jul 2016 13:31:18 +0000 (13:31 +0000)]
MFC r302567:
In vgonel(), postpone setting BO_DEAD until VOP_RECLAIM() is called,
if vnode is VMIO.  For VMIO vnodes, set BO_DEAD in vm_object_terminate().

MFC r302580:
Fix grammar.

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

7 years agoMFC r302542:
delphij [Mon, 25 Jul 2016 00:46:01 +0000 (00:46 +0000)]
MFC r302542:

Use _PATH_DEVNULL instead of hardcoding.

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

7 years agoMFC r303032
sbruno [Sun, 24 Jul 2016 16:33:48 +0000 (16:33 +0000)]
MFC r303032
Fixup DA cable detection routines to not set the cable type to
unknown if they do not match one of two cable types.

PR: 150249

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

7 years agoDo not try to delete the home of the user if is is not a directory for example
bapt [Sun, 24 Jul 2016 08:21:21 +0000 (08:21 +0000)]
Do not try to delete the home of the user if is is not a directory for example
"/dev/null"

PR: 211195
Submitted by: rday <ryan@ryanday.net>
Reported by: eniorm <eniorm@gmail.com>

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

7 years agoMFC 302175:
jhb [Sun, 24 Jul 2016 05:24:10 +0000 (05:24 +0000)]
MFC 302175:
Add pci_get_max_payload() to fetch the PCI-express maximum payload size.

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

7 years agoMFC 300253: Remove dangling references to rman_await_resource().
jhb [Sun, 24 Jul 2016 04:38:50 +0000 (04:38 +0000)]
MFC 300253: Remove dangling references to rman_await_resource().

This function was removed when RF_TIMESHARE was removed a couple of years
ago.

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

7 years agoMFC 299977: Use polling spin loops for timeouts during early boot.
jhb [Sat, 23 Jul 2016 22:50:59 +0000 (22:50 +0000)]
MFC 299977: Use polling spin loops for timeouts during early boot.

Some ACPI operations such as mutex acquires and event waits accept a
timeout.  The ACPI OSD layer implements these timeouts by using regular
sleep timeouts.  However, this doesn't work during early boot before
event timers are setup.  Instead, use polling combined with DELAY()
to spin.

This fixes booting on upcoming Intel systems with Kaby Lake processors.

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

7 years agoMFC r303101
alc [Sat, 23 Jul 2016 21:15:40 +0000 (21:15 +0000)]
MFC r303101
  Add a comment describing the 'fast path' that was introduced in r270011.

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

7 years agoMFC 298370,298372,298377,298379,298380,298484:
jhb [Sat, 23 Jul 2016 17:41:47 +0000 (17:41 +0000)]
MFC 298370,298372,298377,298379,298380,298484:
Abstract out _OSC handling and invoke it for PCI bridges.

r298370:
Add a wrapper for evaluating _OSC methods.

This wrapper does not translate errors in the first word to ACPI
error status returns.  Use this wrapper in the acpi_cpu(4) driver in
place of the existing _OSC code.  While here, fix a bug where the wrong
count of words was passed when invoking _OSC.

r298372:
Invoke _OSC on Host-PCI bridges.

Tell the firmware that we support PCI-express config space access
and MSI.

r298377:
Remove query flag from acpi_EvaluateOSC().  This function does not support
return buffer (yet).

r298379:
There is no need to use array any more.  No functional change.

r298380:
Prefer sizeof(*pointer) over sizeof(type).  No funtional change.

r298484:
Optionally return the output capabilities list from _OSC.

Both of the callers were expecting the input cap_set to be modified.
This fixes them to request cap_set to be updated with the returned buffer.

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

7 years agoMFC r302936:
kib [Sat, 23 Jul 2016 08:02:45 +0000 (08:02 +0000)]
MFC r302936:
Explicitely check for the valid range of file descriptor values.

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

7 years agoMFC: r302827
ache [Fri, 22 Jul 2016 19:36:11 +0000 (19:36 +0000)]
MFC: r302827

Optimize [Cc]flag case: don't repeatedly add the last character of
string2 to squeeze cset when string2 reach its EOS state.

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

7 years agoMFC: r302826
ache [Fri, 22 Jul 2016 19:34:43 +0000 (19:34 +0000)]
MFC: r302826

Document incomplete support of [=equiv=] and collation for ranges.

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

7 years agoMFC r302919:
kib [Fri, 22 Jul 2016 17:36:40 +0000 (17:36 +0000)]
MFC r302919:
In ptrace_vm_entry(), do not call vmspace_free() while owning a vm
object lock.

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

7 years agoMFC r302893:
kib [Fri, 22 Jul 2016 17:25:28 +0000 (17:25 +0000)]
MFC r302893:
Do not allow creation of char or block special nodes with VNOVAL dev_t.

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

7 years agoForget to merge this changes in prev. MFC
ache [Fri, 22 Jul 2016 16:48:39 +0000 (16:48 +0000)]
Forget to merge this changes in prev. MFC

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