]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoMFV r286224: 5695 dmu_sync'ed holes do not retain birth time
Alexander Motin [Wed, 12 Aug 2015 17:21:41 +0000 (17:21 +0000)]
MFV r286224: 5695 dmu_sync'ed holes do not retain birth time

illumos/illumos-gate@70163ac57e58ace1c5c94dfbe85dca5a974eff36

https://www.illumos.org/issues/5695
  In dmu_sync_ready(), a hole block pointer will have it's logical size
  explicitly set as it's necessary for replay purposes. To "undo" this,
  dmu_sync_done() will zero out any hole that it finds. This becomes a
  problem when using the "hole_birth" feature, as this will also wipe out
  any birth time that might have happened to be set on the hole.
  ...
  As a fix, the logic to zero out a hole is only applied to old style
  holes with a birth time of zero. Holes created with the "hole_birth"
  feature enabled will have a non-zero birth time, and will be skipped
  (thus preserving the ltime, type, and level information as well).
  In addition, zdb was updated to also print the ltime, type, and level
  information for these new style holes. Previously, only the logical
  birth time would be printed.

Author: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>

8 years agoWhy on earth have we been building rescue as a build tool for the past
Warner Losh [Wed, 12 Aug 2015 17:19:52 +0000 (17:19 +0000)]
Why on earth have we been building rescue as a build tool for the past
12 years? Nothing downstream in the build uses it. Eliminate it as a
build tool.

Reviewed by: emaste@ ("just delete it")

8 years agoAdd the CNTHCTL_EL2 register bits missed in r286674
Andrew Turner [Wed, 12 Aug 2015 17:09:57 +0000 (17:09 +0000)]
Add the CNTHCTL_EL2 register bits missed in r286674

8 years agoSet the counter-timer virtual offset to a know value, it may not have been
Andrew Turner [Wed, 12 Aug 2015 17:06:22 +0000 (17:06 +0000)]
Set the counter-timer virtual offset to a know value, it may not have been
set by the boot code and are reset to an implementation defined value that
may be unknown.

Sponsored by: ABT Systems Ltd

8 years agoCrunchgen needs to be bootstrapped to pick up the STRIP->STRIPBIN
Warner Losh [Wed, 12 Aug 2015 16:43:15 +0000 (16:43 +0000)]
Crunchgen needs to be bootstrapped to pick up the STRIP->STRIPBIN
changes to prevent the 'rescue: not found' errors from happening.
Bump FreeBSD_version to 1100078 since there's been no version bumps
since this change was made. Only people that installed since r284356
really need to do this bootstrapping, but since crunchgen needs to
bootstrap for other reasons, bumping the number was the simplest.

8 years agoetc/rc.d/hostname: permit setting hostname if already set
Mark Felder [Wed, 12 Aug 2015 16:22:10 +0000 (16:22 +0000)]
etc/rc.d/hostname: permit setting hostname if already set

Approved by: dteske
Differential Revision: https://reviews.freebsd.org/D2577

8 years agoProperly return ENOTDIR when calling *at() on a non-vnode.
Ed Schouten [Wed, 12 Aug 2015 16:17:00 +0000 (16:17 +0000)]
Properly return ENOTDIR when calling *at() on a non-vnode.

We already properly return ENOTDIR when calling *at() on a non-directory
vnode, but it turns out that if you call it on a socket, we see EINVAL.
Patch up namei to properly translate this to ENOTDIR.

8 years agoRemove unused TCPTV_SRTTDFLT. We initialize srtt with TCPTV_SRTTBASE when we
Hiren Panchasara [Wed, 12 Aug 2015 16:08:37 +0000 (16:08 +0000)]
Remove unused TCPTV_SRTTDFLT. We initialize srtt with TCPTV_SRTTBASE when we
don't have any rtt estimate.

Differential Revision: D3334
Sponsored by: Limelight Networks

8 years agoAdd support for the Broadcom TruManage integrated serial port.
Marcel Moolenaar [Wed, 12 Aug 2015 15:48:14 +0000 (15:48 +0000)]
Add support for the Broadcom TruManage integrated serial port.

PR: 191266

8 years agoBetter support memory mapped console devices, such as VGA and EFI
Marcel Moolenaar [Wed, 12 Aug 2015 15:26:32 +0000 (15:26 +0000)]
Better support memory mapped console devices, such as VGA and EFI
frame buffers and memory mapped UARTs.

1.  Delay calling cninit() until after pmap_bootstrap(). This makes
    sure we have PMAP initialized enough to add translations. Keep
    kdb_init() after cninit() so that we have console when we need
    to break into the debugger on boot.
2.  Unfortunately, the ATPIC code had be moved as well so as to
    avoid a spurious trap #30. The reason for which is not known
    at this time.
3.  In pmap_mapdev_attr(), when we need to map a device prior to the
    VM system being initialized, use virtual_avail as the KVA to map
    the device at. In particular, avoid using the direct map on amd64
    because we can't demote by virtue of not being able to allocate
    yet. Keep track of the translation.
    Re-use the translation after the VM has been initialized to not
    waste KVA and to satisfy the assumption in uart(4) that the handle
    returned for the low-level console is the same as later returned
    when the device is probed and attached.
4.  In pmap_unmapdev() remove the mapping from the table when called
    pre-init. Otherwise keep the mapping. During bus probe and attach
    device resources are mapped and unmapped multiple times, which
    would have us destroy the mapping used by the low-level console.
