]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoFix a typo in comment.
delphij [Fri, 24 Jul 2015 22:13:39 +0000 (22:13 +0000)]
Fix a typo in comment.

Submitted by: Yanhui Shen via twitter
MFC after: 3 days

8 years agoAuto-generate hardware notes for pms(4).
brueffer [Fri, 24 Jul 2015 21:55:16 +0000 (21:55 +0000)]
Auto-generate hardware notes for pms(4).

MFC after: 1 week
Committed from: Essen FreeBSD Hackathon

8 years agoAdd a basic manpage for the pms driver.
brueffer [Fri, 24 Jul 2015 21:48:53 +0000 (21:48 +0000)]
Add a basic manpage for the pms driver.

MFC after: 1 week
Committed from: Essen FreeBSD Hackathon

8 years agoCast uid and gid to the correct type for display to solve segfault in ls(1) on 32bit...
allanjude [Fri, 24 Jul 2015 20:20:59 +0000 (20:20 +0000)]
Cast uid and gid to the correct type for display to solve segfault in ls(1) on 32bit arches

Correctly escape literal % for display

This fixes segfaults in 32bit arches caused by r285734

Reviewed by: ngie
Approved by: dim
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3191

8 years agoAdd a comment discussing the appropriate use of the atomic_*() functions
alc [Fri, 24 Jul 2015 19:43:18 +0000 (19:43 +0000)]
Add a comment discussing the appropriate use of the atomic_*() functions
with acquire and release semantics versus the *mb() functions on amd64
processors.

Reviewed by: bde (an earlier version), kib
Sponsored by: EMC / Isilon Storage Division

8 years agoAdd missing SIGUSR1 description.
trasz [Fri, 24 Jul 2015 18:14:57 +0000 (18:14 +0000)]
Add missing SIGUSR1 description.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

8 years agoAdd missing capitalization.
trasz [Fri, 24 Jul 2015 18:13:13 +0000 (18:13 +0000)]
Add missing capitalization.

8 years agoreadelf: avoid division by zero on section entry size
emaste [Fri, 24 Jul 2015 18:00:53 +0000 (18:00 +0000)]
readelf: avoid division by zero on section entry size

