]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoFix a bug in deferred stream reset processing which results
tuexen [Wed, 20 Jul 2016 06:29:26 +0000 (06:29 +0000)]
Fix a bug in deferred stream reset processing which results
in using a length field before it is set.

Thanks to Taylor Brandstetter for reporting the issue and
providing a fix.

MFC after: 3 days

8 years agohyperv/vmbus: Save MNF trigger location instead of MNF trigger index.
sephe [Wed, 20 Jul 2016 06:12:32 +0000 (06:12 +0000)]
hyperv/vmbus: Save MNF trigger location instead of MNF trigger index.

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

8 years agohyperv/vmbus: Hide channel struct definition.
sephe [Wed, 20 Jul 2016 06:00:27 +0000 (06:00 +0000)]
hyperv/vmbus: Hide channel struct definition.

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

8 years agohyperv/vmbus: Deprecate the device private data in channel struct
sephe [Wed, 20 Jul 2016 05:48:52 +0000 (05:48 +0000)]
hyperv/vmbus: Deprecate the device private data in channel struct

They are neither flexible nor extensible.

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

8 years agohyperv/vmbus: Pass channel as the first argument for channel callback
sephe [Wed, 20 Jul 2016 05:34:28 +0000 (05:34 +0000)]
hyperv/vmbus: Pass channel as the first argument for channel callback

The prepares to kill device private fields in channel struct, which
are not flexible and extensible.

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

8 years agohyperv/vmbus: Channel struct field rename
sephe [Wed, 20 Jul 2016 05:26:04 +0000 (05:26 +0000)]
hyperv/vmbus: Channel struct field rename

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

8 years agohyperv/vmbus: Move IC register definition to Hyper-V utilities
sephe [Wed, 20 Jul 2016 05:16:23 +0000 (05:16 +0000)]
hyperv/vmbus: Move IC register definition to Hyper-V utilities

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

8 years agohyperv/vmbus: Get rid of unnecessary definition.
sephe [Wed, 20 Jul 2016 05:03:04 +0000 (05:03 +0000)]
hyperv/vmbus: Get rid of unnecessary definition.

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

8 years agoAdd myself (stevek) as a src committer and mentor (sjg) to committers-src.dot
stevek [Wed, 20 Jul 2016 04:25:09 +0000 (04:25 +0000)]
Add myself (stevek) as a src committer and mentor (sjg) to committers-src.dot

Approved by: sjg (mentor)

8 years agoMFV r298167, r300962, r303048:
pfg [Wed, 20 Jul 2016 03:52:04 +0000 (03:52 +0000)]
MFV r298167, r300962, r303048:
openresolv: update to version 3.8.1.

Among the new features it attempts to support alternative init systems.

MFC after: 1 month

8 years agolibunwind: Properly align _Unwind_Exception.
emaste [Wed, 20 Jul 2016 03:13:02 +0000 (03:13 +0000)]
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.

Obtained from: LLVM review D22543

8 years agoRelease the second critical section in uma_zfree_arg() slightly earlier.
markj [Wed, 20 Jul 2016 01:01:50 +0000 (01:01 +0000)]
Release the second critical section in uma_zfree_arg() slightly earlier.

It is only needed when removing a full bucket from the per-CPU cache. The
bucket cache (uz_buckets) is protected by the zone mutex and thus the
critical section can be released before inserting into that list.

MFC after: 1 week

8 years agoMake vm_pageout_wakeup_thresh a u_int rather than an int.
markj [Wed, 20 Jul 2016 00:09:22 +0000 (00:09 +0000)]
Make vm_pageout_wakeup_thresh a u_int rather than an int.

It's a threshold for v_free_count, which is of type u_int. This also lets
us get rid of a cast in vm_paging_needed().

Reviewed by: alc
MFC after: 1 week

8 years agoOnly build makewhatis(1)/apropos(1) with MAN_UTILS.
bdrewery [Wed, 20 Jul 2016 00:06:03 +0000 (00:06 +0000)]
Only build makewhatis(1)/apropos(1) with MAN_UTILS.

This is what src.conf(5) documents and is what the older non-mandoc
versions respected.

Sponsored by: EMC / Isilon Storage Division

8 years agoMerge {amd64,i386}/instr_size.c into x86_instr_size.c.
markj [Wed, 20 Jul 2016 00:02:10 +0000 (00:02 +0000)]
Merge {amd64,i386}/instr_size.c into x86_instr_size.c.

Also reduce the diff between us and upstream: the input data model will
always be DATAMODEL_NATIVE because of a bug (p_model is never set but is
always initialized to 0), so we don't need to override the caller anyway.
This change is also necessary to support the pid provider for 32-bit
processes on amd64.

MFC after: 2 weeks

8 years agosed(1): Assorted cleanups and simplifications.
pfg [Tue, 19 Jul 2016 22:56:40 +0000 (22:56 +0000)]
sed(1): Assorted cleanups and simplifications.