5.  In pmap_init(), set pmap_initialized to signal that we're not
    pre-init anymore. On amd64, bring the direct map in sync with the
    translations created at that time.
6.  Implement bus_space_map() and bus_space_unmap() for real: when
    the tag corresponds to memory space, call the corresponding
    pmap_mapdev() and pmap_unmapdev() functions to construct and
    actual handle.
7.  In efifb.c and vt_vga.c, remove the crutches and hacks and simply
    call pmap_mapdev_attr() or bus_space_map() as desired.

Notes:
1.  uart(4) already used bus_space_map() during low-level console
    setup but since serial ports have traditionally been I/O port
    based, the lack of a proper implementation for said function
    was not a problem. It has always supported memory mapped UARTs
    for low-level consoles by setting hw.uart.console accordingly.
2.  The use of the direct map on amd64 without setting caching
    attributes has been a bigger problem than previously thought.
    This change has the fortunate (and unexpected) side-effect of
    fixing various EFI frame buffer problems (though not all).

PR: 191564, 194952

Special thanks to:
1.  XipLink, Inc -- generously donated an Intel Bay Trail E3800
    based eval board (ADLE3800PC).
2.  The FreeBSD Foundation, in particular emaste@ -- for UEFI
    support in general and testing.
3.  Everyone who tested the proposed for PR 191564.
4.  jhb@ and kib@ for being a soundboard and applying a clue bat
    if so needed.

8 years agoFix mandoc warnings/errors.
Christian Brueffer [Wed, 12 Aug 2015 11:56:19 +0000 (11:56 +0000)]
Fix mandoc warnings/errors.

MFC after: 1 week

8 years agoUnignore signals when starting CloudABI processes.
Ed Schouten [Wed, 12 Aug 2015 11:30:31 +0000 (11:30 +0000)]
Unignore signals when starting CloudABI processes.

As CloudABI processes cannot adjust their signal handlers, we need to
make sure that we start up CloudABI processes with consistent signal
masks. Though the POSIx standard signal behavior is all right, we do
need to make sure that we ignore SIGPIPE, as it would otherwise be
hard to interact with pipes and sockets.

Extend execsigs() to iterate over ps_sigignore and call sigdflt() for
each of the ignored signals.

Reviewed by: kib
Obtained from: https://github.com/NuxiNL/freebsd
Differential Revision: https://reviews.freebsd.org/D3365

8 years agoUse CAP_EVENT instead of CAP_PDWAIT.
Ed Schouten [Wed, 12 Aug 2015 11:07:03 +0000 (11:07 +0000)]
Use CAP_EVENT instead of CAP_PDWAIT.

The cloudlibc pdwait() function ends up using FreeBSD's kqueue() in
combination with EVFILT_PROCDESC. This depends on CAP_EVENT -- not
CAP_PDWAIT.

Obtained from: https://github.com/NuxiNL/freebsd

8 years agoFix a few mandoc warnings.
Christian Brueffer [Wed, 12 Aug 2015 10:34:05 +0000 (10:34 +0000)]
Fix a few mandoc warnings.

MFC after: 1 week

8 years agoIn x2APIC mode, IPI generation is atomic because it is performed by
Konstantin Belousov [Wed, 12 Aug 2015 09:55:52 +0000 (09:55 +0000)]
In x2APIC mode, IPI generation is atomic because it is performed by
single ICR MSR write.  This is in contrast with the xAPIC mode, where
we must read current ICR value, do bit fiddling and perform two 32-bit
register writes.  As a consequence, there is no need to disable
interrupts around ICR value calculation and write.

Note that typical users of ipi_raw() and ipi_vectored() take spinlock,
which already disables interrupts.  For them, the change removes
unneeded CLI and POPFL/Q instructions.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoInitialization of smp_tlb_wait does not require release semantic, no
Konstantin Belousov [Wed, 12 Aug 2015 09:46:39 +0000 (09:46 +0000)]
Initialization of smp_tlb_wait does not require release semantic, no
data is synchronized by store/load to the variable.  The
lapic_write_icr() function ensures that store buffers are flushed
before IPI command is issued.

Discussed with: bde
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoAP should load aps_ready with acquire semantic to see BSP updates to
Konstantin Belousov [Wed, 12 Aug 2015 09:43:12 +0000 (09:43 +0000)]
AP should load aps_ready with acquire semantic to see BSP updates to
the SMP structures, synchronized with the load by release store in
release_aps().

The change is formal, x86 strong memory model implicitely provided
the guarantees.

Discussed with: bde
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoMake blocking CloudABI futex operations work.
Ed Schouten [Wed, 12 Aug 2015 08:41:48 +0000 (08:41 +0000)]
Make blocking CloudABI futex operations work.

Blocking on locks and condition variables can be accomplished by polling
and using the special filters CONDVAR, LOCK_RDLOCK and LOCK_WRLOCK.

For now it wouldn't make sense to implement this functionality into
kqueue() itself, for the reason that they are CloudABI specific and
would require us to resize 'struct kevent' to hold all of the parameters
of interest.

Add a bandaid to the CloudABI poll system call to call into the futex
code directly if it detects specific combinations of events that are
used by the C library.

Obtained from: https://github.com/NuxiNL/freebsd

8 years agoFix set of sign extension bugs in r286625.
Alexander Motin [Wed, 12 Aug 2015 08:36:58 +0000 (08:36 +0000)]
Fix set of sign extension bugs in r286625.

