]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 years agoImprove compilation on windows 64-bit (for the userland stack).
tuexen [Sun, 27 Mar 2016 10:04:25 +0000 (10:04 +0000)]
Improve compilation on windows 64-bit (for the userland stack).

MFC after: 1 week

8 years agoSplit the global taskqueue used to process all UFS trim completions,
kib [Sun, 27 Mar 2016 08:21:17 +0000 (08:21 +0000)]
Split the global taskqueue used to process all UFS trim completions,
into per-mount taskqueue with the private taskqueue processing thread.
This allows to drain the taskqueue on unmount, to ensure that all
TRIMs are finished before mount structures are freed.

But just draining the taskqueue where TRIM biodone geom-up completions
are processed is not enough, since ffs_blkfree(), called by the task,
might result in more writes.  Count inflight delayed blkfree's and
pause() unmount until the counter drains as well.

Reported by: Nick Evans <nevans@talkpoint.com>
Tested by: Nick Evans <nevans@talkpoint.com>, pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoiConvert Linux SOL_IPV6 level.
dchagin [Sun, 27 Mar 2016 08:12:01 +0000 (08:12 +0000)]
iConvert Linux SOL_IPV6 level.

MFC after: 1 week

8 years agoWhitespaces and style(9) fix. No functional changes.
dchagin [Sun, 27 Mar 2016 08:10:20 +0000 (08:10 +0000)]
Whitespaces and style(9) fix. No functional changes.

MFC after: 1 week

8 years agoStyle: wrap long lines.
kib [Sun, 27 Mar 2016 08:07:12 +0000 (08:07 +0000)]
Style: wrap long lines.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

8 years agoCompile libcxxrt as C++11, since it is only really used in combination
dim [Sun, 27 Mar 2016 00:37:54 +0000 (00:37 +0000)]
Compile libcxxrt as C++11, since it is only really used in combination
with libc++, which is also C++11.  Also change one _Static_assert (which
is really C11) back into static_assert, like upstream.

This should help when compiling libcxxrt with newer versions of gcc,
which refuse to recognize any form of static assertions, if not
compiling for C++11 or higher.

While here, add -nostdinc++ to CFLAGS, to prevent picking up any C++
headers outside the source tree.

8 years agoPlug leak in m_unshare.
np [Sat, 26 Mar 2016 23:39:53 +0000 (23:39 +0000)]
Plug leak in m_unshare.

m_unshare passes on the source mbuf's flags as-is to m_getcl and this
results in a leak if the flags include M_NOFREE.  The fix is to clear
the bits not listed in M_COPYALL before calling m_getcl.  M_RDONLY
should probably be filtered out too but that's outside the scope of this
fix.

Add assertions in the zone_mbuf and zone_pack ctors to catch similar
bugs.

Update netmap_get_mbuf to not pass M_NOFREE to m_getcl.  It's not clear
what the original code was trying to do but it's likely incorrect.
Updated code is no different functionally but it avoids the newly added
assertions.

Reviewed by: gnn@
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D5698

8 years agoWhen write(2) on eventfd object fails with the error EAGAIN do not return
dchagin [Sat, 26 Mar 2016 19:16:53 +0000 (19:16 +0000)]
When write(2) on eventfd object fails with the error EAGAIN do not return
the number of bytes written.

MFC after: 1 week

8 years agoImplement O_NONBLOCK flag via fcntl(F_SETFL) for eventfd object.
dchagin [Sat, 26 Mar 2016 19:15:23 +0000 (19:15 +0000)]
Implement O_NONBLOCK flag via fcntl(F_SETFL) for eventfd object.

MFC after: 1 week

8 years agoOnly define the platform methods for the Allwinner platforms we are
andrew [Sat, 26 Mar 2016 17:49:46 +0000 (17:49 +0000)]
Only define the platform methods for the Allwinner platforms we are
building for.

Sponsored by: ABT Systems Ltd

8 years agoPull in r264465 from upstream llvm trunk (by David Majnemer):
dim [Sat, 26 Mar 2016 17:38:15 +0000 (17:38 +0000)]
Pull in r264465 from upstream llvm trunk (by David Majnemer):

  [X86] Emit a proper ADJCALLSTACKDOWN in EmitLoweredTLSAddr

  We forgot to add the second machine operand to our ADJCALLSTACKDOWN,
  resulting in crashes in PEI.

  This fixes PR27071.

This should fix an assertion failure during buildworld, when using -Os,
and targeting either i386 directly, or building the 32-bit libraries on
amd64.

Reported by: Eric Camachat <eric.camachat@gmail.com>

8 years agoDo not prompt for GELI passphrase is encrypted with keys only
allanjude [Sat, 26 Mar 2016 15:39:48 +0000 (15:39 +0000)]
Do not prompt for GELI passphrase is encrypted with keys only

PR: 208251
Submitted by: Fabian Keil <fk@fabiankeil.de>
Sponsored by: ScaleEngine Inc.

8 years agoARM: Fix bug introduced in r297286.
mmel [Sat, 26 Mar 2016 12:19:27 +0000 (12:19 +0000)]
ARM: Fix bug introduced in r297286.
 - don't put command line without guard to kernel environment.
 - kernel environment delivered from ubldr must have absolute precedence.