Const-ify several variables, make it build cleanly with WARNS level 5.

Submitted by: mi
PR: 195929
MFC after: 1 month

8 years agolibc: tag the Rune initialization function prototypes visibility as hidden.
pfg [Tue, 19 Jul 2016 20:22:13 +0000 (20:22 +0000)]
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
MFC after: 1 week

8 years agoarch.7: correct MIPS endianness transcription error
emaste [Tue, 19 Jul 2016 20:11:50 +0000 (20:11 +0000)]
arch.7: correct MIPS endianness transcription error

Submitted by: Nikolai Lifanov <lifanov@mail.lifanov.com>

8 years agoarch.7: we also use 1M page mappings on armv6
emaste [Tue, 19 Jul 2016 19:50:30 +0000 (19:50 +0000)]
arch.7: we also use 1M page mappings on armv6

Submitted by: alc

8 years agoIncrease vt(4) framebuffer maximum size
cem [Tue, 19 Jul 2016 19:20:47 +0000 (19:20 +0000)]
Increase vt(4) framebuffer maximum size

And rename "DEFAULT" constants to the more accurate "MAX."

PR: 210382
Submitted by: Felix <felixphew0 at gmail.com>
Reviewed by: wblock, cem
Tested by: Dave Cottlehuber <dch at skunkwerks.at>

8 years agoRemove unused variable from last commit.
scottl [Tue, 19 Jul 2016 19:19:03 +0000 (19:19 +0000)]
Remove unused variable from last commit.

8 years agoerwin stepped down from portmgr, update the graph.
rene [Tue, 19 Jul 2016 19:13:01 +0000 (19:13 +0000)]
erwin stepped down from portmgr, update the graph.

8 years agoSupporting flushing the dump before returning, and simplify/combine the
scottl [Tue, 19 Jul 2016 19:09:23 +0000 (19:09 +0000)]
Supporting flushing the dump before returning, and simplify/combine the
logic.  Switch to a 5us delay since most NVME devices can easily do 200,000
iops.

Submitted by: imp
MFC after: 3 days
Sponsored by: Netflix, Inc.

8 years agoDo not use TERM_EMU on arm and arm64 as it doesn't behave well with serial console.
manu [Tue, 19 Jul 2016 19:00:22 +0000 (19:00 +0000)]
Do not use TERM_EMU on arm and arm64 as it doesn't behave well with serial console.

Reviewed by: andrew, emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D6783

8 years agomakefs: sync NetBSD IDs with upstream for changes that we already have
emaste [Tue, 19 Jul 2016 18:40:54 +0000 (18:40 +0000)]
makefs: sync NetBSD IDs with upstream for changes that we already have

May 22 21:51:39 2011 +0000 (christos):

    From Nathan Whitehorn (nwhitehorn at freebsd dot org):
    Add code to generate bootable ISOs on Powermac and CHRP systems.
    Synthesize some partition maps (APM and MBR, respectively) pointing
    to (a) the whole disk, and (b) relevant El Torito boot images that
    have been added by other code. These partition maps are a little
    bit funny looking, but they seem to work. FreeBSD has been using
    this successfully in their release generation on powerpc, as well
    as generating all non-SPARC install media. SPARC support could
    probably be added as an extension of this patch.

makefs.8 1.33

Tue Aug 23 17:09:11 2011 +0000 (christos):

    PR/45285: Martin Matuska: makefs does not properly convert ISO level 1 and 2
    filenames (buffer overflow)

    makefs does not properly verify the maximum filename length in the
    special "." case for both ISO level 1 and ISO level 2 filename
    conversion.  This creates broken images or causes a buffer overflow
    (ISO level 2).

    ISO level 1:
    If a filename contains only dots or up to 8 characters followed by
    dots the 8+3 limit check doesn't work.

    ISO level 2:
    If a filename contains a dot in the first 30 characters and a dot
    on the 30th character, the length limit check doesn't work and the
    buffer is overflowed.

    $ mkdir level1
    $ touch level1/12345............
    $ makefs -t cd9660 -o isolevel=1 test.iso level1

    $ mkdir level2
    $ touch level2/1234567890.2345678901234567.....34567890123456789012345
    $ makefs -t cd9660 -o isolevel=2 test.iso level2

cd9660.c 1.32

Sun Oct 9 21:33:43 2011 +0000 (christos):

    add support for setting the ufs label. (Nathan Whitehorn)

ffs.c 1.45
ffs.h 1.2
mkfs.c 1.22
makefs.8 1.37

Obtained from: NetBSD

8 years agoThis reverts out Gleb's changes and adds three small
rrs [Tue, 19 Jul 2016 18:31:19 +0000 (18:31 +0000)]
This reverts out Gleb's changes and adds three small
fixes that I think closes up the races Gleb was
looking for. This is running quite nicely in Netflix and
now no longer causes TCP-tcb leaks.

Differential Revision: 7135