ELF Tool Chain tickets #439, #444, #445, #467
Reported by: Alexander Cherepanov <cherepan@mccme.ru> (#467)
Reported by: antiAgainst (others)

Reviewed by: brooks
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2338

8 years agoar: add -U (unique) option to disable -D (deterministic) mode
emaste [Fri, 24 Jul 2015 17:46:43 +0000 (17:46 +0000)]
ar: add -U (unique) option to disable -D (deterministic) mode

This is required in order for us to support deterministic mode by
default.  If multiple -D or -U options are specified on the command
line, the final one takes precedence.  GNU ar also uses -U for this.

An equivalent change will be applied to ELF Tool Chain's version of ar.

PR: 196929
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3175

8 years ago- Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signaling
marius [Fri, 24 Jul 2015 17:01:16 +0000 (17:01 +0000)]
- Since r253161, uart_intr() abuses FILTER_SCHEDULE_THREAD for signaling
  uart_bus_attach() during its test that 20 iterations weren't sufficient
  for clearing all pending interrupts, assuming this means that hardware
  is broken and doesn't deassert interrupts. However, under pressure, 20
  iterations also can be insufficient for clearing all pending interrupts,
  leading to a panic as intr_event_handle() tries to schedule an interrupt
  handler not registered. Solve this by introducing a flag that is set in
  test mode and otherwise restores pre-r253161 behavior of uart_intr(). The
  approach of additionally registering uart_intr() as handler as suggested
  in PR 194979 is not taken as that in turn would abuse special pccard and
  pccbb handling code of intr_event_handle(). [1]
- Const'ify uart_driver_name.
- Fix some minor style bugs.

PR: 194979 [1]
Reviewed by: marcel (earlier version)
MFC after: 3 days

8 years agotruss: follow pdfork()ed descendents with -f
emaste [Fri, 24 Jul 2015 16:57:13 +0000 (16:57 +0000)]
truss: follow pdfork()ed descendents with -f

PR: 201276
Reported by: David Drysdale
Reviewed by: oshogbo
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D2976

8 years agoAdd RISC-V ELF machine type definition
emaste [Fri, 24 Jul 2015 16:52:21 +0000 (16:52 +0000)]
Add RISC-V ELF machine type definition

EM_RISCV is now officially registered as e_machine 243.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years ago- In mpt_send_handshake_cmd(), use bus_space_write_stream_4(9) for writing
marius [Fri, 24 Jul 2015 16:00:35 +0000 (16:00 +0000)]
- In mpt_send_handshake_cmd(), use bus_space_write_stream_4(9) for writing
  raw data to the doorbell offset in order to clarify the intent and for
  avoiding unnecessarily converting the endianess back and forth.
  Unfortunately, the same can't be done in mpt_recv_handshake_reply() as
  16-bit data needs to be read using 32-bit bus accessors.
- In mpt_recv_handshake_reply(), get rid of a redundant variable.

MFC after: 1 fortnight

8 years agoo Revert the other functional half of r239864, i. e. the merge of r134227
marius [Fri, 24 Jul 2015 15:13:21 +0000 (15:13 +0000)]
o Revert the other functional half of r239864, i. e. the merge of r134227
  from x86 to use smp_ipi_mtx spin lock not only for smp_rendezvous_cpus()
  but also for the MD cache invalidation, TLB demapping and remote register
  reading IPIs due to the following reasons:
  - The cross-IPI SMP deadlock x86 otherwise is subject to can't happen on
    sparc64. That's because on sparc64, spin locks don't disable interrupts
    completely but only raise the processor interrupt level to PIL_TICK. This
    means that IPIs still get delivered and direct dispatch IPIs such as the
    cache invalidation etc. IPIs in question are still executed.
  - In smp_rendezvous_cpus(), smp_ipi_mtx is held not only while sending an
    IPI_RENDEZVOUS, but until all CPUs have processed smp_rendezvous_action().
    Consequently, smp_ipi_mtx may be locked for an extended amount of time as
    queued IPIs (as opposed to the direct ones) such as IPI_RENDEZVOUS are
    scheduled via a soft interrupt. Moreover, given that this soft interrupt
    is only delivered at PIL_RENDEZVOUS, processing of smp_rendezvous_action()
    on a target may be interrupted by f. e. a tick interrupt at PIL_TICK, in
    turn leading to the target in question trying to send an IPI by itself
    while IPI_RENDEZVOUS isn't fully handled, yet, and, thus, resulting in a
    deadlock.
o As mentioned in the commit message of r245850, on least some sun4u platforms
  concurrent sending of IPIs by different CPUs is fatal. Therefore, hold the
  reintroduced MD ipi_mtx also while delivering cross-traps via MI helpers,
  i. e. ipi_{all_but_self,cpu,selected}().
o Akin to x86, let the last CPU to process cpu_mp_bootstrap() set smp_started
  instead of the BSP in cpu_mp_unleash(). This ensures that all APs actually
  are started, when smp_started is no longer 0.
o In all MD and MI IPI helpers, check for smp_started == 1 rather than for
  smp_cpus > 1 or nothing at all. This avoids races during boot causing IPIs
  trying to be delivered to APs that in fact aren't up and running, yet.
  While at it, move setting of the cpu_ipi_{selected,single}() pointers to
  the appropriate delivery functions from mp_init() to cpu_mp_start() where
  it's better suited and allows to get rid of the global isjbus variable.
o Given that now concurrent IPI delivery no longer is possible, also nuke
  the delays before completely disabling interrupts again in the CPU-specific
  cross-trap delivery functions, previously giving other CPUs a window for
  sending IPIs on their part. Actually, we now should be able to entirely get
  rid of completely disabling interrupts in these functions. Such a change
  needs more testing, though.
o In {s,}tick_get_timecount_mp(), make the {s,}tick variable static. While not
  necessary for correctness, this avoids page faults when accessing the stack
  of a foreign CPU as {s,}tick now is locked into the TLBs as part of static
  kernel data. Hence, {s,}tick_get_timecount_mp() always execute as fast as
  possible, avoiding jitter.

PR: 201245
MFC after: 3 days

8 years agoFix silly syntax error emacs chugged in for me.. gesh.
rrs [Fri, 24 Jul 2015 14:13:43 +0000 (14:13 +0000)]
Fix silly syntax error emacs chugged in for me.. gesh.

MFC after: 3 weeks

8 years agoFix an issue with MAC OS locking and also optimize the case
rrs [Fri, 24 Jul 2015 14:09:03 +0000 (14:09 +0000)]
Fix an issue with MAC OS locking and also optimize the case
where we are sending back a stream-reset and a sack timer is running, in
that case we should just send the SACK.

MFC after: 3 weeks

8 years agoinode should be different to actually mean mandocdb is in used
bapt [Fri, 24 Jul 2015 09:20:02 +0000 (09:20 +0000)]
inode should be different to actually mean mandocdb is in used

Sponsored by: gandi.net

8 years agoFix man -k with mandocdb
bapt [Fri, 24 Jul 2015 09:10:03 +0000 (09:10 +0000)]
Fix man -k with mandocdb

If apropos(1) and whatis(1) are not hardlinks to man(1) that means the system is
using mandocdb, then man -k should spawn apropos(1) and/or whatis(1) directly

Reported by: kevlo
Tested by: kevlo
Sponsored by: gandi.net

8 years agoImplement the basic system calls that operate on pathnames.
ed [Fri, 24 Jul 2015 07:46:02 +0000 (07:46 +0000)]
Implement the basic system calls that operate on pathnames.

Summary:
Unlike FreeBSD, CloudABI does not use null terminated strings for its
pathnames. Introduce a function called copyin_path() that can be used by
all of the filesystem system calls that use pathnames. This change
already implements the system calls that don't depend on any additional
functionality (e.g., conversion of struct stat).

Also implement the socket system calls that operate on pathnames, namely
the ones used by the C library functions bindat() and connectat(). These
don't receive a 'struct sockaddr_un', but just the pathname, meaning
they could be implemented in such a way that they don't depend on the
size of sun_path. For now, just use the existing interfaces.

Add a missing #include to cloudabi_syscalldefs.h to get this code to
build, as one of its macros depends on UINT64_C().

Test Plan:
These implementations have already been tested in the CloudABI branch on
GitHub. They pass all of the tests.

Reviewers: kib, pjd

Subscribers: imp

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

8 years agoPanic when a device is trying to recursively acquire rather than hang
imp [Fri, 24 Jul 2015 04:56:46 +0000 (04:56 +0000)]
Panic when a device is trying to recursively acquire rather than hang
indefinitely. Improve error messages from other panics.

8 years agoCall ksem_get() with initialized 'rights'.
pluknet [Thu, 23 Jul 2015 23:18:03 +0000 (23:18 +0000)]
Call ksem_get() with initialized 'rights'.

ksem_get() consumes fget(), and it's mandatory there.

Reported by: truckman
Reviewed by: mjg

8 years agoRefactor unmapped buffer address handling.
jeff [Thu, 23 Jul 2015 19:13:41 +0000 (19:13 +0000)]
Refactor unmapped buffer address handling.
 - Use pointer assignment rather than a combination of pointers and
   flags to switch buffers between unmapped and mapped.  This eliminates
   multiple flags and generally simplifies the logic.
 - Eliminate b_saveaddr since it is only used with pager bufs which have
   their b_data re-initialized on each allocation.
 - Gather up some convenience routines in the buffer cache for
   manipulating buf space and buf malloc space.
 - Add an inline, buf_mapped(), to standardize checks around unmapped
   buffers.

In collaboration with: mlaier
Reviewed by: kib
Tested by: pho (many small revisions ago)
Sponsored by: EMC / Isilon Storage Division

8 years agoRefine the PAE_TABLES entry based on feedback from kib
gjb [Thu, 23 Jul 2015 18:11:52 +0000 (18:11 +0000)]
Refine the PAE_TABLES entry based on feedback from kib
and jhb.

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

8 years agoDocument the fact that tunables can be set in device.hints.
brooks [Thu, 23 Jul 2015 17:27:10 +0000 (17:27 +0000)]
Document the fact that tunables can be set in device.hints.

Reviewed by: wblock
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D3153

8 years agonvme: ensure csts.rdy bit is cleared before returning from nvme_ctrlr_disable
jimharris [Thu, 23 Jul 2015 15:50:39 +0000 (15:50 +0000)]
nvme: ensure csts.rdy bit is cleared before returning from nvme_ctrlr_disable

PR: 200458
MFC after: 3 days
Sponsored by: Intel

8 years agonvme: properly handle case where pci_alloc_msix does not alloc all vectors
jimharris [Thu, 23 Jul 2015 15:35:08 +0000 (15:35 +0000)]
nvme: properly handle case where pci_alloc_msix does not alloc all vectors

Reported by: Sean Kelly <smkelly@smkelly.org>
MFC after: 3 days
Sponsored by: Intel

8 years agoAllow us to create UNIX sockets and socketpairs in CloudABI processes.
ed [Thu, 23 Jul 2015 13:52:53 +0000 (13:52 +0000)]
Allow us to create UNIX sockets and socketpairs in CloudABI processes.

8 years agoAllow cap_rights_{set,clear,is_set} to be called with no arguments.
ed [Thu, 23 Jul 2015 11:11:01 +0000 (11:11 +0000)]
Allow cap_rights_{set,clear,is_set} to be called with no arguments.

In the CloudABI code I sometimes call into cap_rights_* without
providing any arguments. Though one could argue that this doesn't make
sense, in this specific case it's hard to avoid, as the rights that
should be tested against are forwarded by a couple of wrapper macros.

8 years ago - Don't defeat the FIFO nature of the buffer cache by eliminating the
jeff [Thu, 23 Jul 2015 02:20:41 +0000 (02:20 +0000)]
 - Don't defeat the FIFO nature of the buffer cache by eliminating the
   most recently used buffer when we are under paging pressure.  This is
   a perversion of the buffer and page replacement algorithms and recent
   improvements to the page daemon have rendered it unnecessary.  In the
   event that low-memory deadlocks become an issue it would be possible
   to make a daemon or event handler that performs a similar action on
   the oldest buffers rather than the newest.  Since the buf cache
   is analogous to the page cache and some minimum working set is desired
   another possibility is to simply shrink the minimum working set which
   has less downside now that file pages are not directly mapped.

Sponsored by: EMC / Isilon
Reviewed by: alc, kib (with some minor objection)
Tested by: pho

8 years agovt: cpu logos: Correct reversed 0/1 beastie descriptions
cem [Wed, 22 Jul 2015 23:30:54 +0000 (23:30 +0000)]
vt: cpu logos: Correct reversed 0/1 beastie descriptions

Differential Revision: https://reviews.freebsd.org/D3158
Approved by: markj (mentor)
Obtained from: Pavel Timofeev
MFC after: 1 week

8 years agovt: Change default CPU logo to Orb
cem [Wed, 22 Jul 2015 23:23:12 +0000 (23:23 +0000)]
vt: Change default CPU logo to Orb

Differential Revision: https://reviews.freebsd.org/D3156
Approved by: markj (mentor)
MFC after: 1 week

8 years agovt: Default to cpu logos off
cem [Wed, 22 Jul 2015 23:19:53 +0000 (23:19 +0000)]
vt: Default to cpu logos off

Apologies, this was how it was supposed to land. Mea culpa.

Differential Revision: https://reviews.freebsd.org/D3157
Reviewed by: gnn, hiren
Approved by: markj (mentor)
MFC after: 1 week

8 years agomount_nfs: Be more clear on nmount(2) error with errmsg unset
cem [Wed, 22 Jul 2015 22:53:40 +0000 (22:53 +0000)]
mount_nfs: Be more clear on nmount(2) error with errmsg unset

Differential Revision: https://reviews.freebsd.org/D3147
Reviewed by: rmacklem
Approved by: markj (mentor)
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove an excess space accidently introduced in the output in ls(1) by r285734
allanjude [Wed, 22 Jul 2015 19:58:21 +0000 (19:58 +0000)]
Remove an excess space accidently introduced in the output in ls(1) by r285734

Spotted by: dim
Approved by: eadler (mentor)
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3152

8 years agovt_core.c: Use do/while to highlight missed semi-colon errors
cem [Wed, 22 Jul 2015 18:50:47 +0000 (18:50 +0000)]
vt_core.c: Use do/while to highlight missed semi-colon errors

Also, fix some nearby #define whitespace while here.

(Style cleanup for r285794.)

Suggested by: jmg

Differential Revision: https://reviews.freebsd.org/D3154
Approved by: markj (mentor)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

8 years agoCatch up with ACPICA 20150717.
jkim [Wed, 22 Jul 2015 16:26:17 +0000 (16:26 +0000)]
Catch up with ACPICA 20150717.

8 years agosfxge: added fallbacks for pre 4.2.1 firmware support
arybchik [Wed, 22 Jul 2015 16:25:18 +0000 (16:25 +0000)]
sfxge: added fallbacks for pre 4.2.1 firmware support

Driver must be able to start against older firmware that is missing
recently added MCDI calls, otherwise firmware upgrade will not be
possible.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
MFC after:      2 days
Differential Revision: https://reviews.freebsd.org/D3145

8 years agoMerge ACPICA 20150717.
jkim [Wed, 22 Jul 2015 16:25:07 +0000 (16:25 +0000)]
Merge ACPICA 20150717.

8 years agonvmecontrol: read controller identify data before any log page operations
jimharris [Wed, 22 Jul 2015 16:10:29 +0000 (16:10 +0000)]
nvmecontrol: read controller identify data before any log page operations

MFC after: 3 days
Sponsored by: Intel

8 years agovt: Unbreak build on no-splash configurations
cem [Wed, 22 Jul 2015 15:30:10 +0000 (15:30 +0000)]
vt: Unbreak build on no-splash configurations

PR: 201751
Differential Revision: https://reviews.freebsd.org/D3151
Tested by: Andrey Fesenko
Approved by: markj (mentor)
MFC after: 1 week

8 years agoFix several problems with Stream Reset.
rrs [Wed, 22 Jul 2015 11:30:37 +0000 (11:30 +0000)]
Fix several problems with Stream Reset.
 1) We were not handling (or sending) the IN_PROGRESS case if
    the other side (or our side) was not able to reset (awaiting more data).
 2) We would improperly send a stream-reset when we should not. Not
    waiting until the TSN had been assigned when data was inqueue.