8 years agoCleanup headers
bapt [Sat, 26 Mar 2016 12:11:46 +0000 (12:11 +0000)]
Cleanup headers

Found by: include-what-you-use

8 years agoRemove some unneeded headers
bapt [Sat, 26 Mar 2016 11:41:35 +0000 (11:41 +0000)]
Remove some unneeded headers

Found by 'include-what-you-use'

8 years agoUpdate pci_vendors database to 2016-02-27
bapt [Sat, 26 Mar 2016 11:13:17 +0000 (11:13 +0000)]
Update pci_vendors database to 2016-02-27

MFC after: 1 week

8 years agoTEGRA: Fixes for UART driver:
mmel [Sat, 26 Mar 2016 10:09:28 +0000 (10:09 +0000)]
TEGRA: Fixes for UART driver:
 - add mising 'or' in tegra_uart_attach()
   Pointed by: kan
 - fix indentation of tegra_softc
 - remove forgoten debug printf

8 years agonet80211: fix panic for DWDS vaps
avos [Sat, 26 Mar 2016 08:59:56 +0000 (08:59 +0000)]
net80211: fix panic for DWDS vaps

Since r248069, TX IC lock must obtained before calling ieee80211_encap()
and/or ieee80211_parent_xmitpkt().

Tested with: Intel 3945BG.

8 years agoARM: Parse command line delivered by U-Boot:
mmel [Sat, 26 Mar 2016 06:59:01 +0000 (06:59 +0000)]
ARM: Parse command line delivered by U-Boot:
- in atags
- in DT blob (by using 'fdt chosen' U-Boot command)

The command line must start with guard's string 'FreeBSD:' and can contain
list of comma separated kenv strings. Also, boot modifier strings from
boot.h are recognised and parsed into boothowto.

The command line must be passed from U-Boot by setting of bootargs variable:
'setenv bootargs FreeBSD:boot_single=1,vfs.root.mountfrom=ufs:/dev/ada0s1a'
followed by 'fdt chosen' (only for DT based boot)

8 years agoARM: Fix ATAG handling in LINUX_BOOT_API:
mmel [Sat, 26 Mar 2016 06:57:36 +0000 (06:57 +0000)]
ARM: Fix ATAG handling in LINUX_BOOT_API:
 - Don't convert atags address passed from U-Boot. It's real physical
   address (and we have 1:1 mapping).
 - Size of tags is encoded in words, not in bytes

8 years agoARM: Teach LINUX_BOOT_ABI to recognize DT blob.
mmel [Sat, 26 Mar 2016 06:55:55 +0000 (06:55 +0000)]
ARM: Teach LINUX_BOOT_ABI to recognize DT blob.
This allow us to boot FreeBSD kernel (using uImage encapsulation) directly
from U-boot using 'bootm' command or by Android fastboot loader.
For now, kernel uImage must be marked as Linux, but we can add support for
FreeBSD into U-Boot later.

8 years agoImplement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally.
bdrewery [Sat, 26 Mar 2016 03:46:12 +0000 (03:46 +0000)]
Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally.

Sponsored by: EMC / Isilon Storage Division

8 years agoWe don't have a CPPFLAGS, COPTS or CPUFLAGS.
bdrewery [Sat, 26 Mar 2016 03:46:04 +0000 (03:46 +0000)]
We don't have a CPPFLAGS, COPTS or CPUFLAGS.

Sponsored by: EMC / Isilon Storage Division

8 years agoWITHOUT_TOOLCHAIN: Fix includes not being staged in WORLDTMP.
bdrewery [Fri, 25 Mar 2016 22:36:32 +0000 (22:36 +0000)]
WITHOUT_TOOLCHAIN: Fix includes not being staged in WORLDTMP.

This has been the case since r264930 and r274662.

Sponsored by: EMC / Isilon Storage Division

8 years agoWITHOUT_TOOLCHAIN: Also exclude LLDB.
bdrewery [Fri, 25 Mar 2016 22:36:29 +0000 (22:36 +0000)]
WITHOUT_TOOLCHAIN: Also exclude LLDB.

Sponsored by: EMC / Isilon Storage Division

8 years agoCROSS_BINUTILS_PREFIX: Reduce redundant logic.
bdrewery [Fri, 25 Mar 2016 22:36:26 +0000 (22:36 +0000)]
CROSS_BINUTILS_PREFIX: Reduce redundant logic.

Sponsored by: EMC / Isilon Storage Division

8 years agoExternal compiler: Remove redundant flags from CXXFLAGS.
bdrewery [Fri, 25 Mar 2016 22:36:23 +0000 (22:36 +0000)]
External compiler: Remove redundant flags from CXXFLAGS.

The use of XCXXFLAGS is to assign it to CXX in CROSSENV.
XCFLAGS is also assigned here so there is no need to have
--syroot and -B flags again.

Sponsored by: EMC / Isilon Storage Division

8 years agoWITHOUT_CROSS_COMPILER: Fix this to use external compiler logic.
bdrewery [Fri, 25 Mar 2016 22:36:13 +0000 (22:36 +0000)]
WITHOUT_CROSS_COMPILER: Fix this to use external compiler logic.

Without this the default toolchain in /usr/bin/ would not use
WORLDTMP via --sysroot, and would lack --target if cross-building.

PR: 196193
Related: D3970
Sponsored by: EMC / Isilon Storage Division