8 years agomakefs: reorder 'usage' alphabetically
emaste [Tue, 19 Jul 2016 18:15:22 +0000 (18:15 +0000)]
makefs: reorder 'usage' alphabetically

From NetBSD, Mon Aug 15 14:45:01 2011 +0000 (wiz)

    Re-order `usage' alphabetically;
    rename option arguments in the manpage's `SYNOPSIS' section to
    match those from `usage' (not the other way around; the `usage'-line
    (and other parts of makefs.c) contain the correct names);
    minor punctuation improvements.

    From Snader_LB.

makefs.8 1.36
makefs.c 1.30

Obtained from: NetBSD

8 years agoRandom bit generator (RBG) driver for RPi and RPi2.
markm [Tue, 19 Jul 2016 18:07:47 +0000 (18:07 +0000)]
Random bit generator (RBG) driver for RPi and RPi2.

Summary:
This driver supports the following methods to trigger gathering random bits from the hardware:
1. interrupt when the FIFO is full (default) fed into the harvest queue
2. callout (when BCM2835_RNG_USE_CALLOUT is defined) every second if hz is less than 100, otherwise hz / 100, feeding the random bits into the harvest queue

If the kernel is booted with verbose enabled, the contents of the registers will be dumped after the RBG is started during the attach routine.

Author: hackagadget_gmail.com (Stephen J. Kiernan)

Test Plan: Built RPI2 kernel and booted on board. Tested the different methods to feed the harvest queue (callout, interrupt) and the interrupt driven approach seems best. However, keeping the other method for people to be able to experiment with.

Reviewed By: adrian, delphij, markm

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

8 years agoInclude makewhatis in ITOOLS when MK_MAN_UTILS is true
emaste [Tue, 19 Jul 2016 18:05:25 +0000 (18:05 +0000)]
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
MFC after: 1 week

8 years agoadd an arch.7 man page with architecture-specific details
emaste [Tue, 19 Jul 2016 17:46:09 +0000 (17:46 +0000)]
add an arch.7 man page with architecture-specific details

Based on details collected on the wiki, at
https://wiki.freebsd.org/EdMaste/ArchitectureSpecifics
Further details to be added over time.

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7096

8 years agoFixup DA cable detection routines to not set the cable type to
sbruno [Tue, 19 Jul 2016 17:31:48 +0000 (17:31 +0000)]
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
Submitted by: borjam@sarenet.es
Reviewed by: erj
MFC after: 3 days

8 years agoclang++: Always use --eh-frame-hdr on FreeBSD, even for -static
emaste [Tue, 19 Jul 2016 17:15:07 +0000 (17:15 +0000)]
clang++: Always use --eh-frame-hdr on FreeBSD, even for -static

FreeBSD uses LLVM's libunwind on FreeBSD/arm64 today (and we expect to
use it more widely in the future) and it requires the EH frame segment
in static binaries.

Reviewed by: dim
Obtained from: Clang commit r266123
MFC after: 3 days
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7250

8 years agoFix the previous commit to the family tree file. It is too early
gjb [Tue, 19 Jul 2016 16:55:16 +0000 (16:55 +0000)]
Fix the previous commit to the family tree file.  It is too early
to list 11.0, and we do not list -CURRENT here.

Submitted by: maxim
Sponsored by: The FreeBSD Foundation

8 years agoBelatedly add FreeBSD 11.0 and 12.0 to the family tree file.
gjb [Tue, 19 Jul 2016 16:34:49 +0000 (16:34 +0000)]
Belatedly add FreeBSD 11.0 and 12.0 to the family tree file.

Submitted by: des (a while back)
Sponsored by: The FreeBSD Foundation

8 years agoAdd missing flags from acpidump. These are defined in the header, but not
andrew [Tue, 19 Jul 2016 16:02:07 +0000 (16:02 +0000)]
Add missing flags from acpidump. These are defined in the header, but not
printed. The HW_REDUCED flag is useful as it should be set on arm64 to
comply with the ARM Server Base Boot Requirements.

Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoUse correct order of conditions to avoid NULL deref.
tuexen [Tue, 19 Jul 2016 11:16:44 +0000 (11:16 +0000)]
Use correct order of conditions to avoid NULL deref.

MFC after: 3 days
X-MFC with: r302935

8 years agonetstat and sockstat expect the IPv6 link local addresses to
tuexen [Tue, 19 Jul 2016 09:48:08 +0000 (09:48 +0000)]
netstat and sockstat expect the IPv6 link local addresses to
have an embedded scope. So don't recover.

MFC after: 3 days

8 years agohyperv/vmbus: Rename laundered vmbus channel code
sephe [Tue, 19 Jul 2016 07:51:22 +0000 (07:51 +0000)]
hyperv/vmbus: Rename laundered vmbus channel code

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

8 years agohyperv/vmbus: Temp/internal variable/function rename
sephe [Tue, 19 Jul 2016 06:04:44 +0000 (06:04 +0000)]
hyperv/vmbus: Temp/internal variable/function rename

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