Reviewed by: tuexen

8 years agoRegenerate system call table.
ed [Wed, 22 Jul 2015 10:05:46 +0000 (10:05 +0000)]
Regenerate system call table.

8 years agoImport upstream changes to the system call definitions.
ed [Wed, 22 Jul 2015 10:04:53 +0000 (10:04 +0000)]
Import upstream changes to the system call definitions.

Support has been added for providing the scope of a futex operation,
whether the futex is local to the process or shared between processes.

8 years agoIntroduce support for MSI-X interrupts in AHCI
zbb [Wed, 22 Jul 2015 09:46:22 +0000 (09:46 +0000)]
Introduce support for MSI-X interrupts in AHCI

- Allocate resources for MSI-X table and PBA if necessary
- Add function ahci_free_mem() to free all resources

Reviewed by:   jhb, mav
Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3009

8 years agoFix inverted logic bug that David Wolfskill found (thanks David!)
rrs [Wed, 22 Jul 2015 09:29:50 +0000 (09:29 +0000)]
Fix inverted logic bug that David Wolfskill found (thanks David!)

MFC after: 3 Weeks

8 years agoRemove duplicate and useless declarations.
kib [Wed, 22 Jul 2015 09:12:40 +0000 (09:12 +0000)]
Remove duplicate and useless declarations.