8 years agoMerge byacc 20160324.
jkim [Fri, 25 Mar 2016 22:32:26 +0000 (22:32 +0000)]
Merge byacc 20160324.

8 years agoAdd td_swinvoltick to track last involuntary context switch
cem [Fri, 25 Mar 2016 19:35:29 +0000 (19:35 +0000)]
Add td_swinvoltick to track last involuntary context switch

Expose in DDB via "show thread."

Reviewed by: markj
Sponsored by: EMC / Isilon Storage Division

8 years agoFix libcompat not handling some external toolchain flags.
bdrewery [Fri, 25 Mar 2016 19:12:44 +0000 (19:12 +0000)]
Fix libcompat not handling some external toolchain flags.

- Use libc++ with GCC.
- Use CROSS_BINUTILS_PREFIX with -B (r280980 addressed this mostly already)

Sponsored by: EMC / Isilon Storage Division

8 years agoUpdate flags for external GCC.
bdrewery [Fri, 25 Mar 2016 19:12:41 +0000 (19:12 +0000)]
Update flags for external GCC.

- The -L WORLDTMP/usr/lib is not needed as GCC is already adding in
  -L =/usr/lib internally with --sysroot.  It does not do this for
  header include paths though, thus passing -isystem =/usr/include is
  still needed.

For the forced libc++ usage:
- Use -isystem rather than -I for libc++ headers.
- Use -std=c++11 rather than gnu++11.
- Use -nostdinc++ to ensure GCC's headers don't leak in.

Sponsored by: EMC / Isilon Storage Division

8 years agoBuild libcompat (lib32) with a --sysroot pointing into its stage directory.
bdrewery [Fri, 25 Mar 2016 19:12:38 +0000 (19:12 +0000)]
Build libcompat (lib32) with a --sysroot pointing into its stage directory.

This overrides the cross-compiler's default sysroot to use the WORLD32's
sysroot for building the lib32 libraries.  Previously the cross-compiler
would default the sysroot to the 64bit WORLDTMP and -B/-L/-isystem flags
were used to build using the lib32 files.  This leads to multiple issues
discussed later.  Some extra headers are now needed to be staged since the
64bit WORLDTMP is not referenced at all for headers.  The 64bit WORLDTMP
is still used via PATH for build tools.  Overriding the default
target/arch is retained in the CC/CXX overrides.

This allows reverting the LDSCRIPT rewriting in installworld from r296921 and
r235122, thus allowing read-only objdirs to work for installing again.

This removes the need for _LDSCRIPTROOT.

This allows progressing the change to always use --sysroot for the build
rather than only relying on the cross-compiler's default sysroot.  The
work for that is in D3970 and needed to resolve WITHOUT_CROSS_COMPILER
not using a --sysroot [1].

PR: 196193 [1]
Sponsored by: EMC / Isilon Storage Division

8 years agoLIBRARIES_ONLY should only be defined during install32.
bdrewery [Fri, 25 Mar 2016 19:12:13 +0000 (19:12 +0000)]
LIBRARIES_ONLY should only be defined during install32.

r245561 added it to prevent extra files from being installed during
the install32 phase (to prevent duplicates in the meta log with -DNO_ROOT).
The flag should not be passed during build32 though since it may
prevent staging of includes during the 'make includes' phase on
library directories.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix iSCSI initiator crash that could happen with out-of-memory
trasz [Fri, 25 Mar 2016 16:01:40 +0000 (16:01 +0000)]
Fix iSCSI initiator crash that could happen with out-of-memory
conditions with in-flight IO and subsequent reconnection.

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

8 years agoMake GCC happy by removing empty #elif.
bdrewery [Fri, 25 Mar 2016 04:16:04 +0000 (04:16 +0000)]
Make GCC happy by removing empty #elif.

Sponsored by: EMC / Isilon Storage Division

8 years agotcp/lro: Return TCP_LRO_NO_ENTRIES if we are short of LRO entries.
sephe [Fri, 25 Mar 2016 02:54:13 +0000 (02:54 +0000)]
tcp/lro: Return TCP_LRO_NO_ENTRIES if we are short of LRO entries.

So that callers could react accordingly.

Reviewed by: gallatin (no objection)
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5695

8 years agoRemove dependency on mbuf provider as mbuf SDTs are now in the SDT space.
gnn [Fri, 25 Mar 2016 00:33:55 +0000 (00:33 +0000)]
Remove dependency on mbuf provider as mbuf SDTs are now in the SDT space.

Sponsored by: Rubicon Communications (Netgate)

8 years agoRemove unneeded return left from refactoring.
bdrewery [Fri, 25 Mar 2016 00:14:56 +0000 (00:14 +0000)]
Remove unneeded return left from refactoring.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoUnify ichwd(4) attachment messages in dmesg.
mav [Thu, 24 Mar 2016 23:24:00 +0000 (23:24 +0000)]
Unify ichwd(4) attachment messages in dmesg.

MFC after: 2 weeks

8 years agoRegenerate system call table after r297247.
ed [Thu, 24 Mar 2016 21:49:39 +0000 (21:49 +0000)]
Regenerate system call table after r297247.

8 years agoTurn on $FreeBSD$ keyword expansion to the system call table.
ed [Thu, 24 Mar 2016 21:48:41 +0000 (21:48 +0000)]
Turn on $FreeBSD$ keyword expansion to the system call table.