8 years agohyperv/vmbus: Function rename
sephe [Tue, 19 Jul 2016 05:57:19 +0000 (05:57 +0000)]
hyperv/vmbus: Function rename

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

8 years agohyperv/vmbus: Cleanup cpu based channel selection.
sephe [Tue, 19 Jul 2016 05:46:15 +0000 (05:46 +0000)]
hyperv/vmbus: Cleanup cpu based channel selection.

And create cpu to channel map at device attach time for storvsc(4).

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

8 years agoUse g_resize_provider() to change the size of GEOM_DISK provider,
ae [Tue, 19 Jul 2016 05:36:21 +0000 (05:36 +0000)]
Use g_resize_provider() to change the size of GEOM_DISK provider,
when it is being opened. This should fix the possible loss of a resize
event when disk capacity changed.

PR: 211028
Reported by: Dexuan Cui <decui at microsoft dot com>
MFC after: 3 weeks

8 years agoAdd named dynamic states support to ipfw(4).
ae [Tue, 19 Jul 2016 04:56:59 +0000 (04:56 +0000)]
Add named dynamic states support to ipfw(4).

The keep-state, limit and check-state now will have additional argument
flowname. This flowname will be assigned to dynamic rule by keep-state
or limit opcode. And then can be matched by check-state opcode or
O_PROBE_STATE internal opcode. To reduce possible breakage and to maximize
compatibility with old rulesets default flowname introduced.
It will be assigned to the rules when user has omitted state name in
keep-state and check-state opcodes. Also if name is ambiguous (can be
evaluated as rule opcode) it will be replaced to default.

Reviewed by: julian
Obtained from: Yandex LLC
MFC after: 1 month
Relnotes: yes
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D6674

8 years agoImplement crashdump support on NVME
scottl [Tue, 19 Jul 2016 03:13:51 +0000 (03:13 +0000)]
Implement crashdump support on NVME

MFC after: 3 days
Sponsored by: Netflix, Inc.

8 years agollvm-libunwind: use conventional (non-Darwin) X86 register numbers
emaste [Tue, 19 Jul 2016 00:47:00 +0000 (00:47 +0000)]
llvm-libunwind: use conventional (non-Darwin) X86 register numbers

For historical reasons Darwin/i386 has ebp and esp swapped in the
eh_frame register numbering.  That is:

             Darwin      Other
    Reg #    eh_frame    eh_frame    DWARF
    =====    ========    ========    =====
      4        ebp         esp        esp
      5        esp         ebp        ebp

Although the UNW_X86_* constants are not supposed to be coupled to
DWARF / eh_frame numbering they are currently conflated in LLVM
libunwind, and thus we require the non-Darwin numbering.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years ago[ath] don't do LDPC, STBC or short-gi for locationing frames.
adrian [Tue, 19 Jul 2016 00:27:17 +0000 (00:27 +0000)]
[ath] don't do LDPC, STBC or short-gi for locationing frames.

The 11n duration calculation function in net80211 and the HAL round /up/
the duration calculation for short-gi, so we can't use that.

The 11n duration calculation doesn't know about the extra symbol time
needed for STBC, nor the LDPC encoding duration, so we can't use
that.

This (along with other, local hacks) allow the locationing services to
get down to around 200nS (yes, nanoseconds) of variance when speaking
to a "good" AP.

Tested:

* AR9380, STA mode, local locationing frame hacks

8 years ago1) Don't protect \/ and \. even if user say so. They are not special chars
ache [Tue, 19 Jul 2016 00:25:27 +0000 (00:25 +0000)]
1) Don't protect \/ and \. even if user say so. They are not special chars
in any case and needed for further processing. For ~ expansion too.

2) Don't terminate *pathend with / when GLOB_LIMIT_STAT is reached, it will
be not visible outside in any case since error is returned.

3) Cosmetic: change if expression to better reflect its semantic.

8 years agog_Ctoc() conversion buffers are smaller than needed up to MB_CUR_MAX - 1
ache [Mon, 18 Jul 2016 20:24:13 +0000 (20:24 +0000)]
g_Ctoc() conversion buffers are smaller than needed up to MB_CUR_MAX - 1
since whole conversion needs a room for (len >= MB_CUR_MAX). It is no
difference when MB_CUR_MAX == 1, but for multi-byte locales last few chars
('\0' and before) may need just one byte, and the rest of MB_CUR_MAX - 1
space becomes unavailable in the MAXPATHLEN-sized buffer, which cause
conversion error on near MAXPATHLEN long pathes.

Increase g_Ctoc() conversion buffers to MB_LEN_MAX - 1.

8 years agoAdd ipfw_nptv6 module that implements Network Prefix Translation for IPv6
ae [Mon, 18 Jul 2016 19:46:31 +0000 (19:46 +0000)]
Add ipfw_nptv6 module that implements Network Prefix Translation for IPv6
as defined in RFC 6296. The module works together with ipfw(4) and
implemented as its external action module. When it is loaded, it registers
as eaction and can be used in rules. The usage pattern is similar to
ipfw_nat(4). All matched by rule traffic goes to the NPT module.

