]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoDocument list of supported chipsets.
mav [Wed, 20 Jul 2016 20:10:37 +0000 (20:10 +0000)]
Document list of supported chipsets.

7 years agoRemove uneeded parens.
sbruno [Wed, 20 Jul 2016 19:21:11 +0000 (19:21 +0000)]
Remove uneeded parens.

MFC after: 1 day

7 years agoUpdate crashinfo to work with newer gdb from ports.
jhb [Wed, 20 Jul 2016 18:41:47 +0000 (18:41 +0000)]
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
Reviewed by: emaste
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7218

7 years agoChange wording to use function rather than system call in the description
zeising [Wed, 20 Jul 2016 18:16:58 +0000 (18:16 +0000)]
Change wording to use function rather than system call in the description
as well.

Reviewed by: brooks
MFC after: 5 days

7 years agoFix DEBUG build on 64-bit arch after r303099
cem [Wed, 20 Jul 2016 18:11:22 +0000 (18:11 +0000)]
Fix DEBUG build on 64-bit arch after r303099

Reported by: Larry Rosenman <ler at lerctr.org>

7 years agoUpdate to reflect the fact that pipe() is a wrapper around the pipe2()
brooks [Wed, 20 Jul 2016 18:02:07 +0000 (18:02 +0000)]
Update to reflect the fact that pipe() is a wrapper around the pipe2()
system call.

Reviewed by: jhb, wblock
MFC after: 5 days
Sponsored by: DAPRA, AFRL
Differential Revision: https://reviews.freebsd.org/D6948

7 years agoMinor wording improvements to the note about pipe(2) removal.
brooks [Wed, 20 Jul 2016 18:00:22 +0000 (18:00 +0000)]
Minor wording improvements to the note about pipe(2) removal.

MFC after: 5 days
Sponsored by: DARPA, AFRL

7 years agoMark the Designware MMC and USB OTG drivers as FDT only. These are normally
andrew [Wed, 20 Jul 2016 17:46:33 +0000 (17:46 +0000)]
Mark the Designware MMC and USB OTG drivers as FDT only. These are normally
found on arm64 devices that use FDT.

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

7 years agoAdd a comment describing the 'fast path' that was introduced in r270011.
alc [Wed, 20 Jul 2016 17:20:22 +0000 (17:20 +0000)]
Add a comment describing the 'fast path' that was introduced in r270011.

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

7 years agoWe will be switching to a new arm64 uart cpu driver that handles both FDT
andrew [Wed, 20 Jul 2016 17:19:47 +0000 (17:19 +0000)]
We will be switching to a new arm64 uart cpu driver that handles both FDT
and ACPI. As such pull out what will be the common parts of the FDT cpu
detection to a new function that can be shared between them.

Reviewed by: manu
Obtained from: ABT Systems Ltd
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7262

7 years agoExtend ELF coredump to support more than 65535 segments
cem [Wed, 20 Jul 2016 16:59:36 +0000 (16:59 +0000)]
Extend ELF coredump to support more than 65535 segments

The ELF e_phnum field is only 16 bits wide. To support more than 65535 segments
(program headers), Sun's "Linker and Libraries Guide" table 7-7 (or 12-7,
depending on document version) prescribes a special first section header where
sh_info represents the real number of program headers.

Test code to follow, when it is ready.

Reference: http://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf

Reviewed by: emaste, markj
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7255

7 years agoRedo the r302894: the very new value for a non-scheduled callout is -1.
glebius [Wed, 20 Jul 2016 16:48:25 +0000 (16:48 +0000)]
Redo the r302894: the very new value for a non-scheduled callout is -1.
This was recently added in r290664.

Noticed by: hselasky
Tested by: Larry Rosenman <ler lerctr.org>
PR: 210884

7 years agoAdd myself to MAINTAINERS.
nwhitehorn [Wed, 20 Jul 2016 16:46:13 +0000 (16:46 +0000)]
Add myself to MAINTAINERS.

7 years agoRevert r303037. It re-introduces the panic with TCP timers.
glebius [Wed, 20 Jul 2016 16:44:22 +0000 (16:44 +0000)]
Revert r303037. It re-introduces the panic with TCP timers.

Agreed by: rrs, re (gjb)

7 years agoContinuation lines with comments badly affects gprof, it is excluded from
ache [Wed, 20 Jul 2016 15:59:37 +0000 (15:59 +0000)]
Continuation lines with comments badly affects gprof, it is excluded from
build on amd64 f.e.

7 years agoFix camdd for host-aware and host-managed SMR disks.
asomers [Wed, 20 Jul 2016 15:00:05 +0000 (15:00 +0000)]
Fix camdd for host-aware and host-managed SMR disks.