8 years agoFix off-by-one found by GCC 5.3.2.
bdrewery [Thu, 24 Mar 2016 21:48:16 +0000 (21:48 +0000)]
Fix off-by-one found by GCC 5.3.2.

This was fixed during refactoring in the upstream infiniband-diags 1.5.3.

Sponsored by: EMC / Isilon Storage Division

8 years agoCCACHE_BUILD: Don't use ccache when generating some files with CC -E.
bdrewery [Thu, 24 Mar 2016 21:48:13 +0000 (21:48 +0000)]
CCACHE_BUILD: Don't use ccache when generating some files with CC -E.

At least for ncurses this fixes a build error due to it trying to run
'ccache --version' to work around a gcc 5 bug using the fix in r287205.

Sponsored by: EMC / Isilon Storage Division

8 years agoDon't reset CC away from full-pathed gcc.
bdrewery [Thu, 24 Mar 2016 21:48:10 +0000 (21:48 +0000)]
Don't reset CC away from full-pathed gcc.

This was breaking the build when using CROSS_TOOLCHAIN=powerpc64-gcc

Sponsored by: EMC / Isilon Storage Division

8 years agoExplicit 'make obj' for library dirs in build32 is not needed.
bdrewery [Thu, 24 Mar 2016 21:48:01 +0000 (21:48 +0000)]
Explicit 'make obj' for library dirs in build32 is not needed.

In r138291 some directories were explicitly made to run 'make obj',
but each target in 'make libraries' already runs 'make obj' for
each library since r161580.

Sponsored by: EMC / Isilon Storage Division

8 years agoReplace the CloudABI system call table by a machine generated version.
ed [Thu, 24 Mar 2016 21:47:15 +0000 (21:47 +0000)]
Replace the CloudABI system call table by a machine generated version.

The type definitions and constants that were used by COMPAT_CLOUDABI64
are a literal copy of some headers stored inside of CloudABI's C
library, cloudlibc. What is annoying is that we can't make use of
cloudlibc's system call list, as the format is completely different and
doesn't provide enough information. It had to be synced in manually.

We recently decided to solve this (and some other problems) by moving
the ABI definitions into a separate file:

https://github.com/NuxiNL/cloudabi/blob/master/cloudabi.txt

This file is processed by a pile of Python scripts to generate the
header files like before, documentation (markdown), but in our case more
importantly: a FreeBSD system call table.

This change discards the old files in sys/contrib/cloudabi and replaces
them by the latest copies, which requires some minor changes here and
there. Because cloudabi.txt also enforces consistent names of the system
call arguments, we have to patch up a small number of system call
implementations to use the new argument names.

The new header files can also be included directly in FreeBSD kernel
space without needing any includes/defines, so we can now remove
cloudabi_syscalldefs.h and cloudabi64_syscalldefs.h. Patch up the
sources to include the definitions directly from sys/contrib/cloudabi
instead.

8 years agoPull in r264335 from upstream llvm trunk:
dim [Thu, 24 Mar 2016 20:55:23 +0000 (20:55 +0000)]
Pull in r264335 from upstream llvm trunk:

  Add <atomic> to ThreadPool.h, since std::atomic is used

  Summary:
  Apparently, when compiling with gcc 5.3.2 for powerpc64, the order of
  headers is such that it gets an error about std::atomic<> use in
  ThreadPool.h, since this header is not included explicitly.  See also:

  https://llvm.org/bugs/show_bug.cgi?id=27058

  Fix this by including <atomic>.  Patch by Bryan Drewery.

  Reviewers: chandlerc, joker.eph

  Subscribers: bdrewery, llvm-commits

  Differential Revision: http://reviews.llvm.org/D18460

8 years agoPolish wbwd(4) driver and add more supported chips.
mav [Thu, 24 Mar 2016 20:52:35 +0000 (20:52 +0000)]
Polish wbwd(4) driver and add more supported chips.

MFC after: 1 month

8 years agoelfcopy: overhaul of LMA handling
emaste [Thu, 24 Mar 2016 20:13:17 +0000 (20:13 +0000)]
elfcopy: overhaul of LMA handling

Merge ELF Tool Chain r3434:

    Previously, elfcopy defines:

    VMA:  section virtual address
    LMA:  PHDR(p_vaddr)

    While binutils(libbfd) defines:

    VMA:  section virtual address and PHDR(p_vaddr).
    LMA:  PHDR(p_paddr)

    For elfcopy, p_paddr is considered not meaningful and is always set
    to the same value as p_vaddr.

    elfcopy was implemented that way because I thought p_paddr is not
    used/meaningful according to the ELF ABI. However it turned out
    p_paddr is at least used in some ELF files, e.g. the FreeBSD kernel.

    This change made elfcopy treat p_paddr as LMA, same as libbfd.

    (However, some VMA/LMA related command line option still need tweaking
    to make them compatible with binutils objcopy. This will be improved
    later)

    Ticket: #524

And typo fixes in r3435 and r3436.

This fixes the Xen kernel build.

Submitted by: kaiw
Tested by: royger

8 years agoSpace and style(9) corrections for recent mbuf changes.
glebius [Thu, 24 Mar 2016 20:06:52 +0000 (20:06 +0000)]
Space and style(9) corrections for recent mbuf changes.