Reviewed by: hrs
Obtained from: Yandex LLC
MFC after: 1 month
Relnotes: yes
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D6420

8 years agoChange patch from r303004 case 3. According to POSIX gl_errfunc should be
ache [Mon, 18 Jul 2016 19:20:49 +0000 (19:20 +0000)]
Change patch from r303004 case 3. According to POSIX gl_errfunc should be
called first, then GLOB_ERR should be considered.

8 years ago1) Add all characters from ~ expansion as protected to be not interpreted
ache [Mon, 18 Jul 2016 18:24:31 +0000 (18:24 +0000)]
1) Add all characters from ~ expansion as protected to be not interpreted
as pattern meta chars.

2) 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).

3) Remove the hack in the manpage describing how to skip ENOENT and ENOTDIR
in gl_errfunc, it is unneeded now.

4) Set errno to ENAMETOOLONG if g_Ctoc() expansion fails in g_opendir(),
as in other places in the code which are wrappers around system functions.

8 years agoNegotiate/disable TXCSUM_IPV6 same as TXCSUM.
mav [Mon, 18 Jul 2016 16:58:47 +0000 (16:58 +0000)]
Negotiate/disable TXCSUM_IPV6 same as TXCSUM.

8 years ago1) POSIX defines well when GLOB_ABORTED can be returned (only for directory
ache [Mon, 18 Jul 2016 16:06:21 +0000 (16:06 +0000)]
1) POSIX defines well when GLOB_ABORTED can be returned (only for directory
open/read errors and with GLOB_ERR and gl_errfunc processing), so we can't
blindly return it on any MAXPATHLEN overflow. Even our manpage disagrees
with such GLOB_ABORTED usage. Use GLOB_NOSPACE for that now with errno is
set to 0 as for limits.

2) Return GLOB_NOSPACE when valid ~ expansion can't happens due to
MAXPATHLEN overflow too.

3) POSIX (and our manpage) says, if GLOB_ERR is set, GLOB_ABORTED should
be returned immediatelly, without using gl_errfunc. Implement it now.

8 years agoMake sure we clean up the rdoc and reldoc directories if NODOC
gjb [Mon, 18 Jul 2016 15:50:54 +0000 (15:50 +0000)]
Make sure we clean up the rdoc and reldoc directories if NODOC
is not set.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

8 years agoInclude process IDs in core dumps.
jhb [Mon, 18 Jul 2016 15:14:23 +0000 (15:14 +0000)]
Include process IDs in core dumps.

When threads were added to the kernel, the pr_pid member of the
NT_PRSTATUS note was repurposed to store LWP IDs instead of process
IDs.  However, the process ID was no longer recorded in core dumps.
This change adds a pr_pid field to prpsinfo (NT_PRSINFO).  Rather than
bumping the prpsinfo version number, note parsers can use the note's
payload size to determine if pr_pid is present.

Reviewed by: kib, emaste (older version)
MFC after: 2 months
Differential Revision: https://reviews.freebsd.org/D7117

8 years agoAdd PTRACE_VFORK to trace vfork events.
jhb [Mon, 18 Jul 2016 14:53:55 +0000 (14:53 +0000)]
Add PTRACE_VFORK to trace vfork events.

First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when
the new child was created via vfork() rather than fork().  Second, a
new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK
event mask.  This new stop is reported after the vfork parent resumes
due to the child calling exit or exec.  Debuggers can use this stop to
reinsert breakpoints in the vfork parent process before it resumes.

Reviewed by: kib
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D7045

8 years agoUpdate if_hwassist when interface options are changed.
mav [Mon, 18 Jul 2016 14:40:13 +0000 (14:40 +0000)]
Update if_hwassist when interface options are changed.

In particular for me this fixes checksum problem when if_bridge attached
to the interface requests TXCSUM to be disabled, but effectively ignored.

MFC after: 3 days
Sponsored by: iXsystems, Inc.

8 years agoThe assertion re-added in r302614 was triggered when stopping signal
kib [Mon, 18 Jul 2016 10:53:47 +0000 (10:53 +0000)]
The assertion re-added in r302614 was triggered when stopping signal
is delivered to vforked child.  Issue is that we avoid stopping such
children in issignal() to not block parents.  But executed AST, which
ignored stops, leaves the child with the signal pending but no AST
pending.

On first exec after vfork(), call signotify() to handle pending
reenabled signals.  Adjust the assert to not check vfork children
until exec.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoRevert the last commit. It must get more review and testing first.
glebius [Mon, 18 Jul 2016 09:29:08 +0000 (09:29 +0000)]
Revert the last commit. It must get more review and testing first.