8 years agoMake poll() and kqueue() on CloudABI work.
Ed Schouten [Wed, 12 Aug 2015 07:59:00 +0000 (07:59 +0000)]
Make poll() and kqueue() on CloudABI work.

This change implements two functions, cloudabi64_kevent_copyin() and
cloudabi64_kevent_copyout(), that convert CloudABI structures to
FreeBSD's struct kevent. CloudABI uses two structures: subscription_t
and event_t. The former is used for input, whereas the latter is used
for output. Unlike struct kevent, fields aren't overloaded for multiple
purposes or for separate event types.

For poll() we call into the newly introduced kern_kevent_anonymous()
function that allows us to poll without a file descriptor. This function
is not only used by poll(), but also by functions such as
sleep() and clock_nanosleep().

Reviewed by: jmg
Obtained from: https://github.com/NuxiNL/freebsd
Differential Revision: https://reviews.freebsd.org/D3308

8 years agoUse bus_alloc_resource_any(), rather than bus_alloc_resource()
Marcel Moolenaar [Wed, 12 Aug 2015 04:03:04 +0000 (04:03 +0000)]
Use bus_alloc_resource_any(), rather than bus_alloc_resource()
with start 0 and end ~0. This avoids confusion WRT to what the
value of length can or should be.

8 years agoMark usr/include/c++/v1/tr1 as obsolete
Julio Merino [Wed, 12 Aug 2015 03:03:51 +0000 (03:03 +0000)]
Mark usr/include/c++/v1/tr1 as obsolete

The directory usr/include/c++/v1 was marked as obsolete but its tr1 subdir
was not, resulting in a removal error in delete-old.

8 years agoDescribe that bcopy(3) is deprecated and marked as LEGACY in
Marcelo Araujo [Wed, 12 Aug 2015 00:49:20 +0000 (00:49 +0000)]
Describe that bcopy(3) is deprecated and marked as LEGACY in
POSIX.1-2001 and removed from the specification in POSIX.1-2008.
New softwares shall use memcpy(3) or memmove(3).

Differential Revision: D3358
Reviewed by: wblock
Approved by: rodrigc
Sponsored by: gandi.net

8 years agoDisable building INDEX-9 and INDEX-10 because they are not useful for
Xin LI [Tue, 11 Aug 2015 22:43:28 +0000 (22:43 +0000)]
Disable building INDEX-9 and INDEX-10 because they are not useful for
users who uses only FreeBSD -CURRENT, and building these indexes are
only useful to those who share ports tree across different FreeBSD
releases, and system administrator with that need can always enable
this behavior.

MFC after: 2 weeks (only the principals, not actual change)

8 years agoFix and re-enable UTF-8 tests.
Jilles Tjoelker [Tue, 11 Aug 2015 21:59:36 +0000 (21:59 +0000)]
Fix and re-enable UTF-8 tests.

8 years agoMake this compile again when PPS_SYNC is defined. Also remove a couple
Ian Lepore [Tue, 11 Aug 2015 19:25:26 +0000 (19:25 +0000)]
Make this compile again when PPS_SYNC is defined.  Also remove a couple
comment blocks and constants that no longer apply.

8 years agoFix assertion panic caused by combination of r286598 and TRIM.
Alexander Motin [Tue, 11 Aug 2015 19:15:55 +0000 (19:15 +0000)]
Fix assertion panic caused by combination of r286598 and TRIM.

8 years agoIf any function fail (the ptr variable will be equal to NULL), we shouldn't
Mariusz Zaborski [Tue, 11 Aug 2015 18:17:31 +0000 (18:17 +0000)]
If any function fail (the ptr variable will be equal to NULL), we shouldn't
return buffer. Instead we should free it and return NULL.

Approved by: pjd (mentor)

8 years agoThe nvlist_move_nvpair() function can fail in two cases, if:
Mariusz Zaborski [Tue, 11 Aug 2015 18:01:10 +0000 (18:01 +0000)]
The nvlist_move_nvpair() function can fail in two cases, if:
- the nvlist error is set, or
- the nvlist case ignore flag is not set and there is attend to
  add element with duplicated name.
In both cases the nvlist_move_nvpair() function free nvpair structure.
If library will try to unpack a binary blob which contains duplicated
names it will end up with using memory after free.

To prevent that, the nvlist_move_nvpair() function interface is changed
to report about failure and checks are added to the nvpair_xunpack()
function.

Discovered thanks to the american fuzzy lop.

Approved by: pjd (mentor)

8 years agoDon't set parent if the unpack operation fail. In some
Mariusz Zaborski [Tue, 11 Aug 2015 17:54:51 +0000 (17:54 +0000)]
Don't set parent if the unpack operation fail. In some
case this could crash the library, because of the NULL pointer references.

Discovered thanks to american fuzzy lop.

Approved by: pjd (mentor)

8 years agoFix comment describing legacy target and wrap to 80 columns
Ed Maste [Tue, 11 Aug 2015 17:48:58 +0000 (17:48 +0000)]
Fix comment describing legacy target and wrap to 80 columns

8 years agoMake the nvlist_next(9) function handle NULL pointer variable.
Mariusz Zaborski [Tue, 11 Aug 2015 17:41:32 +0000 (17:41 +0000)]
Make the nvlist_next(9) function handle NULL pointer variable.
This simplifies removing the first element from nvlist.