Submitted by: bde

8 years agoAdd Makefiles for CloudABI kernel modules.
ed [Wed, 22 Jul 2015 07:32:49 +0000 (07:32 +0000)]
Add Makefiles for CloudABI kernel modules.

Place all of the machine/pointer size independent code in a kernel
module called 'cloudabi'. All of the 64-bit specific code goes in a
separate module called 'cloudabi64'. The latter is only enabled on
amd64, as it is the only architecture supported.

8 years agoDo not enable UDP checksum offloading when running on the Hyper-V on
whu [Wed, 22 Jul 2015 05:05:01 +0000 (05:05 +0000)]
Do not enable UDP checksum offloading when running on the Hyper-V on
Windows Server 2012 and earlier hosts.

Submitted by: whu
Reviewed by: royger
Approved by: royger
MFC after: 3 days
Relnotes: No
Sponsored by: Microsoft OSTC
Differential Revision:  https://reviews.freebsd.org/D3086

8 years agoCosmetic change. When printing the child's mapped pins, use the plural
loos [Wed, 22 Jul 2015 04:18:33 +0000 (04:18 +0000)]
Cosmetic change.  When printing the child's mapped pins, use the plural
only when necessary.

Reported by: Daniel O'Connor <darius@dons.net.au>,
Sulev-Madis Silber (ketas)

8 years agoVarious changes to the registers displayed in DDB for x86.
jhb [Wed, 22 Jul 2015 01:09:02 +0000 (01:09 +0000)]
Various changes to the registers displayed in DDB for x86.
- Fix segment registers to only display the low 16 bits.
- Remove unused handlers and entries for the debug registers.
- Display xcr0 (if valid) in 'show sysregs'.
- Add '0x' prefix to MSR values to match other values in 'show sysregs'.
- MFamd64: Display various MSRs in 'show sysregs'.
- Add a 'show dbregs' to display the value of debug registers.
- Dynamically size the column width for register values to properly
  align columns on 64-bit platforms.