8 years agoRedo the r302894: the very new value for a non-scheduled callout is -1.
glebius [Mon, 18 Jul 2016 09:26:06 +0000 (09:26 +0000)]
Redo the r302894: the very new value for a non-scheduled callout is -1.
This was recently added in r290664.

Noticed by: hselasky
PR: 210884

8 years agoFix a random memory overwrite at boot time, simplebus_init() and
loos [Mon, 18 Jul 2016 06:35:40 +0000 (06:35 +0000)]
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)

8 years agohyperv/vmbus: Cosmetic vmbus channel open cleanup
sephe [Mon, 18 Jul 2016 05:36:31 +0000 (05:36 +0000)]
hyperv/vmbus: Cosmetic vmbus channel open cleanup

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

8 years agoRelax checking if the privider size matches size recorded in the
sobomax [Mon, 18 Jul 2016 05:00:01 +0000 (05:00 +0000)]
Relax checking if the privider size matches size recorded in the
superblock, allowing provider to be bit bigger, i.e. have some
extra padding after the FS image. That in some cases might be
a side-effect of using CLOOP format which enforces certain block
size and trying to compress image that is not exactly the number
of those blocks in size. The UFS itself does not have any issues
mounting such padded file systems, so it's what GEOM_LABEL should
do.

Submitted by: @mizhka_gmail.com
Differential Revision: https://reviews.freebsd.org/D6208

8 years agoFix another bug after r302350.
kib [Mon, 18 Jul 2016 04:30:34 +0000 (04:30 +0000)]
Fix another bug after r302350.

Reported and tested by: pho
PR: 210884
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

8 years agoBreak up vm_fault()'s implementation of the read-ahead and delete-behind
alc [Mon, 18 Jul 2016 04:20:26 +0000 (04:20 +0000)]
Break up vm_fault()'s implementation of the read-ahead and delete-behind
optimizations into two distinct pieces.  The first piece consists of the
code that should only be performed once per page fault and requires the map
to be locked.  The second piece consists of the code that should be
performed each time a pager is called on an object in the shadow chain.
(This second piece expects the map to be unlocked.)

Previously, the entire implementation could be executed multiple times.
Moreover, the second and subsequent executions would occur with the map
unlocked.  Usually, the ensuing unsynchronized accesses to the map were
harmless because the map was not changing.  Nonetheless, it was possible for
a use-after-free error to occur, where vm_fault() wrote to a freed map
entry.  This change corrects that problem.

Reported by: avg
Reviewed by: kib
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division

8 years agoDon't print same value twice, one in decimal once in hex. This makes
sobomax [Mon, 18 Jul 2016 03:59:03 +0000 (03:59 +0000)]
Don't print same value twice, one in decimal once in hex. This makes
output more cryptic than it needs to be and wastes cpu cycles and
console bandwidth.

8 years agoAdd my beinstall script.
will [Mon, 18 Jul 2016 02:13:57 +0000 (02:13 +0000)]
Add my beinstall script.

This is meant to install a new BE (boot environment) given a fully built
world/kernel.  In addition to installing world and kernel in the new BE,
it also automatically performs /etc updates (using etcupdate or mergemaster)
and package updates (using pkg).

Because this process is performed in a new BE, it reduces the need for a
second reboot.  It also means a reboot into a partially updated system (due
to install or hardware failure) can't happen.

Inspired by and similar in function to Solaris/illumos-style upgrades.

8 years agolibkvm: Improve physical address lookup scaling.
will [Mon, 18 Jul 2016 01:55:25 +0000 (01:55 +0000)]
libkvm: Improve physical address lookup scaling.

Instead of using a hash table to convert physical page addresses to offsets
in the sparse page array, cache the number of bits set for each 4MB chunk of
physical pages.  Upon lookup, find the nearest cached population count, then
add/subtract the number of bits from that point to the page's PTE bit.
Then multiply by page size and add to the sparse page map's base offset.

This replaces O(n) worst-case lookup with O(1) (plus a small number of bits
to scan in the bitmap).  Also, for a 128GB system, a typical kernel core of
about 8GB will now only require ~4.5MB of RAM for this approach instead of
~48MB as with the hash table.

More concretely, /usr/sbin/crashinfo against the same core improves from a
max RSS of 188MB and wall time of 43.72s (33.25 user 2.94 sys) to 135MB and
9.43s (2.58 user 1.47 sys).  Running "thread apply all bt" in kgdb has a
similar RSS improvement, and wall time drops from 4.44s to 1.93s.

Reviewed by: jhb
Sponsored by: Backtrace I/O

8 years agolibkvm: Bounds check (more) PTE indices.
will [Mon, 18 Jul 2016 01:03:39 +0000 (01:03 +0000)]
libkvm: Bounds check (more) PTE indices.

8 years agolibkvm: Put private kvm routines in kvm_private.c.
will [Mon, 18 Jul 2016 01:02:52 +0000 (01:02 +0000)]
libkvm: Put private kvm routines in kvm_private.c.