Reviewed by: AllanJude
Approved by: pjd (mentor)

8 years agoUse correct src/dst ports when removing states.
Mariusz Zaborski [Tue, 11 Aug 2015 17:24:34 +0000 (17:24 +0000)]
Use correct src/dst ports when removing states.

Submitted by: Milosz Kaniewski <m.kaniewski@wheelsystems.com>,
UMEZAWA Takeshi <umezawa@iij.ad.jp> (orginal)
Reviewed by: glebius
Approved by: pjd (mentor)
Obtained from: OpenBSD
MFC after: 3 days

8 years agoInstead of defining the actualy user and group id in the drmP.h files
Koop Mast [Tue, 11 Aug 2015 16:51:44 +0000 (16:51 +0000)]
Instead of defining the actualy user and group id in the drmP.h files
define GID_VIDEO in sys/conf.h, and use it together with UID_ROOT
to define DRM_DEV_UID and DRM_DEV_GID in the drmP.h files.

So there is one place where the UID's and GID's are defined.

Submitted by: ed@
Reviewed by: ed@, dumbbell@
Differential Revision: https://reviews.freebsd.org/D3360

8 years agoActually disable the invalid test
Baptiste Daroussin [Tue, 11 Aug 2015 16:08:10 +0000 (16:08 +0000)]
Actually disable the invalid test

8 years agoReenable the test.
Baptiste Daroussin [Tue, 11 Aug 2015 16:07:24 +0000 (16:07 +0000)]
Reenable the test.

Sorry I was testing on the wrong branch.

8 years agoBuild libelf and libdwarf in the legacy stage
Ed Maste [Tue, 11 Aug 2015 15:43:09 +0000 (15:43 +0000)]
Build libelf and libdwarf in the legacy stage

They need to be built and installed (including headers) prior to the
DTrace CTF tools.

Reviewed by: imp (as part of a larger change)
Sponsored by: The FreeBSD Foundation

8 years agoFall back to O_RDONLY -- not O_WRONLY.
Ed Schouten [Tue, 11 Aug 2015 14:08:46 +0000 (14:08 +0000)]
Fall back to O_RDONLY -- not O_WRONLY.

If CloudABI processes open files with a set of requested rights that do
not match any of the privileges granted by O_RDONLY, O_WRONLY or O_RDWR,
we'd better fall back to O_RDONLY -- not O_WRONLY.

8 years agoProperly convert the error number to CloudABI's indexing.
Ed Schouten [Tue, 11 Aug 2015 14:07:04 +0000 (14:07 +0000)]
Properly convert the error number to CloudABI's indexing.

We currently return FreeBSD's errno value directly, which is of course
not correct.

8 years agoAdd support for anonymous kqueues.
Ed Schouten [Tue, 11 Aug 2015 13:47:23 +0000 (13:47 +0000)]
Add support for anonymous kqueues.

CloudABI's polling system calls merge the concept of one-shot polling
(poll, select) and stateful polling (kqueue). They share the same data
structures.

Extend FreeBSD's kqueue to provide support for waiting for events on an
anonymous kqueue. Unlike stateful polling, there is no need to support
timeouts, as an additional timer event could be used instead.
Furthermore, it makes no sense to use a different number of input and
output kevents. Merge this into a single argument.

Obtained from: https://github.com/NuxiNL/freebsd
Differential Revision: https://reviews.freebsd.org/D3307

8 years agoStart to support PSCI 1.0. For all the functions we currently support this
Andrew Turner [Tue, 11 Aug 2015 13:42:58 +0000 (13:42 +0000)]
Start to support PSCI 1.0. For all the functions we currently support this
can be seen as the same as 0.2. There are changes with the data passed to
CPU_SUSPEND, however we don't yet use this call.

Sponsored by: ABT Systems Ltd

8 years agoUse single 'lle_timer' callout in lltable instead of
Alexander V. Chernikov [Tue, 11 Aug 2015 12:38:54 +0000 (12:38 +0000)]
Use single 'lle_timer' callout in lltable instead of
  two different names of the same timer.

8 years agoFix r286625 build on i386.
Alexander Motin [Tue, 11 Aug 2015 12:38:01 +0000 (12:38 +0000)]
Fix r286625 build on i386.

8 years agoCheck the correct value in db_validate_address, pmap_extract returns 0 on
Andrew Turner [Tue, 11 Aug 2015 12:32:17 +0000 (12:32 +0000)]
Check the correct value in db_validate_address, pmap_extract returns 0 on
failure.

Sponsored by: ABT Systems Ltd

8 years agoFix minor mismerge in r286574.
Alexander Motin [Tue, 11 Aug 2015 12:22:16 +0000 (12:22 +0000)]
Fix minor mismerge in r286574.

8 years agoMFV r277425:
Alexander Motin [Tue, 11 Aug 2015 10:39:19 +0000 (10:39 +0000)]
MFV r277425:
5376 arc_kmem_reap_now() should not result in clearing arc_no_grow
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Steven Hartland <killing@multiplay.co.uk>
Reviewed by: Richard Elling <richard.elling@richardelling.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@2ec99e3e987d8aa273f1e9ba2b983557d058198c

8 years agoStore addresses instead of sockaddrs inside llentry.
Alexander V. Chernikov [Tue, 11 Aug 2015 09:26:11 +0000 (09:26 +0000)]
Store addresses instead of sockaddrs inside llentry.
This permits us having all (not fully true yet) all the info
needed in lookup process in first 64 bytes of 'struct llentry'.

