]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoUse inline asm instead of unportable intrinsics for the SSE4 crc32
Bruce Evans [Sun, 26 Mar 2017 10:31:48 +0000 (10:31 +0000)]
Use inline asm instead of unportable intrinsics for the SSE4 crc32
optimization.

This fixes building with gcc-4.2.1 (it doesn't support SSE4).
gas-2.17.50 [FreeBSD] supports SSE4 instructions, so this doesn't
need using .byte directives.

This fixes depending on host user headers in the kernel.

Fix user includes (don't depend on namespace pollution in <nmmintrin.h>
that is not included now).

The instrinsics had no advantages except to sometimes avoid compiler
pessimixations.  clang understands them a bit better than inline asm,
and generates better looking code which also runs better for cem, but
for me it just at the same speed or slower by doing excessive
unrollowing in all the wrong places.  gcc-4.2.1 also doesn't understand
what it is doing with unrolling, but with -O3 somehow it does more
unrolling that helps.

Reduce 1 of the the compiler pessimizations (copying a variable which
already satisfies an "rm" constraint in a good way by being in memory
and not used again, to different memory and accessing it there.  Force
copying it to a register instead).

Try to optimize the inner loops significantly, so as to run at full
speed on smaller inputs.  The algorithm is already very MD, and was
tuned for the throughput of 3 crc32 instructions per cycle found on
at least Sandybridge through Haswell.  Now it is even more tuned for
this, so depends more on the compiler not rearranging or unrolling
things too much.  The main inner loop for should have no difficulty
runing at full speed on these CPUs unless the compiler unrolls it too
much.  However, the main inner loop wasn't even used for buffers smaller
than 24K.  Now it is used for buffers larger than 384 bytes.  Now it
is not so long, and the main outer loop is used more.  The new
optimization is to try to arrange that the outer loop runs in parallel
with the next inner loop except for the final iteration; then reduce
the loop sizes significantly to take advantage of this.

Approved by: cem
Not tested in production by: bde

7 years agoiwn: deduplicate code in iwn_tx_data() and iwn_tx_data_raw().
Andriy Voskoboinyk [Sun, 26 Mar 2017 09:41:08 +0000 (09:41 +0000)]
iwn: deduplicate code in iwn_tx_data() and iwn_tx_data_raw().

Some code was additionally moved for (future) lock splitting.

Tested with Intel 6205, STA mode.

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

7 years agoiwn: omit unneeded bus_dmamap_sync() calls when compiled without
Andriy Voskoboinyk [Sun, 26 Mar 2017 09:10:01 +0000 (09:10 +0000)]
iwn: omit unneeded bus_dmamap_sync() calls when compiled without
'options IWN_DEBUG'

7 years agoPreserve VFP state across signal delivery.
Michal Meloun [Sun, 26 Mar 2017 08:36:56 +0000 (08:36 +0000)]
Preserve VFP state across signal delivery.

We don't have enouch space to store full VFP context within mcontext
stucture. Due to this:
 - follow i386/amd64 way and store VFP state outside of the mcontext_t
   but point to it. Use the size of VFP state structure as an 'magic'
   indicator of the saved VFP state presence.
 - teach set_mcontext() about this external storage.
 - for signal delivery, store VFP state to expanded 'struct sigframe'.

Submited by: Andrew Gierth (initial version)
PR: 217611
MFC after: 2 weeks

7 years agoSave VFP state on fork().
Michal Meloun [Sun, 26 Mar 2017 08:36:20 +0000 (08:36 +0000)]
Save VFP state on fork().
Update the copy of VFP state in PCB before it is cloned for new process.

MFC after: 2 weeks

7 years agoProvide less laborius way to enable busdma DMAR to only short list of devices.
Konstantin Belousov [Sun, 26 Mar 2017 00:40:35 +0000 (00:40 +0000)]
Provide less laborius way to enable busdma DMAR to only short list of devices.

Kernel environment variable hw.busdma.default can take values 'bounce'
and 'dmar' and selects corresponding busdma backend as default.
Per-device environment variable hw.busdma.pci<domain>.<bus>.<slot>.<func>
takes the same values and overrides hw.busdma.default for the given device.

Note that even with hw.busdma.default=bounce, DMA translation engines
are still started if DMARs are enabled, to disable them use
hw.dmar.dma tunable, as before.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years ago[rpi] Use compatibility string from upstream DTB for I2C controller
Oleksandr Tymoshenko [Sat, 25 Mar 2017 22:58:37 +0000 (22:58 +0000)]
[rpi] Use compatibility string from upstream DTB for I2C controller

FreeBSD uses upstream DTB for RPi3 build and compatibility string for
i2c device is different there. Add this new string to compatibility data.

Reported by: Karl Denninger
MFC after: 3 days

7 years agoiwn: fix return code conflict in iwn_init_locked()
Andriy Voskoboinyk [Sat, 25 Mar 2017 22:07:21 +0000 (22:07 +0000)]
iwn: fix return code conflict in iwn_init_locked()

Do not try to use errno(2) codes here; instead, just return unique
value (1) when radio is disabled via hardware switch and another
one (-1) for any other error in initialization path.

Tested with Intel 6205, STA mode.

7 years agoftp.microsoft.com is dead and the document was not archived, point to the full
Sevan Janiyan [Sat, 25 Mar 2017 21:33:48 +0000 (21:33 +0000)]
ftp.microsoft.com is dead and the document was not archived, point to the full
protocol spec document instead.
Fix spelling mistake flagged by igor.
Rephrase bad sentence flagged by igor.

Approved by: bcr (mentor)
MFC after: 5 days
Differential Revision:  https://reviews.freebsd.org/D10111

7 years agoAdd ids for ALC233 found on Intel Skull Mountain NUC.
Sean Bruno [Sat, 25 Mar 2017 19:12:09 +0000 (19:12 +0000)]
Add ids for ALC233 found on Intel Skull Mountain NUC.

7 years agodtrace sched:::preempt should fire only when there is preemption
Andriy Gapon [Sat, 25 Mar 2017 19:08:51 +0000 (19:08 +0000)]
dtrace sched:::preempt should fire only when there is preemption

The probe fire on any thread switch before.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Panzura

7 years agospecific end of interrupt implementation for AMD Local APIC
Andriy Gapon [Sat, 25 Mar 2017 18:45:09 +0000 (18:45 +0000)]
specific end of interrupt implementation for AMD Local APIC

The change is more intrusive than I would like because the feature
requires that a vector number is written to a special register.
Thus, now the vector number has to be provided to lapic_eoi().
It was readily available in the IO-APIC and MSI cases, but the IPI
handlers required more work.
Also, we now store the VMM IPI number in a global variable, so that it
is available to the justreturn handler for the same reason.

Reviewed by: kib
MFC after: 6 weeks
Differential Revision: https://reviews.freebsd.org/D9880

7 years agoiwn: do not try to update node configuration when the node does not exist.
Andriy Voskoboinyk [Sat, 25 Mar 2017 15:57:47 +0000 (15:57 +0000)]
iwn: do not try to update node configuration when the node does not exist.

Firmware will just respond with status '0x8' (node does not exist) or
will hang -> cause 'device timeout's (sometimes).

7 years agoImplement Linux mincore() system call.
Dmitry Chagin [Sat, 25 Mar 2017 15:47:29 +0000 (15:47 +0000)]
Implement Linux mincore() system call.
This is necessary for the upcoming drm-next.

Suggested by: hselasky@
MFC after: 1 month

7 years agoFix reference count leak with L2 caching.
Mike Karels [Sat, 25 Mar 2017 15:06:28 +0000 (15:06 +0000)]
Fix reference count leak with L2 caching.

ip_forward, TCP/IPv6, and probably SCTP leaked references to L2 cache
entry because they used their own routes on the stack, not in_pcb routes.
The original model for route caching was callers that provided a route
structure to ip{,6}input() would keep the route, and this model was used
for L2 caching as well. Instead, change L2 caching to be done by default
only when using a route structure in the in_pcb; the pcb deallocation
code frees L2 as well as L3 cacches. A separate change will add route
caching to TCP/IPv6.

Another suggestion was to have the transport protocols indicate willingness
to use L2 caching, but this approach keeps the changes in the network
level

Reviewed by:    ae gnn
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D10059

7 years agoMFV r315950:
Dmitry Chagin [Sat, 25 Mar 2017 14:14:11 +0000 (14:14 +0000)]
MFV r315950:

Update vendor/tcsh to git b605cb561d

Vendor changes:

1. PR/471: Daiki Ueno: Delay interpreting arginp until we've processed
our startup files (which can change the NLS environment).

2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar).