8 years agosed(1): Fix off by one introduced in r299211.
pfg [Sun, 17 Jul 2016 21:49:53 +0000 (21:49 +0000)]
sed(1): Fix off by one introduced in r299211.

Detected by running the gsed tests.

Submitted by: Mikhail Teterin
PR: 195929
MFC after: 3 days

8 years agoDisallow interrupt requests on disabled endpoints.
grehan [Sun, 17 Jul 2016 20:34:46 +0000 (20:34 +0000)]
Disallow interrupt requests on disabled endpoints.

Submitted by: Leon Dang
MFC after: 3 days

8 years agoRemove booke_enable_l3_cache declaration and remaining definition.
jhibbits [Sun, 17 Jul 2016 19:24:28 +0000 (19:24 +0000)]
Remove booke_enable_l3_cache declaration and remaining definition.

L3 cache is not defined by Book-E, so is platform specific.  Since it was
already moved for e500-based devices into mpc85xx in r292903, just eliminate it
altogether.  Any device that supports L3 cache should have its own platform
means to enable it.

8 years agoNo need to include mpc85xx.h anymore, so remove it.
jhibbits [Sun, 17 Jul 2016 19:19:50 +0000 (19:19 +0000)]
No need to include mpc85xx.h anymore, so remove it.

8 years agoFix nvlist array memory leak.
oshogbo [Sun, 17 Jul 2016 15:36:02 +0000 (15:36 +0000)]
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>
MFC after: 1 week

8 years agoFix memory leak in the nvlist string array.
oshogbo [Sun, 17 Jul 2016 15:29:31 +0000 (15:29 +0000)]
Fix memory leak in the nvlist string array.

Submitted by: Adam Starak <starak.adam@gmail.com>
MFC after: 1 week

8 years agoTEGRA: Subclass Tegra PCIE driver from ofw_pci base driver.
mmel [Sun, 17 Jul 2016 14:45:15 +0000 (14:45 +0000)]
TEGRA: Subclass Tegra PCIE driver from ofw_pci base driver.
Remove now redundant code.

8 years agoRestore PIM_ATA_EXT flag handling, lost at r300207.
mav [Sun, 17 Jul 2016 14:17:58 +0000 (14:17 +0000)]
Restore PIM_ATA_EXT flag handling, lost at r300207.

This re-enables NCQ TRIM usage on capable hardware (bhyve).

8 years agoFix NCQ TRIM emulation.
mav [Sun, 17 Jul 2016 14:13:47 +0000 (14:13 +0000)]
Fix NCQ TRIM emulation.

When this code was written, there was no guests using it to test.

8 years agoOFWPCI: Add support for NEW_PCIB.
mmel [Sun, 17 Jul 2016 13:43:46 +0000 (13:43 +0000)]
OFWPCI: Add support for NEW_PCIB.

MFC after: 3 weeks

8 years agoOFWPCI: Improve resource handling.
mmel [Sun, 17 Jul 2016 13:43:00 +0000 (13:43 +0000)]
OFWPCI: Improve resource handling.
- add new rman for prefetchable memory. Is used only if given 'ranges'
  property contains prefetchable memory range.

- not all ranges in 'ranges' property are subject for rman's filling.
  Tegra for example, have two addition records which are used for
  'pci 'register' -> 'assigned-address' -> 'ranges' machinery.
  Add sc_ranges_mask for masking not rman related ranges.

- consistently pass unknown (not managed at this level) resources
  allocation/release/adjust requests to parent.

MFC after: 3 weeks

8 years agoAdd a constant required by RFC 7496.
tuexen [Sun, 17 Jul 2016 13:33:35 +0000 (13:33 +0000)]
Add a constant required by RFC 7496.

MFC after: 3 days

8 years agoFix the PR-SCTP behaviour.
tuexen [Sun, 17 Jul 2016 13:14:51 +0000 (13:14 +0000)]
Fix the PR-SCTP behaviour.
This is done by rrs@.

MFC after: 3 days

8 years agoReflect pathnames sorting in collation order.
ache [Sun, 17 Jul 2016 13:10:57 +0000 (13:10 +0000)]
Reflect pathnames sorting in collation order.

8 years agoIn AHCI_IRQ_MODE_AFTER mode do not clear interrupts below.
mav [Sun, 17 Jul 2016 12:45:58 +0000 (12:45 +0000)]
In AHCI_IRQ_MODE_AFTER mode do not clear interrupts below.

This is probably a NOP change since IS register is not activery used for
interrupts below the shared, but it looked odd to clear interrupts we did
not handle.

8 years agoDo not consider the last interrupt shared if there are enough interrupts
mav [Sun, 17 Jul 2016 12:31:31 +0000 (12:31 +0000)]
Do not consider the last interrupt shared if there are enough interrupts
for all channels.

8 years agoDon't duplicate code for SCTP, just use the ones used for UDP and TCP.
tuexen [Sun, 17 Jul 2016 11:43:27 +0000 (11:43 +0000)]
Don't duplicate code for SCTP, just use the ones used for UDP and TCP.