struct llentry layout:
BEFORE:
[rwlock .. state .. state .. MAC ] (lle+1) [sockaddr_in[6]]
AFTER
[ in[6]_addr MAC .. state .. rwlock ]

Currently, address part of struct llentry has only 16 bytes for the key.
However, lltable does not restrict any custom lltable consumers with long
keys use the previous approach (store key at (lle+1)).

Sponsored by: Yandex LLC

8 years agoRemove extra lock, that IMO only creates potential problems now.
Alexander Motin [Tue, 11 Aug 2015 09:18:51 +0000 (09:18 +0000)]
Remove extra lock, that IMO only creates potential problems now.

8 years agoAnother small typo.
Alexander Motin [Tue, 11 Aug 2015 09:00:27 +0000 (09:00 +0000)]
Another small typo.

MFC after: 3 days

8 years agoFix minor typo.
Alexander Motin [Tue, 11 Aug 2015 08:58:00 +0000 (08:58 +0000)]
Fix minor typo.

MFC after: 3 days

8 years agoDisable broken test until we have time ti actually fix the test
Baptiste Daroussin [Tue, 11 Aug 2015 08:57:04 +0000 (08:57 +0000)]
Disable broken test until we have time ti actually fix the test

8 years agoMake cap_rights_limit() work for CloudABI processes.
Ed Schouten [Tue, 11 Aug 2015 08:44:19 +0000 (08:44 +0000)]
Make cap_rights_limit() work for CloudABI processes.

Call into the recently introduced kern_cap_rights_limit() function to
restrict rights.

8 years agoIntroduce kern_cap_rights_limit().
Ed Schouten [Tue, 11 Aug 2015 08:43:50 +0000 (08:43 +0000)]
Introduce kern_cap_rights_limit().

The existing sys_cap_rights_limit() expects that a cap_rights_t object
lives in userspace. It is therefore hard to call into it from
kernelspace.

Move the interesting bits of sys_cap_rights_limit() into
kern_cap_rights_limit(), so that we can call into it from the CloudABI
compatibility layer.

Obtained from: https://github.com/NuxiNL/freebsd
Differential Revision: https://reviews.freebsd.org/D3314

8 years agoUse __DECONST instead of doing strdup/free.
Xin LI [Tue, 11 Aug 2015 05:58:33 +0000 (05:58 +0000)]
Use __DECONST instead of doing strdup/free.

Suggested by: ed
MFC after: 2 weeks

8 years agoMFP r276712.
Alexander V. Chernikov [Tue, 11 Aug 2015 05:51:00 +0000 (05:51 +0000)]
MFP r276712.

* Split lltable_init() into lltable_allocate_htbl() (alloc
  hash table with default callbacks) and lltable_link() (
  links any lltable to the list).
* Switch from LLTBL_HASHTBL_SIZE to per-lltable hash size field.
* Move lltable setup to separate functions in in[6]_domifattach.

8 years agoClean out some externally visible "more then" grammar
Pedro F. Giffuni [Tue, 11 Aug 2015 03:12:09 +0000 (03:12 +0000)]
Clean out some externally visible "more then" grammar

MFC after: 3 days

8 years agoxlint(1): Fix some typos in comments and translate some german
Pedro F. Giffuni [Tue, 11 Aug 2015 02:58:33 +0000 (02:58 +0000)]
xlint(1): Fix some typos in comments and translate some german

No functional change.

Obtained from: OpenBSD (where xlint is no more)

8 years agoStyle fix, no functional changes -- do the braces for switches correctly.
Ian Lepore [Tue, 11 Aug 2015 02:30:54 +0000 (02:30 +0000)]
Style fix, no functional changes -- do the braces for switches correctly.

8 years agostyle(9) requires a space here.
Marcelo Araujo [Tue, 11 Aug 2015 01:45:17 +0000 (01:45 +0000)]
style(9) requires a space here.

8 years agoSync the code with OpenBSD.
Marcelo Araujo [Tue, 11 Aug 2015 01:33:36 +0000 (01:33 +0000)]
Sync the code with OpenBSD.
Remove 3rd BSD clause.

Differential Revision: D3289
Approved by: bapt (mentor)
Obtained from: OpenBSD

8 years agoMore style(9) fixes. No functional changes.
Marcelo Araujo [Tue, 11 Aug 2015 01:02:17 +0000 (01:02 +0000)]
More style(9) fixes. No functional changes.

Differential Revision: D3350
Reviewed by: ed
Approved by: bapt (mentor)

8 years agosbin/ipfw fix typo: info -> into
Mark Felder [Mon, 10 Aug 2015 22:02:01 +0000 (22:02 +0000)]
sbin/ipfw fix typo: info -> into

example:

DEPRECATED: inserting data into non-existent table sshguard. (auto-created)

Approved by: bdrewery

8 years agoMFV 286604: 5812 assertion failed in zrl_tryenter(): zr_owner==NULL
Alexander Motin [Mon, 10 Aug 2015 21:36:51 +0000 (21:36 +0000)]
MFV 286604: 5812 assertion failed in zrl_tryenter(): zr_owner==NULL

Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@8df173054ca442cd8845a7364c3edad9d6822351