8 years agolibc: stop exporting curbrk and minbrk in the private namespace
emaste [Thu, 24 Mar 2016 18:47:19 +0000 (18:47 +0000)]
libc: stop exporting curbrk and minbrk in the private namespace

They are not used anywhere else in the base system and are an internal
implementation detail that does not need to be exposed.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5728

8 years agoAdd 4k enabled cam quirks for Samsung SM863 Series SSDs
sbruno [Thu, 24 Mar 2016 14:20:33 +0000 (14:20 +0000)]
Add 4k enabled cam quirks for Samsung SM863 Series SSDs

Submitted by: Jason (j@nitrology.com)
MFC after: 2 weeks
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D5711

8 years agoSpeed up lookups in autofs(5) by using red-black trees instead of linear
trasz [Thu, 24 Mar 2016 13:34:39 +0000 (13:34 +0000)]
Speed up lookups in autofs(5) by using red-black trees instead of linear
searches.

Reviewed by: kib@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5627

8 years agoarm64: Fixing user space boudary checking in copyinout.S
wma [Thu, 24 Mar 2016 13:28:33 +0000 (13:28 +0000)]
arm64: Fixing user space boudary checking in copyinout.S

Big buffer size could cause integer overflow and as a result
attempt to copy beyond VM_USERMAX_ADDRESS.

Fixing copyinstr boundary checking where compared value has been
overwritten by accident when setting fault handler.

Submitted by:          Dominik Ermel <der@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           kib
Differential Revision: https://reviews.freebsd.org/D5719

8 years agoFix compile errors after r297225:
bz [Thu, 24 Mar 2016 11:40:10 +0000 (11:40 +0000)]
Fix compile errors after r297225:

- properly V_irtualise variable access unbreaking VIMAGE kernels.
- remove the volatile from the function return type to make architecture
  using gcc happy [-Wreturn-type]
  "type qualifiers ignored on function return type"
  I am not entirely happy with this solution putting the u_int there
  but it will do for now.

8 years agoUnify ignoring EEXIST from zvol_create_minor().
mav [Thu, 24 Mar 2016 10:10:41 +0000 (10:10 +0000)]
Unify ignoring EEXIST from zvol_create_minor().

This fixes creation of zvol devices for snapshots during zfs receive,
that previously failed with "ZFS WARNING: Unable to create ZVOL" message.
This solution is not perfect, but IMHO better then it was before.

MFC after: 2 weeks

8 years agoHandle the driver KPI change from r292373. Ensure that managed device
kib [Thu, 24 Mar 2016 09:56:53 +0000 (09:56 +0000)]
Handle the driver KPI change from r292373.  Ensure that managed device
pagers fault routines always return with a result page, be it the
proper and valid result page, or initially passed freshly allocated
placeholder.  Do not free the passed in page until we are able to
provide the replacement, and do not assign NULL to *mres.

Reported and tested by: dumbbell
Reviewed by: royger (who also verified that Xen code is safe)
Sponsored by: The FreeBSD Foundation

8 years agoGeneralize IPI support for ARM intrng and use it for interrupt
skra [Thu, 24 Mar 2016 09:55:11 +0000 (09:55 +0000)]
Generalize IPI support for ARM intrng and use it for interrupt
controller IPI provider.

New struct intr_ipi is defined which keeps all info about an IPI:
its name, counter, send and dispatch methods. Generic intr_ipi_setup(),
intr_ipi_send() and intr_ipi_dispatch() functions are implemented.

An IPI provider must implement two functions:
(1) an intr_ipi_send_t function which is able to send an IPI,
(2) a setup function which initializes itself for an IPI and
    calls intr_ipi_setup() with appropriate arguments.

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

8 years agoAdd more UHCI PCI IDs.
hselasky [Thu, 24 Mar 2016 09:35:29 +0000 (09:35 +0000)]
Add more UHCI PCI IDs.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>

8 years agoMove mbuf provider under SDT to indicate that it is FreeBSD specific
gnn [Thu, 24 Mar 2016 08:26:06 +0000 (08:26 +0000)]
Move mbuf provider under SDT to indicate that it is FreeBSD specific
and not a stable interface.

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D5716

8 years agoInstall a usable mailer.conf for dragonfly mailer agent if sendmail is disabled
bapt [Thu, 24 Mar 2016 08:25:05 +0000 (08:25 +0000)]
Install a usable mailer.conf for dragonfly mailer agent if sendmail is disabled

8 years agoFreeBSD previously provided route caching for TCP (and UDP). Re-add
gnn [Thu, 24 Mar 2016 07:54:56 +0000 (07:54 +0000)]
FreeBSD previously provided route caching for TCP (and UDP). Re-add
route caching for TCP, with some improvements. In particular, invalidate
the route cache if a new route is added, which might be a better match.
The cache is automatically invalidated if the old route is deleted.

Submitted by: Mike Karels
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D4306

8 years agoPass the expected struct radix_node_head * to vfs_free_netcred.
bdrewery [Thu, 24 Mar 2016 04:40:07 +0000 (04:40 +0000)]
Pass the expected struct radix_node_head * to vfs_free_netcred.

No functional change.

struct radix_node_head's first element is rh so this was already
referring to the same address.  It was likely an unintended
s/rnh/&rnh->rh/ change from r294706 as all other rnh_walktree() callers
pass the expected struct radix_node_head * rather than obscurely passing
the address of their first element.