This fixes a bug with link local addresses. This will require and
upcoming change in the kernel to bring SCTP to the same behaviour
as UDP and TCP.

MFC after: 3 days

8 years agoIn g_Ctoc() apply CHAR() macro to *str to strip all flags. It gains nothing
ache [Sun, 17 Jul 2016 11:25:24 +0000 (11:25 +0000)]
In g_Ctoc() apply CHAR() macro to *str to strip all flags. It gains nothing
right now, but some architectures theoretically may 64-bit wchar_t and the
code looks more correct.

8 years ago1) This file full of direct char <-> wchar_t assignment, not converted, cut
ache [Sun, 17 Jul 2016 09:39:59 +0000 (09:39 +0000)]
1) This file full of direct char <-> wchar_t assignment, not converted, cut
them down. This hack still remains:
 * 2. Illegal byte sequences in filenames are handled by treating them as
 *    single-byte characters with a values of such bytes of the sequence
 *    cast to wchar_t.

2) Reword the comment in the hack above to reflect implementation.

3) Protect signed wchar_t from sign extension when a signed char is assigned
to it in the hack above.

3) Corresponding backward hack in g_Ctoc() was not implemented, so all
pathes with illegal byte sequences are skipped as result, implement it now.

4) globtilde() forget to convert expanded user home dir from multibyte to
wchar.

5) Protect globtilde() from long expansion truncation.

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

8 years agoAdd missing sctps_reasmusrmsgs counter.
tuexen [Sun, 17 Jul 2016 08:31:21 +0000 (08:31 +0000)]
Add missing sctps_reasmusrmsgs counter.
Joint work with rrs@.
MFC after: 3 days

8 years agoA failed installation once restarted will often error out
allanjude [Sat, 16 Jul 2016 19:35:04 +0000 (19:35 +0000)]
A failed installation once restarted will often error out

If an encrypted install is attempted and fails for any reason, the disk
cannot be erased by the installer because the partition is in use by GELI

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
Reported by: jonathan
MFC after: 10 days

8 years agoFix encrypted MBR install
allanjude [Sat, 16 Jul 2016 18:28:44 +0000 (18:28 +0000)]
Fix encrypted MBR install

The pools are exported and reimported in order to write the bootcode
This causes an error when the bootpool is later mounted by common code
The bootpool is now imported with the -N flag to prevent mounting

Reported by: Michael Dexter
MFC after: 5 days

8 years agoAdd support for Allwinner H3 EMAC.
jmcneill [Sat, 16 Jul 2016 18:06:41 +0000 (18:06 +0000)]
Add support for Allwinner H3 EMAC.

H3 EMAC is the same as A83T/A64 except the SoC includes an (optional)
internal 10/100 PHY. Both internal and external PHYs are supported on H3
with this driver.

8 years agoPath generation was not according to collate
ache [Sat, 16 Jul 2016 13:26:18 +0000 (13:26 +0000)]
Path generation was not according to collate

Approved by:    jilles

8 years agoAnother issue reported on http://seclists.org/oss-sec/2016/q3/68 is
kib [Sat, 16 Jul 2016 13:24:58 +0000 (13:24 +0000)]
Another issue reported on http://seclists.org/oss-sec/2016/q3/68 is
that struct kevent member ident has uintptr_t type, which is silently
truncated to int in the call to fget().  Explicitely check for the
valid range.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoDeal with a portential memory allocation failure, which was reported
tuexen [Sat, 16 Jul 2016 12:25:37 +0000 (12:25 +0000)]
Deal with a portential memory allocation failure, which was reported
by the clang static code analyzer.
Joint work with rrs@.

MFC after: 3 days

8 years agoRevert unwanted change leaked into r302932.
mav [Sat, 16 Jul 2016 09:44:31 +0000 (09:44 +0000)]
Revert unwanted change leaked into r302932.

8 years agoIncrease I82545_MAX_TXSEGS from 20 to 64 and add checks for it.
mav [Sat, 16 Jul 2016 09:08:33 +0000 (09:08 +0000)]
Increase I82545_MAX_TXSEGS from 20 to 64 and add checks for it.

There seems no hard limit on number of segments per packet in the chip,
and 20 appeared insufficient.  Hope 64 will be enough, but if not -- add
check to report that and drop the packet instead of corrupting stack.

8 years agoDon't free a data chunk twice.
tuexen [Sat, 16 Jul 2016 08:11:43 +0000 (08:11 +0000)]
Don't free a data chunk twice.
Found by the clang static code analyzer running for the userland stack.

MFC after: 3 days

8 years agoNow that potentially buggy versions of Xen are automatically detected
cperciva [Sat, 16 Jul 2016 08:04:00 +0000 (08:04 +0000)]
Now that potentially buggy versions of Xen are automatically detected
(see r302635), there is no need to force msix interrupt migration off
via loader.conf.

Reverts: r302184
MFC after: 3 days