- Display %gs for i386 in 'show registers'.

Differential Revision: https://reviews.freebsd.org/D2784
Reviewed by: kib, markj
MFC after: 2 weeks

8 years agoFix counter reads on platforms where sizeof(uint64_t) != sizeof(uint64_t *).
markj [Tue, 21 Jul 2015 23:57:38 +0000 (23:57 +0000)]
Fix counter reads on platforms where sizeof(uint64_t) != sizeof(uint64_t *).

In the kernel, structs such as tcpstat are manipulated as an array of
counter_u64_t (uint64_t *), but made visible to userland as an array of
uint64_t. kread_counters() was previously copying the counter array into
user space and sequentially overwriting each counter with its value. This
mostly affects IPsec counters, as other counters are exported via sysctl.

PR: 201700
Tested by: Jason Unovitch
MFC after: 1 week

8 years agoRemove checks for a NULL return value from M_WAITOK allocations.
markj [Tue, 21 Jul 2015 23:44:36 +0000 (23:44 +0000)]
Remove checks for a NULL return value from M_WAITOK allocations.

8 years agoFix resource exhaustion due to sessions stuck in LAST_ACK state.
delphij [Tue, 21 Jul 2015 23:42:15 +0000 (23:42 +0000)]
Fix resource exhaustion due to sessions stuck in LAST_ACK state.

Submitted by: Jonathan Looney (Juniper SIRT)
Reviewed by: lstewart
Security: CVE-2015-5358
Security: SA-15:13.tcp

8 years agoLet the unwinder handle faults during function prologues or epilogues.
markj [Tue, 21 Jul 2015 23:22:23 +0000 (23:22 +0000)]
Let the unwinder handle faults during function prologues or epilogues.

The i386 and amd64 DDB stack unwinders contain code to detect and handle
the case where the first frame is not completely set up or torn down. This
code was accidentally unused however, since db_backtrace() was never called
with a non-NULL trap frame. This change fixes that.

Also remove get_rsp() from the amd64 code. It appears to have come from
i386, which needs to take into account whether the exception triggered a
CPL switch, since SS:ESP is only pushed onto the stack if so. On amd64,
SS:RSP is pushed regardless, so get_rsp() was doing the wrong thing for
kernel-mode exceptions. As a result, we can also remove custom print
functions for these registers.

Reviewed by: jhb
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D2881

8 years agoImprove stack unwinding on i386 and amd64 after an IP fault.
markj [Tue, 21 Jul 2015 23:13:11 +0000 (23:13 +0000)]
Improve stack unwinding on i386 and amd64 after an IP fault.

If we can't find a symbol corresponding to the faulting instruction, assume
that the previously-executed function is a call and attempt to find the
calling function using the return address on the stack. Otherwise we end
up associating the last stack frame with the current call, which is
incorrect and causes the unwinder to skip printing of the calling function,
resulting in a confusing backtrace.

Reviewed by: jhb
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D2859

8 years agoDon't return undefined symbols to a DDB symbol lookup.
markj [Tue, 21 Jul 2015 23:07:55 +0000 (23:07 +0000)]
Don't return undefined symbols to a DDB symbol lookup.

Undefined symbols have a value of zero, so it makes no sense to return
such a symbol when performing a lookup by value. This occurs for example
when unwinding the stack after calling a NULL function pointer, and we
confusingly report the faulting function as uart_sab82532_class() on
amd64.

Convert db_print_loc_and_inst() to only attempt disassembly if we managed
to find a symbol corresponding to the IP. Otherwise we may fault and
re-enter the debugger.

Reviewed by: jhb
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D2858

8 years agoRemove some dead code from DDB's amd64 stack unwinder.
markj [Tue, 21 Jul 2015 23:03:21 +0000 (23:03 +0000)]
Remove some dead code from DDB's amd64 stack unwinder.

The amd64 port copied some code from i386 to fetch function arguments and
display them in backtraces. However, it was commented out and can't easily
be implemented since the function arguments are passed in
registers rather than on the stack in amd64. Remove it in preparation for
some bug fixes in this area.

Reviewed by: jhb
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D2857

8 years agopatch(1): Add -Vnone option to disable backup files
cem [Tue, 21 Jul 2015 22:57:27 +0000 (22:57 +0000)]
patch(1): Add -Vnone option to disable backup files

Differential Revision: https://reviews.freebsd.org/D3146
Reviewed by: pfg
Approved by: markj (mentor)
MFC after: 1 week
Relnotes: yes
Sponsored by: EMC / Isilon Storage Division

8 years agoThe smp_rendezvous_cpus() function should ensure that all accesses
kib [Tue, 21 Jul 2015 22:56:46 +0000 (22:56 +0000)]
The smp_rendezvous_cpus() function should ensure that all accesses
done by the functions called on other CPUs, are visible to the caller.
Pair otherwise useless acquire on smp_rv_waiters[3] with a release add
to ensure synchronized with relation, which guarantees visibility.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

8 years agoIPSEC, remove variable argument function its already due.
eri [Tue, 21 Jul 2015 21:46:24 +0000 (21:46 +0000)]
IPSEC, remove variable argument function its already due.

Differential Revision: https://reviews.freebsd.org/D3080
Reviewed by: gnn, ae
Approved by: gnn(mentor)

8 years agoFix for a customer issue with ixl(4):
erj [Tue, 21 Jul 2015 21:07:18 +0000 (21:07 +0000)]
Fix for a customer issue with ixl(4):