8 years agoMFV 286602: 5810 zdb should print details of bpobj
Alexander Motin [Mon, 10 Aug 2015 21:32:40 +0000 (21:32 +0000)]
MFV 286602: 5810 zdb should print details of bpobj

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Reviewed by: Simon Klinkert <simon.klinkert@gmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@732885fca09e11183dd0ea69aaaab5588fb7dbff

8 years agouse posix_spawn(3) instead of fork() and exec() manually as suggested
Xin LI [Mon, 10 Aug 2015 21:31:50 +0000 (21:31 +0000)]
use posix_spawn(3) instead of fork() and exec() manually as suggested
by jmg@.

Reviewed By: pfg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D3353

8 years agoMFV 286599: 5808 spa_check_logs is not necessary on readonly pools
Alexander Motin [Mon, 10 Aug 2015 21:19:42 +0000 (21:19 +0000)]
MFV 286599: 5808 spa_check_logs is not necessary on readonly pools

Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Simon Klinkert <simon.klinkert@gmail.com>
Reviewed by: Will Andrews <will@freebsd.org>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@23367a2f2caec1ccb4d918bdd0f2fc2c9cadcd06

8 years agoMFV 286597: 5701 zpool list reports incorrect "alloc" value for cache devices
Alexander Motin [Mon, 10 Aug 2015 21:13:59 +0000 (21:13 +0000)]
MFV 286597: 5701 zpool list reports incorrect "alloc" value for cache devices

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@a52fc310ba80fa3b2006110936198de7f828cd94

8 years agoDocument the change in polarity of the uart(4) PPS capture.
Ian Lepore [Mon, 10 Aug 2015 21:09:06 +0000 (21:09 +0000)]
Document the change in polarity of the uart(4) PPS capture.

8 years agoCorrect the polarity of the PPS assert and clear events with respect to the
Ian Lepore [Mon, 10 Aug 2015 20:54:03 +0000 (20:54 +0000)]
Correct the polarity of the PPS assert and clear events with respect to the
electrical signals on the serial port.  Virtually all devices which output a
PPS signal generate a brief higher-voltage pulse, the leading edge of which
is the on-time point.

Both DCD and CTS are active-low signals on the wire, meaning the assertion
of their status bits in the modem status register corresponds to the lower
voltage level on the wire.  So when the status bit transitions to not-set,
create a PPS assert event; when the status bit transitions to set, create a
PPS clear event.

8 years agoRename rt_foreach_fib() to rt_foreach_fib_walk().
Alexander V. Chernikov [Mon, 10 Aug 2015 20:50:31 +0000 (20:50 +0000)]
Rename rt_foreach_fib() to rt_foreach_fib_walk().

Suggested by: julian

8 years agoLocal addition and mismerge fix for r286579.
Alexander Motin [Mon, 10 Aug 2015 20:34:46 +0000 (20:34 +0000)]
Local addition and mismerge fix for r286579.

8 years agoUse consistent style for optional subdirectories
Ed Maste [Mon, 10 Aug 2015 20:19:10 +0000 (20:19 +0000)]
Use consistent style for optional subdirectories

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3356

8 years agoAllow the choice of PPS signal captured by uart(4) to be runtime-configured,
Ian Lepore [Mon, 10 Aug 2015 20:08:09 +0000 (20:08 +0000)]
Allow the choice of PPS signal captured by uart(4) to be runtime-configured,
eliminating the need to build a custom kernel to use the CTS signal.