Sponsored by: EMC / Isilon Storage Division

8 years agoFix M_RTABLE memory leak from r274118 (11/2014).
bdrewery [Thu, 24 Mar 2016 03:08:39 +0000 (03:08 +0000)]
Fix M_RTABLE memory leak from r274118 (11/2014).

Replace free(M_RTABLE) with rn_detachhead() to match rn_inithead().

This would trigger when reloading NFS exports and was similar to
problems with pf reload [1].

PR: 194078 [1]
Sponsored by: EMC / Isilon Storage Division

8 years agohyperv/vmbus: Create per-cpu fast taskqueue for msg handling
sephe [Thu, 24 Mar 2016 02:15:23 +0000 (02:15 +0000)]
hyperv/vmbus: Create per-cpu fast taskqueue for msg handling

Using one taskqueue does not work, since the EOM MSR must be written
on the msg's owner CPU.

Noticed by: Jun Su <junsu microsoft com>
Discussed with: Jun Su <junsu microsoft com>, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC

8 years agohyperv/utils: Allow hint to disable individual utility
sephe [Thu, 24 Mar 2016 01:12:28 +0000 (01:12 +0000)]
hyperv/utils: Allow hint to disable individual utility

Reviewed by: kib, Dexuan Cui <decui microsoft com>
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5714

8 years agohyperv/vmbus: use a better retry method in hv_vmbus_post_message()
sephe [Thu, 24 Mar 2016 00:40:41 +0000 (00:40 +0000)]
hyperv/vmbus: use a better retry method in hv_vmbus_post_message()

Most often, hv_vmbus_post_message() doesn't fail.  However, it fails
intermittently when GPADLs of large shared memory is to be established
with the host, e.g. on the hn(4) attach path: a GPADL of 15MB sendbuf
is created, for which lots of messages will be flooded to the host.
The host side tries to throttle the message rate by returning
HV_STATUS_INSUFFICIENT_BUFFERS.

Before this commit, we do several retries for failed messages, but the
delay between each retry is pretty/too low, which will cause sporadic
message posting failure.  We now use large delay (>=1ms) between each
retry to fix the message posting failure.

Submitted by: Dexuan Cui <decui microsoft com>
Reviewed by: sephe
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D5715

8 years agoEnable interrupts on the BSP once all PICs are initialized.
jhb [Thu, 24 Mar 2016 00:24:07 +0000 (00:24 +0000)]
Enable interrupts on the BSP once all PICs are initialized.

This moves the enabling of interrupts slightly earlier (the old location
was still before devices were enumerated and probed) and does it in the
interrupt code (rather than in the device configuration code).  This
also avoids tripping over an assertion on the first TLB shootdown with
earlier AP startup.

Reviewed by: kib
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D5710

8 years agofix incorrect usage of hid_set_data() which causes crash
emax [Wed, 23 Mar 2016 22:07:13 +0000 (22:07 +0000)]
fix incorrect usage of hid_set_data() which causes crash
in bthidd(8) on amd64 WITH_SSP builds

Submitted by: rakuco
Reviewed by: rakuco
Tested by: rakuco
MFC after: 1 week

8 years agoFix support for fixed factor clocks.
jmcneill [Wed, 23 Mar 2016 19:26:53 +0000 (19:26 +0000)]
Fix support for fixed factor clocks.
 - Use a different device description for fixed and fixed factor clocks.
 - Fix a bug where the "clock-div" property was stored in the "mult" field
   of the clock definition.
 - Get the fixed factor parent clock by index instead of by name, as a
   clock-names property is not required to be present here.

Reviewed by: mmel, adrian (mentor)
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5703

8 years agoclk_parse_ofw_out_names is supposed to return a list of indices when the
jmcneill [Wed, 23 Mar 2016 19:24:09 +0000 (19:24 +0000)]
clk_parse_ofw_out_names is supposed to return a list of indices when the
clock-indices property is present, so change the "uint32_t *indices" parameter
to "uint32_t **indices" to allow this.

Reviewed by: mmel, adrian (mentor)
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5702

8 years agoReturn BUS_PROBE_GENERIC instead of 0 from ofw_clkbus_probe, giving
jmcneill [Wed, 23 Mar 2016 19:21:21 +0000 (19:21 +0000)]
Return BUS_PROBE_GENERIC instead of 0 from ofw_clkbus_probe, giving
platform specific drivers a chance to override the generic driver.

Reviewed by: mmel, adrian (mentor)
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D5701