- Add required MAC/VLAN filter when adding an LAA
- Fix bug where code did not check for I40E_SUCCESS from a successful
  i40e_validate_mac_address() call in ixl_init_locked(), when setting
  an LAA.

PR: 201240
Differential Revision: https://reviews.freebsd.org/D3111
Submitted by: Gregory Rose <gregory.v.rose@intel.com>
Reviewed by: gnn, rstone
Approved by: gnn
MFC after: 2 weeks

8 years agonvd: set d_delmaxsize to full capacity of NVMe namespace
jimharris [Tue, 21 Jul 2015 20:53:21 +0000 (20:53 +0000)]
nvd: set d_delmaxsize to full capacity of NVMe namespace

The NVMe specification has no ability to specify a maximum delete size
that is less than the full capacity of the namespace - so just using the
namespace size is the correct value here.

This fixes reported issues where ZFS trim on init looked like it was
hanging the system - previously the default I/O max size (128KB on
Intel NVMe controllers) was used for delete operations which worked out
to only about 8MB/s.  With this patch I can add an 800GB DC P3700
drive to a ZFS pool in about 15-20 seconds.

Reported by: Dylan Just <dylan@techtangents.com>
MFC after: 3 days
Sponsored by: Intel

8 years agovt: Draw logos per CPU core
cem [Tue, 21 Jul 2015 20:33:36 +0000 (20:33 +0000)]
vt: Draw logos per CPU core

This feature is inspired by another Unix-alike OS commonly found on
airplane headrests.

A number of beasties[0] are drawn at top of framebuffer during boot,
based on the number of active SMP CPUs[1]. Console buffer output
continues to scroll in the screen area below beastie(s)[2].

After some time[3] has passed, the beasties are erased leaving the
entire terminal for use.

Includes two 80x80 vga16 beastie graphics and an 80x80 vga16 orb
graphic. (The graphics are RLE compressed to save some space -- 3x 3200
bytes uncompressed, or 4208 compressed.)

[0]: The user may select the style of beastie with

    kern.vt.splash_cpu_style=(0|1|2)

[1]: Or the number may be overridden with tunable kern.vt.splash_ncpu.
[2]: https://www.youtube.com/watch?v=UP2jizfr3_o
[3]: Configurable with kern.vt.splash_cpu_duration (seconds, def. 10).

Differential Revision: https://reviews.freebsd.org/D2181
Reviewed by: dumbbell, emaste
Approved by: markj (mentor)
MFC after: 2 weeks

8 years agovt: De-static VT_SYSCTL_INT-defined objects
cem [Tue, 21 Jul 2015 20:30:06 +0000 (20:30 +0000)]
vt: De-static VT_SYSCTL_INT-defined objects

Explicitly mark existing VT_SYSCTL_INTs static. This is in preparation for
D2181.

Reviewed by: dumbbell, emaste
Approved by: markj (mentor)
MFC after: 1 week

8 years agoTeach the GICv2 driver about the Qualcomm GICv2 compatible string.
andrew [Tue, 21 Jul 2015 18:08:10 +0000 (18:08 +0000)]
Teach the GICv2 driver about the Qualcomm GICv2 compatible string.

Obtained from: ABT Systems Ltd
Sponsored by: The FreeBSD Foundation

8 years agoAdd some more explanation to r285752
zbb [Tue, 21 Jul 2015 17:14:24 +0000 (17:14 +0000)]
Add some more explanation to r285752

Add brief commentary to vendor-specific devid function in ITS
and remove redundant spaces by the way.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation

8 years agoDon't allow malloc() to wait for resource while holding a lock in ITS
zbb [Tue, 21 Jul 2015 15:28:07 +0000 (15:28 +0000)]
Don't allow malloc() to wait for resource while holding a lock in ITS

malloc() should not go to sleep in case of lack of resource while
the kernel thread is holding a non-sleepable lock.

- change malloc() flags to M_NOWAIT in such cases implement
  lpi_free_chunk() routine as it will be needed when ITT
  allocation fails in its_device_alloc_locked()
- do not increase verbosity of this code since upper layers will
  communicate an error if the interrupt setup fails

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3121

8 years agoMake clock_gettime() and clock_getres() work for CloudABI programs.
ed [Tue, 21 Jul 2015 15:08:13 +0000 (15:08 +0000)]
Make clock_gettime() and clock_getres() work for CloudABI programs.

Though the standard C library uses a 'struct timespec' using a 64-bit
'time_t', there is no need to use such a type at the system call level.
CloudABI uses a simple 64-bit unsigned timestamp in nanoseconds. This is
sufficient to express any time value from 1970 to 2554.

The CloudABI low-level interface also supports fetching timestamp values
with a lower precision. Instead of overloading the clock ID argument for
this purpose, the system call provides a precision argument that may be
used to specify the maximum slack. The current system call
implementation does not use this information, but it's good to already
have this available.

Expose cloudabi_convert_timespec(), as we're going to need this for
fstat() as well.

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

8 years agoAdd support for vendor specific function for PCI devid acquisition in ITS
zbb [Tue, 21 Jul 2015 14:47:23 +0000 (14:47 +0000)]
Add support for vendor specific function for PCI devid acquisition in ITS

It is possible that some HW will use different PCI devids,
hence allow to replace the default domain:bus:slot:func schema
by implementing and registering custom function.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3118

8 years agoThe part of r285680 which removed release semantic for two stores to
kib [Tue, 21 Jul 2015 14:39:34 +0000 (14:39 +0000)]
The part of r285680 which removed release semantic for two stores to
it_need was wrong [*].  Restore the releases and add a comment
explaining why it is needed.