This should've gone in as part of r300207

Reviewed by: ken
MFC after: 3 days
Sponsored by: Spectra Logic Corp

7 years agoEnsure that the UFS directory vnode' vm_object is properly sized
kib [Wed, 20 Jul 2016 14:40:56 +0000 (14:40 +0000)]
Ensure that the UFS directory vnode' vm_object is properly sized
before UFS_BALLOC() is called.  I do not believe that this caused any
real issue on FreeBSD because the exclusive vnode lock is held over
the balloc/resize, the change is to make formally correct KPI use.

Based on: the Matthew Dillon' patch from DragonFly BSD
PR: 93942
Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoIn addition to r303074 case 1, search for protected L'/' too in globtilde()
ache [Wed, 20 Jul 2016 12:46:21 +0000 (12:46 +0000)]
In addition to r303074 case 1, search for protected L'/' too in globtilde()

7 years agoAdd support for the SID (Security ID Module) on Allwinner A10 and A20.
manu [Wed, 20 Jul 2016 11:23:06 +0000 (11:23 +0000)]
Add support for the SID (Security ID Module) on Allwinner A10 and A20.
The rootkey is burnt at production and can't be changed, thus is can be used
as a device unique ID or to generate a MAC address (This is was u-boot does).
The rootkey is exposed as a sysctl (dev.aw_sid.<unit>.rootkey).

Reviewed by: jmcneill
Differential Revision: https://reviews.freebsd.org/D6383

7 years agoMFV r303083: 7164 zdb should be able to open the root dataset
avg [Wed, 20 Jul 2016 11:15:32 +0000 (11:15 +0000)]
MFV r303083: 7164 zdb should be able to open the root dataset

Note: conversion of the manual page change from roff to mdoc is mine.

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

https://www.illumos.org/issues/7164
  If the pool/dataset command-line argument is specified with a trailing
  slash, for example, "tank/", we should interpret it as the topmost
  dataset (rather than the whole pool)

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Tim Chase <tim@chase2k.com>
PR: 204661
MFC after: 1 week
Relnotes: yes

7 years agoRemove outdated list of supported chipsets, generalizing it.
mav [Wed, 20 Jul 2016 11:04:49 +0000 (11:04 +0000)]
Remove outdated list of supported chipsets, generalizing it.

7 years agoMFV r303082: 6391 Override default SPA config location via environment
avg [Wed, 20 Jul 2016 10:06:56 +0000 (10:06 +0000)]
MFV r303082: 6391 Override default SPA config location via environment

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

https://www.illumos.org/issues/6391
  When using zdb with non-default SPA config file it is not convenient
  to add -U <non-default-config-file-path> all the time. This commit
  introduces support for setting/overriding SPA config location via
  environment variable 'SPA_CONFIG_PATH'.
  If -U flag is specified in the command line it will override any other
  value as usual.

https://github.com/zfsonlinux/zfs/commit/64d7b6cf75e52a4698d9bdec61745573c39d2e5a

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Cyril Plisko <cyril.plisko@mountall.com>
MFC after: 1 week

7 years agovesa: fix panic on suspend
royger [Wed, 20 Jul 2016 09:29:39 +0000 (09:29 +0000)]
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.

Sponsored by: Citrix Systems R&D
MFC after: 3 days
PR: 209203
Reviewed by: dumbbell
Differential revision: https://reviews.freebsd.org/D7196

7 years ago1) Per POSIX (and glibc) GLOB_NOCHECK should return original pattern,
ache [Wed, 20 Jul 2016 07:30:44 +0000 (07:30 +0000)]
1) Per POSIX (and glibc) GLOB_NOCHECK should return original pattern,
unmodified, if no matches found. But our original code strips all '\'
returning it. Rewrite the code to allow to reconstruct exact the
original pattern with backslashes for this case.

2) Prevent to use truncated pattern if MAXPATHLEN exceeded, return
GLOB_NOMATCH instead.

3) Fix few end loop conditions filling Char arrays with mbrtowc(),
MB_CUR_MAX is unneeded in two places and condition is less by one
in other place.

4) Prevent to use truncated filenames match if MAXPATHLEN exceeded,
skip such directory entries.

5) Don't end *pathend with L'/' in glob3() if limit is reached, this
change will be not visible since error is returned.

6) If error happens in (*readdirfunc)(), do the same GLOB_ABORTED
processing as for g_opendir() as POSIX requires.

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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>

7 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

7 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>

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

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

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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

7 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

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

7 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

7 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

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

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

7 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

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

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

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

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

7 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

7 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

7 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

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

7 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

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

7 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

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

7 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

7 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

7 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

7 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

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

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

7 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

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

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

7 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

7 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

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

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

7 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

7 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