8 years agoFor C++, expose long long types and functions (lldiv_t, llabs, lldiv,
dim [Wed, 23 Mar 2016 19:17:12 +0000 (19:17 +0000)]
For C++, expose long long types and functions (lldiv_t, llabs, lldiv,
etc) in stdlib.h.  These will be needed for newer versions of libc++,
which uses them for defining overloaded versions of abs() and div().

MFC after: 1 week

8 years agoRemove disconnected casperd, missed in r296047.
bdrewery [Wed, 23 Mar 2016 16:37:08 +0000 (16:37 +0000)]
Remove disconnected casperd, missed in r296047.

Reported by: bz

8 years agoARM64 copyinout improvements
wma [Wed, 23 Mar 2016 13:29:52 +0000 (13:29 +0000)]
ARM64 copyinout improvements

The first of set of patches.
Use wider load/stores when aligned buffer is being copied.

In a simple test:
  dd if=/dev/zero of=/dev/null bs=1M count=1024
the performance jumped from 410MB/s up to 3.6GB/s.

TODO:
 - better handling of unaligned buffers (WiP)
 - implement similar mechanism to bzero

Submitted by:          Dominik Ermel <der@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Cavium
Reviewed by:           kib, andrew, emaste
Differential Revision: https://reviews.freebsd.org/D5664

8 years agoAdd const to several constants. Thanks to Nicholas Nethercote for
tuexen [Wed, 23 Mar 2016 13:28:04 +0000 (13:28 +0000)]
Add const to several constants. Thanks to Nicholas Nethercote for
providing the patch via
https://bugzilla.mozilla.org/show_bug.cgi?id=1255655

MFC after: 1 week

8 years agoMake the autofs(5) -hosts map more robust, primarily to make it correctly
trasz [Wed, 23 Mar 2016 12:13:53 +0000 (12:13 +0000)]
Make the autofs(5) -hosts map more robust, primarily to make it correctly
handle NFS shares containing whitespace. This also adds the -E parameter
to showmount(8).

Reviewed by: emaste@, jhibbits@, wblock@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D5649

8 years agoFix locking mistake in softdep_waitidle(). The surrounding code
kib [Wed, 23 Mar 2016 09:58:51 +0000 (09:58 +0000)]
Fix locking mistake in softdep_waitidle().  The surrounding code
expects that the loop is always exited with the SU lock owned, even on
error.

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

8 years agoImplement suggestion by jhb@ to have _PATH_FIRMWARE instead of hard
imp [Wed, 23 Mar 2016 04:18:57 +0000 (04:18 +0000)]
Implement suggestion by jhb@ to have _PATH_FIRMWARE instead of hard
coding it to be "/usr/share/firmware".

8 years agoHandle copyin failures.
bdrewery [Tue, 22 Mar 2016 22:41:14 +0000 (22:41 +0000)]
Handle copyin failures.

Skip the log entry as there is nothing good to write out.  Don't fail
the syscall though since it already succeeded.  There's no reason
filemon's tracing failure should fail the already-succeeded syscall.

Record the error for later to return from close(2) on the filemon devfs
file descriptor.

Discussed with: markj, sjg, kib (briefly with kib)
Reported by: mjg
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoRemove unused done argument to copyinstr(9).
bdrewery [Tue, 22 Mar 2016 22:41:10 +0000 (22:41 +0000)]
Remove unused done argument to copyinstr(9).

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoReturn any log write failure encountered when closing the filemon fd.
bdrewery [Tue, 22 Mar 2016 22:41:07 +0000 (22:41 +0000)]
Return any log write failure encountered when closing the filemon fd.

Discussed with: sjg, markj
Reviewed by: sjg
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFollow-up r297156: Close the log in filemon_dtr rather than in the last reference.
bdrewery [Tue, 22 Mar 2016 22:41:03 +0000 (22:41 +0000)]
Follow-up r297156: Close the log in filemon_dtr rather than in the last reference.

If the tracer has decided to the close the log then it should be fully
written, not getting more entries, when close(2) returns.  This was
a regression in r297156 in that it allowed a traced process to continue
a traced syscall and add more entries to the log while the tracer had
already closed its fd or exited.  This was only really part of the
daemonized process case which is abnormal.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agoFix the resource_list_print_type() calls to use uintmax_t.
jhibbits [Tue, 22 Mar 2016 22:25:08 +0000 (22:25 +0000)]
Fix the resource_list_print_type() calls to use uintmax_t.

Missed a bunch from r297000.

8 years ago[net80211] add missing static declarations.
adrian [Tue, 22 Mar 2016 22:07:14 +0000 (22:07 +0000)]
[net80211] add missing static declarations.

Submitted by: Sascha Wildner <saw@online.de>
Obtained from: dragonflybsd (https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/822aeeabc8c4c074deea46383f36e6d1cdcd19f5)

8 years agoSpell out 'system calls'.
bdrewery [Tue, 22 Mar 2016 19:39:50 +0000 (19:39 +0000)]
Spell out 'system calls'.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division

8 years agocxgbe(4): Be consistent and call ETHER_BPF_MTAP before writing anything
np [Tue, 22 Mar 2016 18:56:23 +0000 (18:56 +0000)]
cxgbe(4): Be consistent and call ETHER_BPF_MTAP before writing anything
to the descriptor ring no matter what path the frame takes within the
driver's tx.

8 years agoto_flags is currently a 64-bit integer; however, we only use 7 bits.
jtl [Tue, 22 Mar 2016 15:55:17 +0000 (15:55 +0000)]
to_flags is currently a 64-bit integer; however, we only use 7 bits.
Furthermore, there is no reason this needs to be a 64-bit integer
for the forseeable future.

Also, there is an inconsistency between to_flags and the mask in
tcp_addoptions(). Before r195654, to_flags was a u_long and the mask in
tcp_addoptions() was a u_int. r195654 changed to_flags to be a u_int64_t
but left the mask in tcp_addoptions() as a u_int, meaning that these
variables will only be the same width on platforms with 64-bit integers.

Convert both to_flags and the mask in tcp_addoptions() to be explicitly
32-bit variables. This may save a few cycles on 32-bit platforms, and
avoids unnecessarily mixing types.

Differential Revision: https://reviews.freebsd.org/D5584
Reviewed by: hiren
MFC after: 2 weeks
Sponsored by: Juniper Networks

8 years agoMfp4 @180378:
bz [Tue, 22 Mar 2016 15:43:47 +0000 (15:43 +0000)]
Mfp4 @180378:

  Factor out nd6 and in6_attach initialization to their own files.
  Also move destruction into those files though still called from
  the central initialization.

  Sponsored by: CK Software GmbH
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D5033

8 years agoCorrect comment.
bz [Tue, 22 Mar 2016 14:08:00 +0000 (14:08 +0000)]
Correct comment.

MFC after: 2 weeks

8 years agoWait for root mount tokens before showing the root mount prompt.
trasz [Tue, 22 Mar 2016 13:46:01 +0000 (13:46 +0000)]
Wait for root mount tokens before showing the root mount prompt.
This restores the pre-r290196 behaviour, eliminating the need to manually
press '.' a couple of times to get USB to finish probing.

Note that there's still something wrong with the console (character
echoing doesn't quite work), and there's also a reported problem with
BHyVe, but those two don't seem related to the problem above.

MFC after: 1 month
Sponsored by: The FreeBSD Foundation

8 years agoAdd an mbuf provider to DTrace.
gnn [Tue, 22 Mar 2016 13:16:52 +0000 (13:16 +0000)]
Add an mbuf provider to DTrace.

The mbuf provider is made up of a set of Statically Defined Tracepoints
which help us look into mbufs as they are allocated and freed.  This can be
used to inspect the buffers or for a simplified mbuf leak detector.

New tracepoints are:

mbuf:::m-init
mbuf:::m-gethdr
mbuf:::m-get
mbuf:::m-getcl
mbuf:::m-clget
mbuf:::m-cljget
mbuf:::m-cljset
mbuf:::m-free
mbuf:::m-freem

There is also a translator for mbufs which gives some visibility into the structure,
see mbuf.d for more details.

Reviewed by: bz, markj
MFC after: 2 weeks
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D5682

8 years agoSupport checksum offloading for TCP/IPV6 and UDP/IPV6.
tuexen [Tue, 22 Mar 2016 12:40:09 +0000 (12:40 +0000)]
Support checksum offloading for TCP/IPV6 and UDP/IPV6.
Support SCTP checksum offloading for SCTP/IPV6.
Support SCTP checksum offloading on all controllers except 82575.

Reviewed by: sbruno@, erj@
MFC after:  4 weeks
Differential Revision: D5193

8 years agoAdding pci_host_generic unconditionally breaks ARM boards with a PCI(e) interface.
bz [Tue, 22 Mar 2016 12:12:01 +0000 (12:12 +0000)]
Adding pci_host_generic unconditionally breaks ARM boards with a PCI(e) interface.
Make it a device option to be included in the kernel configs that request this file.

Reported by: mmel
Suggested by: mmel
Reviewed by: mmel
Differential Revision: https://reviews.freebsd.org/D5699

8 years agoApparently there are some popular programs around which assume that it
kib [Tue, 22 Mar 2016 10:51:42 +0000 (10:51 +0000)]
Apparently there are some popular programs around which assume that it
is safe to call pthread_mutex_init() on the same shared mutex several
times.  POSIX claims that the behaviour in this case is undefined.

Make this working by only allowing one caller to initialize the mutex.
Other callers either see already completed initialization and do
nothing, or busy-loop yielding while designated initializer finishes.
Also make the API requirements loose by initializing mutexes on other
pthread_mutex*() calls if they see uninitialized shared mutex.

Only mutexes provide the hack for now, but it could be also
implemented for other process shared primitives from libthr.

Reported and tested by: "Oleg V. Nauman" <oleg@opentransfer.com>
Sponsored by: The FreeBSD Foundation

8 years agoUse the saved program state register to detect when an exception frame is
andrew [Tue, 22 Mar 2016 08:36:25 +0000 (08:36 +0000)]
Use the saved program state register to detect when an exception frame is
from userpsace. Previously we could have triggered a panic by trying to
jump to a kernel address from userland as the trap handling code thought we
received an ast in kernel mode.

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

8 years agoUse a SKIP testplan instead of bailing out if/when the tester isn't
ngie [Tue, 22 Mar 2016 08:12:45 +0000 (08:12 +0000)]
Use a SKIP testplan instead of bailing out if/when the tester isn't
root, or the geom class can't be loaded cleanly [*]

This makes sure that scenarios that are easy to hit aren't counted
as false positives with kyua test

MFC after: 1 week
PR: 208101
Sponsored by: EMC / Isilon Storage Division

8 years agohyperv/hn: When short of mbufs on the RX path, don't spam the console.
sephe [Tue, 22 Mar 2016 07:08:47 +0000 (07:08 +0000)]
hyperv/hn: When short of mbufs on the RX path, don't spam the console.

Instead, increase the IQDROPS counter.

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

8 years agohyperv/hn: Factor out hn_set_lro_lenlim()
sephe [Tue, 22 Mar 2016 06:42:24 +0000 (06:42 +0000)]
hyperv/hn: Factor out hn_set_lro_lenlim()

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