Noted by: alc [*]
Reviewed by: bde [*]
Sponsored by: The FreeBSD Foundation

8 years agoDescribe COMPAT_CLOUDABI64 in the amd64 configuration NOTES file.
ed [Tue, 21 Jul 2015 12:53:47 +0000 (12:53 +0000)]
Describe COMPAT_CLOUDABI64 in the amd64 configuration NOTES file.

8 years agoImplement get_cyclecount() on ARM64
zbb [Tue, 21 Jul 2015 12:50:45 +0000 (12:50 +0000)]
Implement get_cyclecount() on ARM64

Use Vritual Counter register associated with Generic Timer to
read the cyclecount.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3134

8 years agoMake thread creation work for CloudABI processes.
ed [Tue, 21 Jul 2015 12:47:15 +0000 (12:47 +0000)]
Make thread creation work for CloudABI processes.

Summary:
Remove the stub system call that was put in place during the system call
import and replace it by a target-dependent version stored in sys/amd64.
Initialize the thread in a way similar to cpu_set_upcall_kse(). We
provide the entry point with two arguments: the thread ID and the
argument pointer.

Test Plan:
Thread creation still seems to work, both for FreeBSD and CloudABI
binaries.

Reviewers: dchagin, mjg, kib

Reviewed By: kib

Subscribers: imp

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

8 years agoImprove ARM64 CPU_MATCH
zbb [Tue, 21 Jul 2015 12:15:00 +0000 (12:15 +0000)]
Improve ARM64 CPU_MATCH

Add a method to identify CPU based on RAW MIDR value.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3117

8 years agoUnbreak "last reboot".
ed [Tue, 21 Jul 2015 10:52:05 +0000 (10:52 +0000)]
Unbreak "last reboot".

According to the last(1) man page, the "reboot" pseudo-user should print
all system reboot entries. This got broken by the utmpx import, as
records are typed.

Re-add support for "last reboot" by specifically matching against
SHUTDOWN_TIME and BOOT_TIME records.

PR: 168844
Submitted by: matthew@
MFC after: 1 month

8 years agoFix sb_state constant names as used e.g. to display in DDB ``show sockbuf''.
pluknet [Tue, 21 Jul 2015 09:57:13 +0000 (09:57 +0000)]
Fix sb_state constant names as used e.g. to display in DDB ``show sockbuf''.

MFC after: 1 week

8 years agoWhen a tunneling protocol is being used with UDP we must release the
rrs [Tue, 21 Jul 2015 09:54:31 +0000 (09:54 +0000)]
When a tunneling protocol is being used with UDP we must release the
lock on the INP before calling the tunnel protocol, else a LOR
may occur (it does with SCTP for sure). Instead we must acquire a
ref count and release the lock, taking care to allow for the case
where the UDP socket has gone away and *not* unlocking since the
refcnt decrement on the inp will do the unlock in that case.

Reviewed by: tuexen
MFC after: 3 weeks

8 years agoAdd missing priority argument in example code in BUGS section.
pluknet [Tue, 21 Jul 2015 09:44:45 +0000 (09:44 +0000)]
Add missing priority argument in example code in BUGS section.

PR: 201725
Submitted by: Thomas Cort
MFC after: 1 week

8 years agoRemove a couple of TUNABLE_INT() calls which are unnecessary after r267961.
hiren [Tue, 21 Jul 2015 06:48:36 +0000 (06:48 +0000)]
Remove a couple of TUNABLE_INT() calls which are unnecessary after r267961.
r267961 did remove them but they "reappeared" when ixgbe(4) rewrite happened in
r280182.

Sponsored by: Limelight Networks

8 years agolseek() allows an offset to be set beyond the end of file. Using
ae [Tue, 21 Jul 2015 06:18:42 +0000 (06:18 +0000)]
lseek() allows an offset to be set beyond the end of file. Using
it to check that partition has enough space to write bootcode doesn't
work. Use the known size of provider instead.

PR: 201504
MFC after: 1 week

8 years agoFix some issues with the application of libxo to ls(1)
allanjude [Tue, 21 Jul 2015 05:03:59 +0000 (05:03 +0000)]
Fix some issues with the application of libxo to ls(1)

* Add whitespace trimming to some fields (username, group, size, inode, blocks) to avoid whitespace in JSON strings
* fix -m mode, was invalid JSON (repeated keys), and was missing outer array container
* in -n mode, numeric uids and gids were returned as strings

Approved by: eadler (mentor)
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2854

8 years agoFix an out-of-order execution issue regarding pkg(8):
gjb [Tue, 21 Jul 2015 03:18:53 +0000 (03:18 +0000)]
Fix an out-of-order execution issue regarding pkg(8):
- pkg(8) cannot be removed before subsequent reinvocations
- The PKG_CACHEDIR cannot be cleaned after the repo*.sqlite
  has been removed
- pkg(8) cannot be removed as a precursor to any of the other
  steps involved here

MFC after: 3 days
X-MFC-With: r285722
X-MFC-Before: 10.2-{BETA3,RC1} (whichever happens next)
Sponsored by: The FreeBSD Foundation

8 years agoAdd the Dell E7240 laptop and Intel DP965LT motherboard to the list for the GPT activ...
allanjude [Tue, 21 Jul 2015 00:33:15 +0000 (00:33 +0000)]
Add the Dell E7240 laptop and Intel DP965LT motherboard to the list for the GPT active workaround