The historical UART_PPS_ON_CTS kernel option is still honored, but now it
can be overridden at runtime using a tunable to configure all uart devices
(hw.uart.pps_mode) or specific devices (dev.uart.#.pps_mode).  The per-
device config is both a tunable and a writable sysctl.

This syncs the PPS capabilities of uart(4) with the enhancements recently
recently added to ucom(4) for capturing from USB serial devices.

Relnotes: yes

8 years agoRemove ${_subdir}s that are never set
Ed Maste [Mon, 10 Aug 2015 19:41:31 +0000 (19:41 +0000)]
Remove ${_subdir}s that are never set

The MK_NIS subdirs were leftovers from r212558 and kdump/truss were
introduced in r240404.

Sponsored by: The FreeBSD Foundation

8 years agoMFV 286588: 5820 verify failed in zio_done(): BP_EQUAL(bp, io_bp_orig)
Alexander Motin [Mon, 10 Aug 2015 19:38:07 +0000 (19:38 +0000)]
MFV 286588: 5820 verify failed in zio_done(): BP_EQUAL(bp, io_bp_orig)

Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Steven Hartland <killing@multiplay.co.uk>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Matthew Ahrens <mahrens@delphix.com>

illumod/illumos-gate@34e8acef009195effafdcf6417aec385e241796e

8 years agoMFV 286586: 5746 more checksumming in zfs send
Alexander Motin [Mon, 10 Aug 2015 19:32:58 +0000 (19:32 +0000)]
MFV 286586: 5746 more checksumming in zfs send

Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com>
Approved by: Albert Lee <trisk@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@98110f08fa182032082d98be2ddb9391fcd62bf1

8 years agoMake kstack_pages a tunable on arm, x86, and powepc. On i386, the
Konstantin Belousov [Mon, 10 Aug 2015 17:18:21 +0000 (17:18 +0000)]
Make kstack_pages a tunable on arm, x86, and powepc.  On i386, the
initial thread stack is not adjusted by the tunable, the stack is
allocated too early to get access to the kernel environment. See
TD0_KSTACK_PAGES for the thread0 stack sizing on i386.

The tunable was tested on x86 only.  From the visual inspection, it
seems that it might work on arm and powerpc.  The arm
USPACE_SVC_STACK_TOP and powerpc USPACE macros seems to be already
incorrect for the threads with non-default kstack size.  I only
changed the macros to use variable instead of constant, since I cannot
test.

On arm64, mips and sparc64, some static data structures are sized by
KSTACK_PAGES, so the tunable is disabled.

Sponsored by: The FreeBSD Foundation
MFC after: 2 week

8 years agoAvoid sign extension of value passed to kva_alloc from uma_zone_reserve_kva
Zbigniew Bodek [Mon, 10 Aug 2015 17:16:49 +0000 (17:16 +0000)]
Avoid sign extension of value passed to kva_alloc from uma_zone_reserve_kva

Fixes "panic: vm_radix_reserve_kva: unable to reserve KVA" caused by sign
extention of "pages * UMA_SLAB_SIZE" value passed to kva_alloc() which
takes unsigned long argument.

In the erroneus case that triggered this bug, the number of pages
to allocate in uma_zone_reserve_kva() was 0x8ebe6, that gave the
total number of bytes to allocate equal to 0x8ebe6000 (int).
This was then sign extended in kva_alloc() to 0xffffffff8ebe6000
(unsigned long).

Reviewed by:   alc, kib
Submitted by:  Zbigniew Bodek <zbb@semihalf.com>
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3346

8 years agoPre-resolve symbols required for the deferred signal processing. This
Konstantin Belousov [Mon, 10 Aug 2015 17:02:42 +0000 (17:02 +0000)]
Pre-resolve symbols required for the deferred signal processing.  This
avoids recursion into rtld when leaving libthr critical section for
the deferred signal delivery.

For the same reason, use syscall(2) instead of referencing
__sys_sigreturn(2).  Syscall() is already pre-resolved for fork()
interceptor.

Tested by: Andre Meiser <ortadur@web.de>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoFix a comment for iwm.
Rui Paulo [Mon, 10 Aug 2015 16:32:47 +0000 (16:32 +0000)]
Fix a comment for iwm.

Submitted by: brueffer

8 years agofiles.amd64: Build ntb_hw.o if if_ntb OR ntb_hw
Conrad Meyer [Mon, 10 Aug 2015 14:03:39 +0000 (14:03 +0000)]
files.amd64: Build ntb_hw.o if if_ntb OR ntb_hw

Approved by: markj (mentor)
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D3349

8 years agoMFV r277430: 5313 Allow I/Os to be aggregated across ZIO priority classes
Alexander Motin [Mon, 10 Aug 2015 12:39:10 +0000 (12:39 +0000)]
MFV r277430: 5313 Allow I/Os to be aggregated across ZIO priority classes
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Will Andrews <willa@SpectraLogic.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Justin T. Gibbs <justing@spectralogic.com>

illumos/illumos-gate@fe319232d24f4ae183730a5a24a09423d8ab4429

8 years agoFix r286574 build in user-space.
Alexander Motin [Mon, 10 Aug 2015 12:25:26 +0000 (12:25 +0000)]
Fix r286574 build in user-space.

8 years agoPartially merge r274887,r275334,r275577,r275578,r275586 to minimize
Alexander V. Chernikov [Mon, 10 Aug 2015 12:03:59 +0000 (12:03 +0000)]
Partially merge r274887,r275334,r275577,r275578,r275586 to minimize
differences between projects/routing and HEAD.

This commit tries to keep code logic the same while changing underlying
code to use unified callbacks.

* Add llt_foreach_entry method to traverse all entries in given llt
* Add llt_dump_entry method to export particular lle entry in sysctl/rtsock
  format (code is not indented properly to minimize diff). Will be fixed
  in the next commits.
* Add llt_link_entry/llt_unlink_entry methods to link/unlink particular lle.
* Add llt_fill_sa_entry method to export address in the lle to sockaddr
  format.
* Add llt_hash method to use in generic hash table support code.
* Add llt_free_entry method which is used in llt_prefix_free code.

* Prepare for fine-grained locking by separating lle unlink and deletion in
  lltable_free() and lltable_prefix_free().

* Provide lltable_get<ifp|af>() functions to reduce direct 'struct lltable'
 access by external callers.

* Remove @llt agrument from lle_free() lle callback since it was unused.
* Temporarily add L3_CADDR() macro for 'const' sockaddr typecasting.
* Switch to per-af hashing code.
* Rename LLE_FREE_LOCKED() callback from in[6]_lltable_free() to
  in_[6]lltable_destroy() to avoid clashing with llt_free_entry() method.
  Update description from these functions.
* Use unified lltable_free_entry() function instead of per-af one.

Reviewed by: ae

8 years agoFix r286570 build with debug.
Alexander Motin [Mon, 10 Aug 2015 11:52:54 +0000 (11:52 +0000)]
Fix r286570 build with debug.

8 years agoMFV r277428: 5056 ZFS deadlock on db_mtx and dn_holds
Alexander Motin [Mon, 10 Aug 2015 11:30:07 +0000 (11:30 +0000)]
MFV r277428: 5056 ZFS deadlock on db_mtx and dn_holds

Reviewed by: Will Andrews <willa@spectralogic.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Justin Gibbs <justing@spectralogic.com>

illumos/illumos-gate@bc9014e6a81272073b9854d9f65dd59e18d18c35

8 years agoMFV r277427: 5445 Add more visibility via arcstats; specifically
Alexander Motin [Mon, 10 Aug 2015 10:59:58 +0000 (10:59 +0000)]
MFV r277427: 5445 Add more visibility via arcstats; specifically
arc_state_t stats and differentiate between "data" and "metadata"

Reviewed by: Basil Crow <basil.crow@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Bayard Bell <bayard.bell@nexenta.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@4076b1bf41cfd9f968a33ed54a7ae76d9e996fe8

8 years agoXref iwm(4).
Christian Brueffer [Mon, 10 Aug 2015 10:54:35 +0000 (10:54 +0000)]
Xref iwm(4).

8 years agoAdd iwm(4) to the hardware notes.
Christian Brueffer [Mon, 10 Aug 2015 10:41:40 +0000 (10:41 +0000)]
Add iwm(4) to the hardware notes.

8 years agoHook up iwm.4 and iwmfw.4 to the build.
Christian Brueffer [Mon, 10 Aug 2015 10:36:08 +0000 (10:36 +0000)]
Hook up iwm.4 and iwmfw.4 to the build.

8 years agoMFV r277426: 5408 managing ZFS cache devices requires lots of RAM
Alexander Motin [Mon, 10 Aug 2015 10:34:23 +0000 (10:34 +0000)]
MFV r277426: 5408 managing ZFS cache devices requires lots of RAM
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Don Brady <dev.fs.zfs@gmail.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Chris Williamson <Chris.Williamson@delphix.com>

illumos/illumos-gate@89c86e32293a30cdd7af530c38b2073fee01411c

Currently, every buffer cached in the L2ARC is accompanied by a 240-byte
header in memory, leading to very high memory consumption when using very
large cache devices. These changes significantly reduce this overhead.

Currently:

L1-only header = 176 bytes
L1 + L2 or L2-only header = 176 bytes + 32 byte checksum + 32 byte l2hdr
    = 240 bytes

Memory-optimized:

L1-only header = 176 bytes
L1 + L2 header = 176 bytes + 32 byte checksum = 208 bytes
L2-only header = 96 bytes + 32 byte checksum = 128 bytes

So overall:

          Trunk  Optimized
        +-----------------+
L1-only | 176 B  | 176 B  | (same)
        +-----------------+
L1 & L2 | 240 B  | 208 B  | (saved 32 bytes)
        +-----------------+
L2-only | 240 B  | 128 B  | (saved 116 bytes)
        +-----------------+

For an average blocksize of 8KB, this means that for the L2ARC, the ratio
of metadata to data has gone down from about 2.92% to 1.56%.  For a
'storage optimized' EC2 instance with 1600GB of SSD and 60GB of RAM, this
means that we expect a completely full L2ARC to use (1600 GB * 0.0156) /
60GB = 41% of the available memory, down from 78%.

8 years agoRather than hardcoding a string and limiting the comparison to these
Bjoern A. Zeeb [Mon, 10 Aug 2015 10:29:32 +0000 (10:29 +0000)]
Rather than hardcoding a string and limiting the comparison to these
characters use the defined constant so that in case of change this
would not break.

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D3340
MFC after: 2 weeks

8 years agoRemove mps_request_polled(), it's redundant to mps_wait_command()
Scott Long [Mon, 10 Aug 2015 09:02:34 +0000 (09:02 +0000)]
Remove mps_request_polled(), it's redundant to mps_wait_command()

Obtained from: Netflix, Inc.

8 years agoRemove some unused code.
Scott Long [Mon, 10 Aug 2015 08:57:34 +0000 (08:57 +0000)]
Remove some unused code.

Obtained from: Netflix, Inx.

8 years agoRemove bad call to shutdown().
Ed Schouten [Mon, 10 Aug 2015 07:45:13 +0000 (07:45 +0000)]
Remove bad call to shutdown().

The socket created by rtsol/rtsold is not a connection-based socket,
meaning that we should not attempt to call shutdown() on it.

Reported by: kan

8 years agoFinish reverting r286410 for now.
Adrian Chadd [Mon, 10 Aug 2015 06:12:53 +0000 (06:12 +0000)]
Finish reverting r286410 for now.

8 years agoCommit more of the reversion of r286410 . Sorry.
Adrian Chadd [Mon, 10 Aug 2015 06:12:24 +0000 (06:12 +0000)]
Commit more of the reversion of r286410 . Sorry.

8 years agoFinish reverting r286410 - sorry, I somehow missed this with svn commit.
Adrian Chadd [Mon, 10 Aug 2015 06:11:10 +0000 (06:11 +0000)]
Finish reverting r286410 - sorry, I somehow missed this with svn commit.

8 years agoAdd a #ifndef around the HAVE_ICONV settings since it is supplied
Peter Wemm [Mon, 10 Aug 2015 00:53:45 +0000 (00:53 +0000)]
Add a #ifndef around the HAVE_ICONV settings since it is supplied
by the Makefile.

8 years agoDon't assume iconv is enabled. I didn't realize there was a configuration
Peter Wemm [Mon, 10 Aug 2015 00:46:24 +0000 (00:46 +0000)]
Don't assume iconv is enabled.  I didn't realize there was a configuration
control to turn it off and it wasn't being respected.

Pointed out by: gshapiro