3. Fix out of bounds read (Brooks Davis)
(reproduce by starting tcsh and hitting tab at the prompt).

4. Don't play pointer tricks that are undefined in modern c
(Brooks Davis).

7 years agoUpdate vendor/tcsh to git b605cb561d
Dmitry Chagin [Sat, 25 Mar 2017 14:09:12 +0000 (14:09 +0000)]
Update vendor/tcsh to git b605cb561d

Vendor changes:

1. PR/471: Daiki Ueno: Delay interpreting arginp until we've processed
our startup files (which can change the NLS environment).

2. Fix type of read in prompt confirmation (eg. rmstar) (David Kaspar).

3. Fix out of bounds read (Brooks Davis)
(reproduce by starting tcsh and hitting tab at the prompt).

4. Don't play pointer tricks that are undefined in modern c
(Brooks Davis).

7 years agoUpdate to tcsh 6.20.00
Dmitry Chagin [Sat, 25 Mar 2017 13:32:28 +0000 (13:32 +0000)]
Update to tcsh 6.20.00

7 years agoImport libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92.
Dimitry Andric [Sat, 25 Mar 2017 13:17:48 +0000 (13:17 +0000)]
Import libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92.

Interesting fixes which were not already merged:
0c7c611 Merge C++ demangler bug fixes from ELF Tool Chain (#40)
2b208d9 __cxa_demangle_gnu3: demangle 'z' as '...', not 'ellipsis' (#41)

MFC after: 3 days

7 years agoiwn: add few missing notification types into iwn_intr_str()
Andriy Voskoboinyk [Sat, 25 Mar 2017 13:15:43 +0000 (13:15 +0000)]
iwn: add few missing notification types into iwn_intr_str()

7 years agoImport libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92.
Dimitry Andric [Sat, 25 Mar 2017 12:51:11 +0000 (12:51 +0000)]
Import libcxxrt master 8a853717e61d5d55cbdf74d9d0a7545da5d5ff92.

Interesting fixes:
c9601e9 __cxa_demangle_gnu3: fix demangling of wchar_t (#39)
0c7c611 Merge C++ demangler bug fixes from ELF Tool Chain (#40)
2b208d9 __cxa_demangle_gnu3: demangle 'z' as '...', not 'ellipsis' (#41)
c94e7e0 Add _US_ACTION_MASK to libcxxrt's arm-specific unwind header (#42)
8a85371 Simplify some code.

7 years agoAdd a regression test for r31512 fix
Baptiste Daroussin [Sat, 25 Mar 2017 10:47:58 +0000 (10:47 +0000)]
Add a regression test for r31512 fix

PR: 217934
MFC after: 1 week

7 years agoAvoid leaking allocated but unused context after creation race.
Konstantin Belousov [Sat, 25 Mar 2017 10:47:35 +0000 (10:47 +0000)]
Avoid leaking allocated but unused context after creation race.

As noted in the comment, nothing special needs to be done to destroy
the unneeded context after the allocation race, but the context memory
itself still should to be freed.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoDo not create RMRR entries for identity-mapped domains.
Konstantin Belousov [Sat, 25 Mar 2017 10:45:16 +0000 (10:45 +0000)]
Do not create RMRR entries for identity-mapped domains.

It does not make sense since identity mapping already provides the
required mapping for RMRR ranges.  More, since identity page tables do
not reflect content of map entries for id domains, creating RMRR
entries makes domain data inconsistent.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoSlight cleanup of the comment.
Konstantin Belousov [Sat, 25 Mar 2017 10:42:10 +0000 (10:42 +0000)]
Slight cleanup of the comment.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix and add comments to match selected frequency sample.
Ganbold Tsagaankhuu [Sat, 25 Mar 2017 10:39:24 +0000 (10:39 +0000)]
Fix and add comments to match selected frequency sample.
Add debug printfs when bootverbose is used.
No functional changes.

7 years ago[iwm] Add the BSS's basic rates to iwm's LQ command, not all the rates.
Adrian Chadd [Sat, 25 Mar 2017 02:55:13 +0000 (02:55 +0000)]
[iwm] Add the BSS's basic rates to iwm's LQ command, not all the rates.

Makes the firmware use appropriate Tx rates for ACKs.

Obtained from: dragonflybsd.git ab1d3efc208e797c1e09759cd506c95c0aeaa06e

7 years ago[iwm] Enable Energy Based Scan (EBS).
Adrian Chadd [Sat, 25 Mar 2017 02:49:20 +0000 (02:49 +0000)]
[iwm] Enable Energy Based Scan (EBS).

This can significantly reduce scan duration thus saving time and power.
EBS failure reported by FW disables EBS for current connection. It is
re-enabled upon new connection attempt on any WLAN interface.

Obtained from: dragonflybsd.git 89f579e9823a5c446ca172cf82bbc210d6a054a4

7 years ago[iwm] GC unused code from if_iwm_scan.c, copyied from iwn or iwlwifi/dvm.
Adrian Chadd [Sat, 25 Mar 2017 02:44:25 +0000 (02:44 +0000)]
[iwm] GC unused code from if_iwm_scan.c, copyied from iwn or iwlwifi/dvm.

Obtained from: dragonflybsd.git 10881df269b93c26e5ee6af629c36db5672e6e52

7 years ago[iwm] Tiny cleanup in iwm_rx_addbuf().
Adrian Chadd [Sat, 25 Mar 2017 02:42:52 +0000 (02:42 +0000)]
[iwm]  Tiny cleanup in iwm_rx_addbuf().

Obtained from: dragonflybsd.git 3370bc5504ebb3c1b9bb960a185cd0c8052a2845

7 years agocxgbe/iw_cxgbe: allocations that use GFP_KERNEL (which is M_WAITOK on
Navdeep Parhar [Sat, 25 Mar 2017 02:28:21 +0000 (02:28 +0000)]
cxgbe/iw_cxgbe: allocations that use GFP_KERNEL (which is M_WAITOK on
FreeBSD) cannot fail.

MFC after: 3 days

7 years agocxgbe/iw_cxgbe: alloc_ep expects a gfp_t, and it's always ok to sleep during
Navdeep Parhar [Sat, 25 Mar 2017 01:45:04 +0000 (01:45 +0000)]
cxgbe/iw_cxgbe: alloc_ep expects a gfp_t, and it's always ok to sleep during
alloc_ep.

7 years agocxgbe/iw_cxgbe: c4iw_connect should always returns a -ve errno on failure.
Navdeep Parhar [Sat, 25 Mar 2017 01:38:17 +0000 (01:38 +0000)]
cxgbe/iw_cxgbe: c4iw_connect should always returns a -ve errno on failure.

MFC after: 3 days

7 years agoAdd 'device iic' to bring in userland I2C driver.
Warner Losh [Fri, 24 Mar 2017 22:33:03 +0000 (22:33 +0000)]
Add 'device iic' to bring in userland I2C driver.

Submitted by: karl@

7 years agonet80211: fix possible panic when wlan(4) interface is destroyed.
Andriy Voskoboinyk [Fri, 24 Mar 2017 22:29:51 +0000 (22:29 +0000)]
net80211: fix possible panic when wlan(4) interface is destroyed.

If this is the last running vap wait until device will be powered off
(fixes panic when 'ifconfig wlan0 destroy' is executed for running iwn(4)
interface).

Tested with:
 - Intel 6205, STA mode.
 - RTL8188EU, STA / IBSS modes.
 - RTL8821AU, STA / HOSTAP modes.

7 years agoRemove buggy adjustment of page tables in db_write_bytes().
Bruce Evans [Fri, 24 Mar 2017 17:34:55 +0000 (17:34 +0000)]
Remove buggy adjustment of page tables in db_write_bytes().

Long ago, perhaps only on i386, kernel text was mapped read-only and
it was necessary to change the mapping to read-write to set breakpoints
in kernel text.  Other writes by ddb to kernel text were also allowed.
This write protection is harder to implement with 4MB pages, and was
lost even for 4K pages when 4MB pages were implemented.  So changing
the mapping became useless.  It was actually worse than useless since
it followed followed various null and otherwise garbage pointers to
not change random memory instead of the mapping.  (On i386s, the
pointers became good in pmap_bootstrap(), and on amd64 the pointers
became bad in pmap_bootstrap() if not before.)

Another bug broke detection of following of null pointers on i386,
except early in boot where not detecting this was a feature.  When
I fixed the bug, I accidentally broke the feature and soon got traps
in db_write_bytes().  Setting breakpoints early in ddb was broken.

kib pointed out that a clean way to do the adjustment would be to use
a special [sub]map giving a small window on the bytes to be written.

The trap handler didn't know how to fix up errors for pagefaults
accessing the map itself.  Such errors rarely need fixups, since most
traps for the map are for the first access which is a read.

Reviewed by: kib

7 years agoAdd brackets to fix incorrect macro expansion.
Alexander Motin [Fri, 24 Mar 2017 16:26:11 +0000 (16:26 +0000)]
Add brackets to fix incorrect macro expansion.

Reported by: Andreas Hollmann / PVS-Studio
MFC after: 2 weeks

7 years agoProperly initialise with content of pw.conf(5) that was mistakenly ignored.
Eugene Grosbein [Fri, 24 Mar 2017 16:18:57 +0000 (16:18 +0000)]
Properly initialise with content of pw.conf(5) that was mistakenly ignored.
Also, respect "defaultgroup" if specified there.

PR: 217934
Reported by: Victor Sudakov <vas@mpeks.tomsk.su>
Reviewed by: bapt
Approved by: bapt, vsevolod (mentor)
MFC after: 1 week

7 years agoImprove grammar on a warning, and only use one line rather than two when
Gavin Atkinson [Fri, 24 Mar 2017 16:18:20 +0000 (16:18 +0000)]
Improve grammar on a warning, and only use one line rather than two when
printing it.

7 years agoMake sendfile(2) more robust against file change. This fixes a possible
Gleb Smirnoff [Fri, 24 Mar 2017 16:01:19 +0000 (16:01 +0000)]
Make sendfile(2) more robust against file change.  This fixes a possible
crash when the file shrinks.  This also fixes sendfile(2) not sending more
data in a case when the file grows, and the request is open-ended or
specifies a size that is greater than old file size.

PR: 217789
Reviewed by: gallatin
MFC after: 10 days

7 years agoRestore the NULL check that was removed in upstream r913. It is not
Dag-Erling Smørgrav [Fri, 24 Mar 2017 14:45:58 +0000 (14:45 +0000)]
Restore the NULL check that was removed in upstream r913.  It is not
unreasonable to call pam_end() with a NULL pamh in error handling code.

Reported by: rwatson

7 years agoUnify initiator and target DMA setup and command sending.
Alexander Motin [Fri, 24 Mar 2017 14:44:03 +0000 (14:44 +0000)]
Unify initiator and target DMA setup and command sending.

The code is so alike that it is pointless to keep it separate.

MFC after: 2 weeks

7 years agoAdd missing 'else' to conditional. This doesn't really affect the code
Sean Bruno [Fri, 24 Mar 2017 14:27:29 +0000 (14:27 +0000)]
Add missing 'else' to conditional.  This doesn't really affect the code
flow or configuration in any way.

7 years agoAdd missing 'else' to 3-state conditional during setup of interrupts.
Sean Bruno [Fri, 24 Mar 2017 14:25:56 +0000 (14:25 +0000)]
Add missing 'else' to 3-state conditional during setup of interrupts.

We don't want to overwrite the 82574 interrupt setup with a different
configuration.

PR: 218041
Submitted by: razmyslov@viva64.com

7 years agoUse a more stream-lined version of fix_value.
Warner Losh [Fri, 24 Mar 2017 13:46:26 +0000 (13:46 +0000)]
Use a more stream-lined version of fix_value.

Submitted by: ian@

7 years agoCleanup structures related to VFP and/or mcontext_t.
Michal Meloun [Fri, 24 Mar 2017 11:46:49 +0000 (11:46 +0000)]
Cleanup structures related to VFP and/or mcontext_t.
- in mcontext_t, rename newer used 'union __vfp' to equaly sized 'mc_spare'.
  Space allocated by 'union __vfp' is too small and cannot hold full
  VFP context.
- move structures defined in fp.h to more appropriate headers.
- remove all unused VFP structures.

MFC after: 2 weeks

7 years agoMFV r315290, r315291: 7303 dynamic metaslab selection
Alexander Motin [Fri, 24 Mar 2017 09:37:00 +0000 (09:37 +0000)]
MFV r315290, r315291: 7303 dynamic metaslab selection

illumos/illumos-gate@8363e80ae72609660f6090766ca8c2c18aa53f0c
https://github.com/illumos/illumos-gate/commit/8363e80ae72609660f6090766ca8c2c18

https://www.illumos.org/issues/7303

  This change introduces a new weighting algorithm to improve metaslab selection.
  The new weighting algorithm relies on the SPACEMAP_HISTOGRAM feature. As a result,
  the metaslab weight now encodes the type of weighting algorithm used
  (size-based vs segment-based).

  This also introduce a new allocation tracing facility and two new dcmds to help
  debug allocation problems. Each zio now contains a zio_alloc_list_t structure
  that is populated as the zio goes through the allocations stage. Here's an
  example of how to use the tracing facility:

c5ec000::print zio_t io_alloc_list | ::walk list | ::metaslab_trace
  MSID    DVA    ASIZE      WEIGHT             RESULT               VDEV
     -      0      400           0    NOT_ALLOCATABLE           ztest.0a
     -      0      400           0    NOT_ALLOCATABLE           ztest.0a
     -      0      400           0             ENOSPC           ztest.0a
     -      0      200           0    NOT_ALLOCATABLE           ztest.0a
     -      0      200           0    NOT_ALLOCATABLE           ztest.0a
     -      0      200           0             ENOSPC           ztest.0a
     1      0      400      1 x 8M            17b1a00           ztest.0a

1ff2400::print zio_t io_alloc_list | ::walk list | ::metaslab_trace
  MSID    DVA    ASIZE      WEIGHT             RESULT               VDEV
     -      0      200           0    NOT_ALLOCATABLE           mirror-2
     -      0      200           0    NOT_ALLOCATABLE           mirror-0
     1      0      200      1 x 4M            112ae00           mirror-1
     -      1      200           0    NOT_ALLOCATABLE           mirror-2
     -      1      200           0    NOT_ALLOCATABLE           mirror-0
     1      1      200      1 x 4M            112b000           mirror-1
     -      2      200           0    NOT_ALLOCATABLE           mirror-2

  If the metaslab is using segment-based weighting then the WEIGHT column will
  display the number of segments available in the bucket where the allocation
  attempt was made.

Author: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Chris Siden <christopher.siden@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

7 years agoInclude <sys/systm.h> to obtain the memcpy() prototype.
Ed Schouten [Fri, 24 Mar 2017 07:09:33 +0000 (07:09 +0000)]
Include <sys/systm.h> to obtain the memcpy() prototype.

I got a report of this source file not building on Raspberry Pi. It's
interesting that this only fails for that target and not for others.
Again, that's no reason not to include the right headers.

PR: 217969
Reported by: Johannes Jost Meixner
MFC after: 1 week

7 years agoDon't bother checking core version
Justin Hibbits [Fri, 24 Mar 2017 01:52:10 +0000 (01:52 +0000)]
Don't bother checking core version

We already constrain by SoC, so there's no need to check the core version, too.

7 years agoSwitch qoriq_gpio over to using ofw_bus_search_compatible
Justin Hibbits [Fri, 24 Mar 2017 01:30:18 +0000 (01:30 +0000)]
Switch qoriq_gpio over to using ofw_bus_search_compatible

This will make it easier to add more compatibility strings in the future, if
necessary.

7 years agoDon't initialize if_output to ether_output(), ether_ifattach() does it for
Kevin Lo [Fri, 24 Mar 2017 01:23:07 +0000 (01:23 +0000)]
Don't initialize if_output to ether_output(), ether_ifattach() does it for
us already.  While here, remove NOTYET code since if_watchdog is no longer
used.

Reviewed by: royger
MFC after: 3 days

7 years agoCorrect handling of ALTQ with epair(4) interfaces but presenting that ALTQ(9) is...
Ermal Luçi [Fri, 24 Mar 2017 00:55:16 +0000 (00:55 +0000)]
Correct handling of ALTQ with epair(4) interfaces but presenting that ALTQ(9) is supported.

Approved by: ae
MFC after: 2 weeks

7 years agoMFV r315875:
Martin Matuska [Fri, 24 Mar 2017 00:02:12 +0000 (00:02 +0000)]
MFV r315875:
Sync libarchive with vendor.

Vendor changes (FreeBSD-related):
- store extended attributes with extattr_set_link() if no fd is provided
- add extended attribute tests to libarchive and bsdtar
- fix tar's test_option_acls
- support the UF_HIDDEN file flag

X-MFC with: 315636

7 years agoUpdate vendor/libarchive to git e92cb619661b5b52da63867305442e22892a503d
Martin Matuska [Thu, 23 Mar 2017 23:44:31 +0000 (23:44 +0000)]
Update vendor/libarchive to git e92cb619661b5b52da63867305442e22892a503d

Vendor changes (FreeBSD-related):
- store extended attributes with extattr_set_link() if no fd is provided
- add extended attribute tests to libarchive and bsdtar
- support the UF_HIDDEN file flag

7 years agoAdd Northstar/BCM4706 core ID for ChipCommon.
Landon J. Fuller [Thu, 23 Mar 2017 22:14:08 +0000 (22:14 +0000)]
Add Northstar/BCM4706 core ID for ChipCommon.

Approved by: adrian (mentor, implicit)

7 years agoAdd a workaround for the BCM4706's dangling core region EROM entries.
Landon J. Fuller [Thu, 23 Mar 2017 22:12:14 +0000 (22:12 +0000)]
Add a workaround for the BCM4706's dangling core region EROM entries.

Approved by: adrian (mentor, implicit)

7 years agoMFV r315791: ntp 4.2.8p10.
Xin LI [Thu, 23 Mar 2017 22:06:06 +0000 (22:06 +0000)]
MFV r315791: ntp 4.2.8p10.

7 years agoisp field in struct isp_pcmd is also unused.
Alexander Motin [Thu, 23 Mar 2017 21:18:10 +0000 (21:18 +0000)]
isp field in struct isp_pcmd is also unused.

MFC after: 2 weeks

7 years agoRemove write-only crn field from struct isp_pcmd.
Alexander Motin [Thu, 23 Mar 2017 21:11:55 +0000 (21:11 +0000)]
Remove write-only crn field from struct isp_pcmd.

MFC after: 2 weeks

7 years agoRemove Solaris 2.6 syscalls selector.
Gleb Smirnoff [Thu, 23 Mar 2017 19:54:41 +0000 (19:54 +0000)]
Remove Solaris 2.6 syscalls selector.

Discussed with: kib

7 years ago[mips/broadcom]: Early boot NVRAM support
Landon J. Fuller [Thu, 23 Mar 2017 19:29:12 +0000 (19:29 +0000)]
[mips/broadcom]: Early boot NVRAM support

Add support for early boot access to NVRAM variables, using a new
bhnd_nvram_data_getvar_direct() API to support zero-allocation direct
reading of NVRAM variables from a bhnd_nvram_io instance backed by the
CFE NVRAM device.

Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D9913

7 years agoUse ppsratecheck() for ratelimiting in the LinuxKPI.
Hans Petter Selasky [Thu, 23 Mar 2017 16:23:55 +0000 (16:23 +0000)]
Use ppsratecheck() for ratelimiting in the LinuxKPI.

Suggested by: cem @
MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoAdd proper error checking for the string to number conversion
Hans Petter Selasky [Thu, 23 Mar 2017 16:01:51 +0000 (16:01 +0000)]
Add proper error checking for the string to number conversion
functions in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoIn libcasper, prefer to send a function index or service name over the IPC
Robert Watson [Thu, 23 Mar 2017 14:35:21 +0000 (14:35 +0000)]
In libcasper, prefer to send a function index or service name over the IPC
channel to a zygote process, rather than sending a function pointer or
service pointer.  This avoids transfering pointers between address spaces,
which while robust in this case (due to the zygote being forked() from the
parent) is not generally a good idea, especially in the presence of
increasingly popular control-flow integrity and pointer protection
mitigation schemes.  With this change, ping(8) and other sandboxed tools
using libcasper for DNS resolution now work on architectures with tagged
memory again.

Reviewed by: oshogbo
MFC after: 1 week
Sponsored by: DARPA, AFRL

7 years agoStop providing the compat_3_brand.
Ed Schouten [Thu, 23 Mar 2017 14:12:21 +0000 (14:12 +0000)]
Stop providing the compat_3_brand.

As of r315860, the ELF image activator works fine for CloudABI without it.

Reviewed by: kib
MFC after: 2 weeks

7 years agoDon't require the presence of the compat_3_brand.
Ed Schouten [Thu, 23 Mar 2017 14:09:45 +0000 (14:09 +0000)]
Don't require the presence of the compat_3_brand.

The existing ELF image activator requires the brandinfo to provide such
a string unconditionally, even if the executable format in question
doesn't use this type of branding. Skip matching when it's a null
pointer.

Reviewed by: kib
MFC after: 2 weeks

7 years agoFunction macros are preferred in the LinuxKPI.
Hans Petter Selasky [Thu, 23 Mar 2017 13:28:16 +0000 (13:28 +0000)]
Function macros are preferred in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agoaacraid: rework r315083 for a clean build with and without AACRAID_DEBUG
Andriy Gapon [Thu, 23 Mar 2017 11:59:17 +0000 (11:59 +0000)]
aacraid: rework r315083 for a clean build with and without AACRAID_DEBUG

r315083 essentially reverted r263954 which was made for a good reason,
but didn't take into account AACRAID_DEBUG.
Now both types of build should be clean.

MFC after: 5 days
No MFC to: stable/10

7 years agoRemove "UNMAPPED" messages printed on da periph attach.
Alexander Motin [Thu, 23 Mar 2017 10:50:45 +0000 (10:50 +0000)]
Remove "UNMAPPED" messages printed on da periph attach.

I think this message is not very useful for end user.  Also its formatting
does not match other messages printed at that time.  Those who really need
this information can always find it in `camcontrol negotiate daX -v`.

MFC after: 2 weeks

7 years agoAdd support for ratelimited printouts in the LinuxKPI.
Hans Petter Selasky [Thu, 23 Mar 2017 10:48:10 +0000 (10:48 +0000)]
Add support for ratelimited printouts in the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies

7 years agozfs_putpages: use TXG_WAIT
Andriy Gapon [Thu, 23 Mar 2017 09:13:21 +0000 (09:13 +0000)]
zfs_putpages: use TXG_WAIT

Explicit looping using TXG_NOWAIT is more verbose and may harm performance
under heavy load because of multiple waits.

MFC after: 1 week

7 years agozfs: add zio_buf_alloc_nowait and use it in vdev_queue_aggregate
Andriy Gapon [Thu, 23 Mar 2017 08:59:17 +0000 (08:59 +0000)]
zfs: add zio_buf_alloc_nowait and use it in vdev_queue_aggregate

This way we can avoid blocking the whole queue in the low memory
situations.  It's better to sacrifice some I/O performance by not doing
the aggregation than to add an indefinite wait for more memory.

Reviewed by: smh
MFC after: 2 weeks
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D9999

7 years agomove thread switch tracing from mi_switch to sched_switch
Andriy Gapon [Thu, 23 Mar 2017 08:57:04 +0000 (08:57 +0000)]
move thread switch tracing from mi_switch to sched_switch

This is done so that the thread state changes during the switch
are not confused with the thread state changes reported when the thread
spins on a lock.

Here is an example, three consecutive entries for the same thread (from top to
bottom):

  KTRGRAPH group:"thread", id:"zio_write_intr_3 tid 100260", state:"sleep", attributes: prio:84, wmesg:"-", lockname:"(null)"
  KTRGRAPH group:"thread", id:"zio_write_intr_3 tid 100260", state:"spinning", attributes: lockname:"sched lock 1"
  KTRGRAPH group:"thread", id:"zio_write_intr_3 tid 100260", state:"running", attributes: none

The above trace could leave an impression that the final state of
the thread was "running".
After this change the sleep state will be reported after the "spinning"
and "running" states reported for the sched lock.

Reviewed by: jhb, markj
MFC after: 1 week
Sponsored by: Panzura
Differential Revision: https://reviews.freebsd.org/D9961

7 years agoThe original author abused Nd (one-line description, used by makewhatis)
Dag-Erling Smørgrav [Thu, 23 Mar 2017 08:34:30 +0000 (08:34 +0000)]
The original author abused Nd (one-line description, used by makewhatis)
for its side effect of producing an en-dash.  This broke whatis with
newer versions of mdocml.  Use \(en instead.

MFC after: 1 week

7 years agoRestore original (pre r315760) naming for Tegra SDHCI device.
Michal Meloun [Thu, 23 Mar 2017 08:16:53 +0000 (08:16 +0000)]
Restore original (pre r315760) naming for Tegra SDHCI device.

Newbus handles multiple equally named device classes without problems,
so there is no reason to use slightly cryptic "<foo>_shdci" for them.
In contrast, the driver module name must be unique, so "<foo>_shdci"
is the right name for it.

7 years agoRevert r315800, it was committed with invalid (unsaved) commit log.
Michal Meloun [Thu, 23 Mar 2017 08:15:11 +0000 (08:15 +0000)]
Revert r315800, it was committed with invalid (unsaved) commit log.

7 years agoTry polishing up iflib manpages a bit (basically all the low hanging fruit)
Enji Cooper [Thu, 23 Mar 2017 07:36:38 +0000 (07:36 +0000)]
Try polishing up iflib manpages a bit (basically all the low hanging fruit)

igor:
- Fix typos.
- Delete trailing whitespace.

manlint:
- Use .Fo/.Fc/.Fa when describing functions.
- Use .Xr.
- Fill in SEE ALSO section.
- Fix .Dt use: the section was specified incorrectly and the name
  had a lowercase character.
- Continue new sentences on new lines.

Miscellaneous:
- Remove unnecessary quotes around "SEE ALSO" section headers.
- Sprinkle .Dv use in spots with constants.

Reported by: igor, make manlint
Sponsored by: Dell EMC Isilon

7 years agoPCI_IOV_*INIT(9): fix make manlint warnings
Enji Cooper [Thu, 23 Mar 2017 06:11:31 +0000 (06:11 +0000)]
PCI_IOV_*INIT(9): fix make manlint warnings

Add missing section number when referring to PCI_IOV_*INIT(9) with .Xr
from the other corresponding manpage.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agomemguard(9): fix igor/manlint warnings
Enji Cooper [Thu, 23 Mar 2017 06:08:01 +0000 (06:08 +0000)]
memguard(9): fix igor/manlint warnings

- Expand a contraction [1].
- Add a missing section number when referring to uma(9) with .Xr .

MFC after: 1 week
Reported by: igor [1], make manlint [2]
Sponsored by: Dell EMC Isilon

7 years agoifnet(9): fix some igor/manlint warnings
Enji Cooper [Thu, 23 Mar 2017 06:02:23 +0000 (06:02 +0000)]
ifnet(9): fix some igor/manlint warnings

- Fix typos (queueing -> queuing) [1].
- Add missing section number for polling .Xr reference [2].

MFC after: 1 week
Reported by: igor [1], make manlint [2]
Sponsored by: Dell EMC Isilon

7 years agodnv(9): fix use of commas with .Nm in NAME section
Enji Cooper [Thu, 23 Mar 2017 05:54:07 +0000 (05:54 +0000)]
dnv(9): fix use of commas with .Nm in NAME section

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agoRelease all previously allocated resources.
Michal Meloun [Thu, 23 Mar 2017 05:54:03 +0000 (05:54 +0000)]
Release all previously allocated resources.

7 years agocounter(9): fix igor/manlint warnings
Enji Cooper [Thu, 23 Mar 2017 05:51:54 +0000 (05:51 +0000)]
counter(9): fix igor/manlint warnings

- Reword description of `counter_enter` slightly to fix
  wordiness [1].
- Expand "isn't" as "is not" [1].
- Add missing section number with .Xr sysctl calls [2].

MFC after: 1 week
Reported by: igor [1], make manlint [2]
Sponsored by: Dell EMC Isilon

7 years agoDB_COMMAND(9): fix mandoc markup
Enji Cooper [Thu, 23 Mar 2017 05:44:18 +0000 (05:44 +0000)]
DB_COMMAND(9): fix mandoc markup

Start new sentences on new lines.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agobuf_ring(9): fix mandoc markup
Enji Cooper [Thu, 23 Mar 2017 05:41:56 +0000 (05:41 +0000)]
buf_ring(9): fix mandoc markup

Remove spurious trailing comma after `buf_ring_peek` in the NAME
section.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agobus_alloc_resource(9): fix mandoc markup
Enji Cooper [Thu, 23 Mar 2017 05:38:57 +0000 (05:38 +0000)]
bus_alloc_resource(9): fix mandoc markup

Add missing comma after `.Nm bus_alloc_resource_any` in NAME section.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agoalq(9): fix mandoc markup
Enji Cooper [Thu, 23 Mar 2017 05:37:04 +0000 (05:37 +0000)]
alq(9): fix mandoc markup

Start new sentence on a new line.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agointro(3): fix markup
Enji Cooper [Thu, 23 Mar 2017 05:26:44 +0000 (05:26 +0000)]
intro(3): fix markup

- Use `Em` with `.It` macro when referring to other libraries, instead of
  `Xr`.
- Use `.Em` instead of `.Xr` when referring to libraries.
- Remove commented out lines.

MFC after: 1 month
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agoVendor import of ntp-4.2.8p10.
Xin LI [Thu, 23 Mar 2017 05:19:00 +0000 (05:19 +0000)]
Vendor import of ntp-4.2.8p10.

7 years agotuning(7): fix SEE ALSO section sorting
Enji Cooper [Thu, 23 Mar 2017 05:15:35 +0000 (05:15 +0000)]
tuning(7): fix SEE ALSO section sorting

dummynet(4) should come before eventtimers(4)

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agotests(7): fix mdoc warning
Enji Cooper [Thu, 23 Mar 2017 05:12:07 +0000 (05:12 +0000)]
tests(7): fix mdoc warning

Continue sentence in "Configuring the tests" on a new line.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years agobuild(7): sort SEE ALSO section
Enji Cooper [Thu, 23 Mar 2017 05:06:40 +0000 (05:06 +0000)]
build(7): sort SEE ALSO section

tests(7) should be grouped in the man section 7 group, not the section 8 group.

MFC after: 1 week
Reported by: make manlint
Sponsored by: Dell EMC Isilon

7 years ago[iwm] Make ucode capabilities and api flags handling more like iwlwifi.
Adrian Chadd [Thu, 23 Mar 2017 04:50:38 +0000 (04:50 +0000)]
[iwm] Make ucode capabilities and api flags handling more like iwlwifi.

Obtained from: dragonflybsd.git 757eecf0e6c92745aa2eee95811e573c8300850e

7 years ago[iwm] Remove a couple of unneeded IWM_UCODE_TLV_FLAGS_* flags.
Adrian Chadd [Thu, 23 Mar 2017 04:43:04 +0000 (04:43 +0000)]
[iwm] Remove a couple of unneeded IWM_UCODE_TLV_FLAGS_* flags.

* All the supported firmwares have these flags set.

* This removes the following flags:
  IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT,
  IWM_UCODE_TLV_FLAGS_NEWBT_COEX,
  IWM_UCODE_TLV_FLAGS_BF_UPDATED,
  IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API,
  IWM_UCODE_TLV_FLAGS_STA_KEY_CMD,
  IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD,
  IWM_UCODE_TLV_FLAGS_SCHED_SCAN,
  IWM_UCODE_TLV_FLAGS_RX_ENERGY_API,
  IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2

* Also remove definitions and code for dealing with the v1 time-event api.

* Remove unneeded calc_rssi() function.

Obtained from: dragonflybsd.git d078c812418d0e2c3392e99fa25fc776d07bdfad

7 years agodiff(1): document remaining long options
Enji Cooper [Thu, 23 Mar 2017 04:35:52 +0000 (04:35 +0000)]
diff(1): document remaining long options

While here, try and tie together some of the short options with
their long option equivalents, where possible.

Sponsored by: Dell EMC Isilon

7 years ago[iwm] Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu().
Adrian Chadd [Thu, 23 Mar 2017 04:34:25 +0000 (04:34 +0000)]
[iwm] Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu().

* This avoids leaving the mbuf in a weird state, when dropping a packet.

Obtained from: dragonflybsd.git 96eaecf93d9f731459a0df8efc72cfad034320bd

7 years ago[iwm] Get rid of struct iwm_rx_data argument for iwm_mvm_rx_rx_mpdu.
Adrian Chadd [Thu, 23 Mar 2017 04:33:15 +0000 (04:33 +0000)]
[iwm]  Get rid of struct iwm_rx_data argument for iwm_mvm_rx_rx_mpdu.

Obtained from: dragonflybsd.git b5cdd8067951dc90271ab104ef555b3b5a4d5d5a

7 years agoRename tests from <foo> to <foo>_test to match the FreeBSD test suite
Enji Cooper [Thu, 23 Mar 2017 03:28:24 +0000 (03:28 +0000)]
Rename tests from <foo> to <foo>_test to match the FreeBSD test suite
naming scheme

usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test
to avoid collisions with the renamed FreeBSD test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon

7 years agoAdd a post-humous manpage for cd9660(5), the ISO-9660 file system
Enji Cooper [Thu, 23 Mar 2017 02:57:08 +0000 (02:57 +0000)]
Add a post-humous manpage for cd9660(5), the ISO-9660 file system

Describe (briefly) how to compile the filesystem into the kernel and
load as a module.

Reference cd9660(5) in mount(8) and mount_cd9660(8).

MFC after: 1 month
Sponsored by: Dell EMC Isilon

7 years agomount.conf(8): fix a .Xr call
Enji Cooper [Thu, 23 Mar 2017 02:50:35 +0000 (02:50 +0000)]
mount.conf(8): fix a .Xr call

Add the missing section number for devfs(5)

MFC after: 1 week
Sponsored by: Dell EMC Isilon