PR: 194359
Requested by: sbruno, hiren
Approved by: marcel
MFC after: 3 days
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3139

8 years agoOnly report the lack of ALTQ support if pfctl is using verbose (-v) mode.
gnn [Mon, 20 Jul 2015 23:24:25 +0000 (23:24 +0000)]
Only report the lack of ALTQ support if pfctl is using verbose (-v) mode.

PR: 194935
Submitted by: Jim Thompson
MFC after: 2 weeks

8 years agoImport ACPICA 20150717.
jkim [Mon, 20 Jul 2015 22:31:50 +0000 (22:31 +0000)]
Import ACPICA 20150717.

8 years agoTypo in comment.
kib [Mon, 20 Jul 2015 19:51:41 +0000 (19:51 +0000)]
Typo in comment.

8 years agoIncrease output amp on ASUS UX31A by +5dB.
mav [Mon, 20 Jul 2015 17:48:00 +0000 (17:48 +0000)]
Increase output amp on ASUS UX31A by +5dB.

While there, implement couple helper functions.

8 years agoAdd support for building VirtualBox Vagrant images.
brd [Mon, 20 Jul 2015 16:27:44 +0000 (16:27 +0000)]
Add support for building VirtualBox Vagrant images.
Abstract the build, package and upload to handle building either type.

Approved by: re (gjb)

8 years agolibusb: Fix minor cast-qual warning.
pfg [Mon, 20 Jul 2015 16:15:56 +0000 (16:15 +0000)]
libusb: Fix minor cast-qual warning.

Fix a warning triggered by the gcc + FORTIFY_SOURCE patches:

In function 'libusb20_parse_config_desc': lib/libusb/libusb20_desc.c:141:
warning: passing argument 1 of 'memcpy' discards qualifiers from pointer
target type

Submitted by: hselansky

8 years agosnmp_hostres(3): Fix buffer overflow.
pfg [Mon, 20 Jul 2015 16:08:01 +0000 (16:08 +0000)]
snmp_hostres(3): Fix buffer overflow.

Actually just a typo. Detected by gcc + FORTIFY_SOURCE patches.

CID: 1007594
MFC after: 3 days

8 years agoMake forking of CloudABI processes work.
ed [Mon, 20 Jul 2015 13:46:22 +0000 (13:46 +0000)]
Make forking of CloudABI processes work.

Just like FreeBSD+Capsicum, CloudABI uses process descriptors. Return
the file descriptor number to the parent process.

To the child process we both return a special value for the file
descriptor number (CLOUDABI_PROCESS_CHILD). We also return the thread ID
of the new thread in the copied process, so the threading library can
reinitialize itself.

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

8 years agoAdd an API for easily creating userspace threads in kernelspace.
ed [Mon, 20 Jul 2015 10:20:04 +0000 (10:20 +0000)]
Add an API for easily creating userspace threads in kernelspace.

This change refactors the existing create_thread() function to be more
generic. It replaces almost all of its arguments by a callback that can
be used to extract the thread ID and copy it out to the right place, but
also to perform additional initialization steps, such as setting the
trapframe. This also makes the difference between thr_new() and
thr_create() more clear in my opinion.

This function is going to be used by the CloudABI compatibility layer.

It looks like the OpenSolaris compatibility framework already provides a
function called thread_create(). Rename this function to
do_thread_create() and use a macro to deal with the namespacing
conflict. A similar approach is already used for thread_exit().

MFC after: 1 month

8 years agoFix typo in comment.
mav [Mon, 20 Jul 2015 09:37:42 +0000 (09:37 +0000)]
Fix typo in comment.

Submitted by: Masao Uebayashi

8 years agoPrevent null-pointer dereferencing.
zec [Mon, 20 Jul 2015 08:21:51 +0000 (08:21 +0000)]
Prevent null-pointer dereferencing.

MFC after: 3 days

8 years agoAdd helper functions for IP checksum adjusting. Use these functions in
ae [Mon, 20 Jul 2015 07:26:31 +0000 (07:26 +0000)]
Add helper functions for IP checksum adjusting. Use these functions in
dummynet code and for setdscp. This fixes wrong checksums in some cases.

Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC

8 years agoAdd LLE event handler to report ND6 events to userland via rtsock.
ae [Mon, 20 Jul 2015 06:58:32 +0000 (06:58 +0000)]
Add LLE event handler to report ND6 events to userland via rtsock.

Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC

8 years agoInvoke LLE event handler when entry is deleted.
ae [Mon, 20 Jul 2015 06:54:50 +0000 (06:54 +0000)]
Invoke LLE event handler when entry is deleted.

MFC after: 2 weeks
Sponsored by: Yandex LLC

8 years agoDeclare lockstat_enabled even when KDTRACE_HOOKS is not defined.
markj [Mon, 20 Jul 2015 04:41:25 +0000 (04:41 +0000)]
Declare lockstat_enabled even when KDTRACE_HOOKS is not defined.

Reported by: bz
X-MFC-With: r285704

8 years agoFix some libxo format string errors in the pfkey stats code.
markj [Mon, 20 Jul 2015 02:38:51 +0000 (02:38 +0000)]
Fix some libxo format string errors in the pfkey stats code.

PR: 201700

8 years agoCheck the hw.proto.attach environment variable for devices that
marcel [Sun, 19 Jul 2015 23:37:45 +0000 (23:37 +0000)]
Check the hw.proto.attach environment variable for devices that
proto(4) should attach to instead of the normal driver.

Document the variable.