]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoMerge ^/head r304885 through r304954.
dim [Sun, 28 Aug 2016 11:58:15 +0000 (11:58 +0000)]
Merge ^/head r304885 through r304954.

7 years agoSquelch -Wconstant-conversion for WARNS <= 2. In clang 3.9.0, this
dim [Sun, 28 Aug 2016 11:54:45 +0000 (11:54 +0000)]
Squelch -Wconstant-conversion for WARNS <= 2.  In clang 3.9.0, this
warning has become more aggressive, and it usually turns up in decades
old code, where fixing it is more trouble than it is worth.

7 years agoDefine ipfilter's SOLARIS macro in a defined and portable way.
dim [Sun, 28 Aug 2016 11:51:46 +0000 (11:51 +0000)]
Define ipfilter's SOLARIS macro in a defined and portable way.

Reviewed by: cy
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D7671

7 years agoRemove duplicated declaration.
oshogbo [Sun, 28 Aug 2016 07:40:11 +0000 (07:40 +0000)]
Remove duplicated declaration.

Reported by: adrian@

7 years ago[ath_hal] add USB PHY control registers for hornet/AR9330.
adrian [Sun, 28 Aug 2016 05:42:03 +0000 (05:42 +0000)]
[ath_hal] add USB PHY control registers for hornet/AR9330.

Obtained from: linux ath9k

7 years ago[net80211] fix up wlanwds to compile without warnings on clang.
adrian [Sun, 28 Aug 2016 04:54:02 +0000 (04:54 +0000)]
[net80211] fix up wlanwds to compile without warnings on clang.

7 years agoFix UART PPS capture mode printing
jhibbits [Sun, 28 Aug 2016 04:40:27 +0000 (04:40 +0000)]
Fix UART PPS capture mode printing

* Add breaks to prevent fallthrough and printing of multiple modes.
* Only check the mode, mask out all other bits.

7 years ago[mips] move AR91XX_BASE to std.AR91XX.
adrian [Sun, 28 Aug 2016 04:10:23 +0000 (04:10 +0000)]
[mips] move AR91XX_BASE to std.AR91XX.

7 years ago[mips] migrate the QCA955X_BASE file to std.QCA955X, to bring this in line with
adrian [Sun, 28 Aug 2016 04:08:26 +0000 (04:08 +0000)]
[mips] migrate the QCA955X_BASE file to std.QCA955X, to bring this in line with
other board defaults.

7 years agoUse ALT_BREAK_TO_DEBUGGER as well.
adrian [Sun, 28 Aug 2016 04:08:04 +0000 (04:08 +0000)]
Use ALT_BREAK_TO_DEBUGGER as well.

7 years ago.. and since others are using wdr3600/wdr4300 right now and are having
adrian [Sun, 28 Aug 2016 04:07:34 +0000 (04:07 +0000)]
.. and since others are using wdr3600/wdr4300 right now and are having
arge issues with spammed interrupts / link issues, flip on ARGE_DEBUG too.

7 years agoSince i'm using carambola 2 for more debugging, enable ARGE_DEBUG by default.
adrian [Sun, 28 Aug 2016 04:06:57 +0000 (04:06 +0000)]
Since i'm using carambola 2 for more debugging, enable ARGE_DEBUG by default.

7 years ago[mips] make AR933X boards use ALT_BREAK_TO_DEBUGGER like the rest of the Atheros...
adrian [Sun, 28 Aug 2016 04:06:36 +0000 (04:06 +0000)]
[mips] make AR933X boards use ALT_BREAK_TO_DEBUGGER like the rest of the Atheros boards.

7 years ago[mips] QCA955x config file changes to bring things into alignment with the other...
adrian [Sun, 28 Aug 2016 04:03:52 +0000 (04:03 +0000)]
[mips] QCA955x config file changes to bring things into alignment with the other atheros config files.

* ALT_BREAK_TO_DEBUGGER, because we get random breaks when unplugging USB
  to serial adapters
* Build more modules!

7 years agoFollow ABI when calling __error from the ptrace(2) wrapper.
kib [Sun, 28 Aug 2016 00:26:06 +0000 (00:26 +0000)]
Follow ABI when calling __error from the ptrace(2) wrapper.

In particular, preserve syscall arguments on stack, since callee is
not required to preserve arg-passing registers.  Align stack.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoDo not obliterate errno value in the main thread during ptrace(2) call on x86.
kib [Sat, 27 Aug 2016 23:03:23 +0000 (23:03 +0000)]
Do not obliterate errno value in the main thread during ptrace(2) call on x86.

Since ptrace(2) syscall can return -1 for non-error situations, libc
wrappers set errno to 0 before performing the syscall, as the service
to the caller.  On both i386 and amd64, the errno symbol was directly
referenced, which only works correctly in single-threaded process.

Change assembler wrappers for ptrace(2) to get current thread errno
location by calling __error().  Allow __error interposing, as
currently allowed in cerror().

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agovfs: provide a common exit point in namei for error cases
mjg [Sat, 27 Aug 2016 22:43:41 +0000 (22:43 +0000)]
vfs: provide a common exit point in namei for error cases

This shortens the function, adds the SDT_PROBE use for error cases and
consistenly unrefs rootdir last.

Reviewed by: kib
MFC after: 2 weeks

7 years agoIn ncurses baudrate definitions, avoid warnings about implicit
dim [Sat, 27 Aug 2016 20:33:19 +0000 (20:33 +0000)]
In ncurses baudrate definitions, avoid warnings about implicit
conversions from int to short changing the values.  This applies to
B38400 and higher, since their values do not fit into a short.

However, since the wrapped values are still unique, and they only serve
as keys, there is no problem in adding a cast to silence the warnings.
This also avoids changing the ABI, which would happen if we changed
NCURSES_OSPEED to int.

Discussed with: Thomas Dickey
MFC after: 1 week

7 years agoDecode some new ATA commands found in ACS-3.
mav [Sat, 27 Aug 2016 19:51:37 +0000 (19:51 +0000)]
Decode some new ATA commands found in ACS-3.

MFC after: 1 week

7 years agoConsistently delimit each vnode description block with two blank
kib [Sat, 27 Aug 2016 18:12:42 +0000 (18:12 +0000)]
Consistently delimit each vnode description block with two blank
lines.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

7 years agoBump date in the man page.
oshogbo [Sat, 27 Aug 2016 18:08:25 +0000 (18:08 +0000)]
Bump date in the man page.

7 years agoCompile clang, lldb and related tools with WARNS=3 by default.
dim [Sat, 27 Aug 2016 16:01:10 +0000 (16:01 +0000)]
Compile clang, lldb and related tools with WARNS=3 by default.

7 years agoTentatively apply https://reviews.llvm.org/D23960, to squelch errors
dim [Sat, 27 Aug 2016 15:59:32 +0000 (15:59 +0000)]
Tentatively apply https://reviews.llvm.org/D23960, to squelch errors
about narrowing in <bitset>.

7 years agoAdd missed header file for cnv.h .
oshogbo [Sat, 27 Aug 2016 15:22:55 +0000 (15:22 +0000)]
Add missed header file for cnv.h .

Submitted by: Adam Starak <starak.adam@gmail.com>
Reported by: ache@

7 years agoThe formal behavior of qsort is unstable with regard to objects that
ache [Sat, 27 Aug 2016 14:43:13 +0000 (14:43 +0000)]
The formal behavior of qsort is unstable with regard to objects that
are equal. Unfortunately, RFC 3484 requires that otherwise equal objects
remain in the order supplied by the DNS server. The present code attempts
to deal with this by returning -1 for objects that are equal (i.e.,
returns that the first parameter is less then the second parameter).
Unfortunately, the qsort API does not state that the first parameter
passed in is in any particular position in the list.

PR:     212122
Submitted by:   Herbie.Robinson@stratus.com
MFC after:      3 days

7 years agoIntroduce cnv man page.
oshogbo [Sat, 27 Aug 2016 13:47:52 +0000 (13:47 +0000)]
Introduce cnv man page.

Submitted by: Adam Starak <starak.adam@gmail.com>
Reviewed by: cem@, wblock@
Differential Revision: https://reviews.freebsd.org/D7249

7 years agoFix style issue in the cnv API.
oshogbo [Sat, 27 Aug 2016 13:40:27 +0000 (13:40 +0000)]
Fix style issue in the cnv API.
Remove unused arguments in a macro.
Remove unused typedef.

7 years agoAdd cnv API.
oshogbo [Sat, 27 Aug 2016 13:37:30 +0000 (13:37 +0000)]
Add cnv API.

cnv API is a set of functions for managing name/value pairs by cookie.
The cookie can be obtained by nvlist_next(), nvlist_get_parent() or
nvlist_get_pararr() function. This patch also includes unit tests.

Submitted by: Adam Starak <starak.adam@gmail.com>

7 years agoDo not try to build cloudabi32 for pc98.
bz [Sat, 27 Aug 2016 12:41:15 +0000 (12:41 +0000)]
Do not try to build cloudabi32 for pc98.

Should unbreak tinderbox.

7 years agoUpdate llvm to release_39 branch r279689.
dim [Sat, 27 Aug 2016 11:51:08 +0000 (11:51 +0000)]
Update llvm to release_39 branch r279689.

7 years agoFix build without INET6 and with gcc. A function definition was ifdefed
bde [Sat, 27 Aug 2016 11:06:06 +0000 (11:06 +0000)]
Fix build without INET6 and with gcc.  A function definition was ifdefed
for INET6, but its protototype was not, and gcc detects the error.

7 years agoPrint both the kernel read and write translation in DDB when asking for
andrew [Sat, 27 Aug 2016 10:30:20 +0000 (10:30 +0000)]
Print both the kernel read and write translation in DDB when asking for
a virtual to physical translation. These may be different, e.g. when a
page is mapped as read-only.

MFC after: 1 month
Sponsored by: ABT Systems Ltd

7 years agoiwm: fix few comment typos.
avos [Sat, 27 Aug 2016 10:04:48 +0000 (10:04 +0000)]
iwm: fix few comment typos.

7 years agoCentralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.
dim [Sat, 27 Aug 2016 10:00:33 +0000 (10:00 +0000)]
Centralize where LLVM_SRCS, CLANG_SRCS and LLDB_SRCS are defined.

7 years agoMissed one .mk file where OBJTOP can be used.
dim [Sat, 27 Aug 2016 09:51:57 +0000 (09:51 +0000)]
Missed one .mk file where OBJTOP can be used.

7 years agoProperly use MACHINE_CPUARCH for finding cloudabi*_sysvec.c.
ed [Sat, 27 Aug 2016 09:50:11 +0000 (09:50 +0000)]
Properly use MACHINE_CPUARCH for finding cloudabi*_sysvec.c.

The build of the cloudabi32 kernel module currently fails for PC98. In
the case of PC98, we just want to use the code for i386.

Reported by: np

7 years agoMerge ^/head r304700 through r304884.
dim [Sat, 27 Aug 2016 09:40:29 +0000 (09:40 +0000)]
Merge ^/head r304700 through r304884.

7 years agoUse SRCTOP and OBJTOP throughout the llvm/clang/lldb build.
dim [Sat, 27 Aug 2016 09:29:39 +0000 (09:29 +0000)]
Use SRCTOP and OBJTOP throughout the llvm/clang/lldb build.

7 years agoiwm: add 'command accepted' debug notification (copied from wpi(4)).
avos [Sat, 27 Aug 2016 08:34:20 +0000 (08:34 +0000)]
iwm: add 'command accepted' debug notification (copied from wpi(4)).

Now it should be easier to find out which command causes firmware
panics when few commands are sent in a short period of time.

7 years agoRemove warning on struct-overflow on gcc 5.3.0 as zic(8) dies on it
bapt [Sat, 27 Aug 2016 01:28:00 +0000 (01:28 +0000)]
Remove warning on struct-overflow on gcc 5.3.0 as zic(8) dies on it

7 years agoImplement siba(4) support for bhnd_(read|write)_config.
landonf [Sat, 27 Aug 2016 00:58:21 +0000 (00:58 +0000)]
Implement siba(4) support for bhnd_(read|write)_config.

This provides access to the siba(4) bus-mapped per-core cfg0 register
block.

Approved by: adrian (mentor, implicit)

7 years agoUse printable ASCII instead of octal representation.
delphij [Sat, 27 Aug 2016 00:56:37 +0000 (00:56 +0000)]
Use printable ASCII instead of octal representation.

MFC after: 2 weeks

7 years agoTemporarily disable two libarchive tests that have not yet been fixed by
mm [Sat, 27 Aug 2016 00:47:47 +0000 (00:47 +0000)]
Temporarily disable two libarchive tests that have not yet been fixed by
vendor. Tests will be re-enabled after a fix has been merged.

MFC after: 3 days

7 years agocxgbe(4): Provide more details about the card in the sysctl MIB.
np [Sat, 27 Aug 2016 00:13:41 +0000 (00:13 +0000)]
cxgbe(4): Provide more details about the card in the sysctl MIB.

dev.t5nex.0.%desc: Chelsio T580-CR
dev.t5nex.0.hw_revision: 1
dev.t5nex.0.sn: PT13140042
dev.t5nex.0.pn: 110117150A0
dev.t5nex.0.ec: 0000000000000000
dev.t5nex.0.na: 0007432AF490
dev.t5nex.0.vpd_version: 3
dev.t5nex.0.scfg_version: 53255
dev.t5nex.0.bs_version: 1.1.0.0
dev.t5nex.0.er_version: 1.0.0.68
dev.t5nex.0.tp_version: 0.1.4.9
dev.t5nex.0.firmware_version: 1.16.2.0

Sponsored by: Chelsio Communications

7 years agobhnd(4): Include the chip model (e.g. BCM4xxx) in bhnd(4) bus's device
landonf [Sat, 27 Aug 2016 00:07:48 +0000 (00:07 +0000)]
bhnd(4): Include the chip model (e.g. BCM4xxx) in bhnd(4) bus's device
descriptions.

Reviewed by: mizhka
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7570

7 years ago[mips/broadcom]: Replace static frequency table with generic PMU clock
landonf [Sat, 27 Aug 2016 00:06:20 +0000 (00:06 +0000)]
[mips/broadcom]: Replace static frequency table with generic PMU clock
handling.

- Extended PWRCTL/PMU APIs to support querying clock frequency during very
  early boot, prior to bus attach.
- Implement generic PMU-based calculation of UART rclk values.
- Replaced use of static frequency tables (bcm_socinfo) with
  runtime-determined values.

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

7 years agobhnd(4): Initial PMU/PWRCTL power and clock management support.
landonf [Sat, 27 Aug 2016 00:03:02 +0000 (00:03 +0000)]
bhnd(4): Initial PMU/PWRCTL power and clock management support.

- Added bhnd_pmu driver implementations for PMU and PWRCTL chipsets,
  derived from Broadcom's ISC-licensed HND code.
- Added bhnd bus-level support for routing per-core clock and resource
  power requests to the PMU device.
- Lift ChipCommon support out into the bhnd module, dropping
  bhnd_chipc.

Reviewed by: mizhka
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7492

7 years agoMFV r304866:
mm [Fri, 26 Aug 2016 23:50:44 +0000 (23:50 +0000)]
MFV r304866:
Sync libarchive with vendor including security fixes

Vendor issues fixed:
Issue #731: Reject tar entries >= INT64_MAX
Issue #744 (part of Issue #743): Enforce sandbox with very long pathnames
Issue #748: Zip decompression failure with highly-compressed data
Issue #767: Buffer overflow printing a filename
Issue #770: Zip read: be more careful about extra_length

MFC after: 3 days

7 years agoAdd forgotten {llvm,clang}.pre.mk files.
dim [Fri, 26 Aug 2016 22:56:23 +0000 (22:56 +0000)]
Add forgotten {llvm,clang}.pre.mk files.

7 years agoCompletely revamp the way llvm, clang and lldb are built.
dim [Fri, 26 Aug 2016 22:44:22 +0000 (22:44 +0000)]
Completely revamp the way llvm, clang and lldb are built.

* Bootstrap llvm-tblgen and clang-tblgen with a minimal llvm static
  library, that has no other dependencies.
* Roll up all separate llvm libraries into one big static libllvm.
* Similar for all separate clang and lldb static libraries.
* For all these libraries, generate their .inc files only once.
* Link all llvm tools (including extra) against the big libllvm.
* Link clang and clang-format against the big libllvm and libclang.
* Link lldb against the big libllvm, libclang and liblldb.

N.B.: This is work in progress, some details may still be missing.

It also heavily depends on bsd.*.mk's support for SRCS and DPSRCS with
relative pathnames, which apparently does not always work as expected.
For building llvm, clang and lldb though, it seems to work just fine.

The main idea behind this restructuring is maintainability and build
peformance.  The previous large number of very small libraries, each
with their own generated files and dependencies was slow to traverse
and hard to understand.

Possible future improvements:
* Only build certain targets, e.g. for most regular users having just
  one target will be fine.  This will shave off some build time.
* Building the big llvm, clang and lldb libraries as shared (private)
  libraries.
* Adding other components from the LLVM project, such as lld.

7 years agoImprove compatibility of calls to dirname() on constant strings.
ed [Fri, 26 Aug 2016 20:23:10 +0000 (20:23 +0000)]
Improve compatibility of calls to dirname() on constant strings.

As the xinstall(8) utility had to be patched up to work with the POSIXly
correct basename()/dirname() prototypes, we make it pretty hard to build
previous versions of FreeBSD on HEAD. xinstall(8) is part of the
bootstrap tools.

Add some logic to <libgen.h> to automatically detect bad calls to
dirname() based on the type of the argument. If the argument is of type
'const char *', we simply fall back to calling into dirname@FBSD_1.0
directly.

I'll also give basename() similar treatment when importing the
thread-safe version of that function.

Tested by: bdrewery, madpilot (thanks!)

7 years ago[mips/broadcom] Generic platform_reset() support.
landonf [Fri, 26 Aug 2016 20:16:02 +0000 (20:16 +0000)]
[mips/broadcom] Generic platform_reset() support.

This adds support for performing platform_reset() on all supported
devices, using early boot enumeration of chipc capabilities and
available cores.

- Added Broadcom-specific MIPS CP0 register definitions used by
  BCM4785-specific reset handling.
- Added a bcm_platform structure for tracking chipc/pmu/cfe platform
  data.
- Extended the BCMA EROM API to support early boot lookup of core info
  (including port/region mappings).
- Extended platform_reset() to support PMU, PMU+AOB, and non-PMU
  devices.

Reviewed by: mizhka
Approved by: adrian (mentor)
Differential Revision: https://reviews.freebsd.org/D7539

7 years agoEnable I/O MMU when PCI pass through is first used.
jhb [Fri, 26 Aug 2016 20:15:22 +0000 (20:15 +0000)]
Enable I/O MMU when PCI pass through is first used.

Rather than enabling the I/O MMU when the vmm module is loaded,
defer initialization until the first attempt to pass a PCI device
through to a guest.  If the I/O MMU fails to initialize or is not
present, than fail the attempt to pass a PCI device through to a
guest.

The hw.vmm.force_iommu tunable has been removed since the I/O MMU is
no longer enabled during boot.  However, the I/O MMU support can be
disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent
use of the I/O MMU on any systems where it is buggy.

Reviewed by: grehan
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D7448

7 years agoAdjust TCP module fastpath after r304803's cc_ack_received() changes.
hiren [Fri, 26 Aug 2016 19:23:17 +0000 (19:23 +0000)]
Adjust TCP module fastpath after r304803's cc_ack_received() changes.

Reported by: hiren, bz, np
Reviewed by: rrs
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D7664

7 years agoUpdate TCPS_HAVERCVDFIN() macro to correctly include all states a connection
hiren [Fri, 26 Aug 2016 17:48:54 +0000 (17:48 +0000)]
Update TCPS_HAVERCVDFIN() macro to correctly include all states a connection
can be in after receiving a FIN.

FWIW, NetBSD has this change for quite some time.

This has been tested at Netflix and Limelight in production traffic.

Reported by: Sam Kumar <samkumar99 at gmail.com> on transport@
Reviewed by: rrs
MFC after: 4 weeks
Sponsored by: Limelight Networks
Differential Revision:  https://reviews.freebsd.org/D7475

7 years agocxgbe/iw_cxgbe: Various fixes to the iWARP driver.
np [Fri, 26 Aug 2016 17:38:13 +0000 (17:38 +0000)]
cxgbe/iw_cxgbe: Various fixes to the iWARP driver.

- Return appropriate error code instead of ENOMEM when sosend() fails in
  send_mpa_req.
- Fix for problematic race during destroy_qp.
- Abortive close in the failure of send_mpa_reject() instead of normal close.
- Remove the unnecessary doorbell flowcontrol logic.

Submitted by: Krishnamraju Eraparaju at Chelsio
MFC after: 1 month
Sponsored by: Chelsio communications

7 years agoUnused variables and cstyle fix for loader dosfs
tsoome [Fri, 26 Aug 2016 14:58:57 +0000 (14:58 +0000)]
Unused variables and cstyle fix for loader dosfs

Reviewed by: imp, allanjude
Approved by: imp (mentor), allanjude (mentor)
Differential Revision: https://reviews.freebsd.org/D7659

7 years agoDo not free an uninitialized pointer on soaccept failure in the iWARP
np [Fri, 26 Aug 2016 08:25:28 +0000 (08:25 +0000)]
Do not free an uninitialized pointer on soaccept failure in the iWARP
connection manager.

Sponsored by: Chelsio Communications

7 years agoFix a bug, where no SACK is sent when receiving a FORWARD-TSN or
tuexen [Fri, 26 Aug 2016 07:49:23 +0000 (07:49 +0000)]
Fix a bug, where no SACK is sent when receiving a FORWARD-TSN or
I-FORWARD-TSN chunk before any DATA or I-DATA chunk.

Thanks to Julian Cordes for finding this problem and prividing
packetdrill scripts to reporduce the issue.

MFC after: 3 days

7 years agohyperv/hn: Use vmbus xact for RNDIS set.
sephe [Fri, 26 Aug 2016 05:18:27 +0000 (05:18 +0000)]
hyperv/hn: Use vmbus xact for RNDIS set.

And use new RNDIS set to configure NDIS offloading parameters.

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

7 years agohyperv/hn: Save the adopted NDIS version for RNDIS to use later.
sephe [Fri, 26 Aug 2016 05:15:08 +0000 (05:15 +0000)]
hyperv/hn: Save the adopted NDIS version for RNDIS to use later.

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

7 years agohyperv/hn: Use vmbus xact for RNDIS query.
sephe [Fri, 26 Aug 2016 05:12:09 +0000 (05:12 +0000)]
hyperv/hn: Use vmbus xact for RNDIS query.

And switch MAC address query to use new RNDIS query function.

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

7 years agoPrevent BSS from being cleared twice on BookE
jhibbits [Fri, 26 Aug 2016 03:36:37 +0000 (03:36 +0000)]
Prevent BSS from being cleared twice on BookE

Summary:
First time BSS is cleared in booke_init(), Second time it's cleared in
powerpc_init().  Any variable initialized between two those guys gets wiped out
what is wrong. In particular it wipes tlb1_entries initialized by tlb1_init(),
which was fine when tlb1_init() was called a second time, but this was removed
in r304656.

Submitted by: Ivan Krivonos <int0dster_gmail.com>
Differential Revision: https://reviews.freebsd.org/D7638

7 years agoddb: Add 'show active trace' command
cem [Fri, 26 Aug 2016 02:46:47 +0000 (02:46 +0000)]
ddb: Add 'show active trace' command

'show active trace', or 'acttrace' for short, prints backtraces from running
threads only.

Reviewed by: mjg
Differential Revision: https://reviews.freebsd.org/D7646

7 years agocxgbe/cxgbei: There is no need for multiple modules in the KLD.
np [Fri, 26 Aug 2016 01:28:31 +0000 (01:28 +0000)]
cxgbe/cxgbei: There is no need for multiple modules in the KLD.

Sponsored by: Chelsio Communications

7 years agoWITH_META_MODE: Don't let subdir traversals for 'make install' re-enable meta mode.
bdrewery [Thu, 25 Aug 2016 23:55:56 +0000 (23:55 +0000)]
WITH_META_MODE: Don't let subdir traversals for 'make install' re-enable meta mode.

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

7 years agoUnlike Solaris, in FreeBSD p_args can be 0 so check for that
gnn [Thu, 25 Aug 2016 23:24:57 +0000 (23:24 +0000)]
Unlike Solaris, in FreeBSD p_args can be 0 so check for that
instead of walking down to ar_args blindly.

Reported by: Amanda Strnad
Reviewed by: markj, jhb
MFC after: 2 weeks
Sponsored by: DARPA, AFRL

7 years agocxgbe/cxgbei: Convert the driver-private PDU flags to enums and replace
np [Thu, 25 Aug 2016 23:06:12 +0000 (23:06 +0000)]
cxgbe/cxgbei: Convert the driver-private PDU flags to enums and replace
pdu_ prefix with icp_ in struct icl_cxgbei_pdu.

Sponsored by: Chelsio Communications

7 years ago[mips] flip from =v to =r - let the compiler choose a temp register.
adrian [Thu, 25 Aug 2016 22:32:10 +0000 (22:32 +0000)]
[mips] flip from =v to =r - let the compiler choose a temp register.

=v is some ye olde gcc "use this specific register as the temp register"
thing that they've deprecated and clang/llvm doesn't implement.

Poked again and again by: sbruno

7 years agocxgbe/cxgbei: Read the chip's configuration to determine the actual
np [Thu, 25 Aug 2016 21:55:17 +0000 (21:55 +0000)]
cxgbe/cxgbei: Read the chip's configuration to determine the actual
hardware send and receive PDU limits.  Report these limits to ICL and
take them into account when setting the socket's send and receive buffer
sizes.  The driver used a single hardcoded limit everywhere prior to
this change.

Sponsored by: Chelsio Communications

7 years agobspatch: remove output file in the case of error
emaste [Thu, 25 Aug 2016 21:33:39 +0000 (21:33 +0000)]
bspatch: remove output file in the case of error

Reviewed by: oshogbo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7644

7 years agoMove some more files under MK_CLANG_FULL.
dim [Thu, 25 Aug 2016 21:29:16 +0000 (21:29 +0000)]
Move some more files under MK_CLANG_FULL.

7 years agoOriginal fgetln() from 44lite return sucess for line tail errors,
ache [Thu, 25 Aug 2016 21:14:26 +0000 (21:14 +0000)]
Original fgetln() from 44lite return sucess for line tail errors,
i.e. partial line, but set __SERR and errno in the same time, which
is inconsistent.
Now both OpenBSD and NetBSD return failure, i.e. no line and set error
indicators for such case, so make our fgetln() and fgetwln()
(as its wide version) compatible with the rest of *BSD.

PR:     212033
MFC after:      7 days

7 years agoSlightly reduce diffs against upstream lldb, and comment out PDB support.
dim [Thu, 25 Aug 2016 21:13:16 +0000 (21:13 +0000)]
Slightly reduce diffs against upstream lldb, and comment out PDB support.

7 years agoAdd libifc, a library implementing core functionality that exists in ifconfig(8)...
kp [Thu, 25 Aug 2016 19:40:25 +0000 (19:40 +0000)]
Add libifc, a library implementing core functionality that exists in ifconfig(8) today.

libifc (pronounced lib-ifconfig) aims to be a light abstraction layer between
programs and the kernel APIs for managing the network configuration.
This should hopefully make programs easier to maintain, and reduce code
duplication.

Work will begin on making ifconfig(8) use this library in the near future.

This code is still evolving. The interface should not be considered stable until
it is announced as such.

Submitted By: Marie Helene Kvello-Aune <marieheleneka@gmail.com>
Reviewed By: kp
Differential Revision: https://reviews.freebsd.org/D7529

7 years agoRemove last remnants of acd(4), mcd(4), and scd(4) drivers.
ak [Thu, 25 Aug 2016 19:36:58 +0000 (19:36 +0000)]
Remove last remnants of acd(4), mcd(4), and scd(4) drivers.

Approved by: jhb

7 years agoIn both do_rw_wrlock() and do_rw_rdlock() after r304808, do not
kib [Thu, 25 Aug 2016 19:15:02 +0000 (19:15 +0000)]
In both do_rw_wrlock() and do_rw_rdlock() after r304808, do not
obliterate possible error from sleep with errors from
umtxq_check_susp(), when looping to clear URWLOCK_{READ,WRITE}_WAITERS.

Noted and reviewed by: vangyzen
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoRemove "Fast path", it bypass __wcrtomb() and all its error checking.
ache [Thu, 25 Aug 2016 17:30:00 +0000 (17:30 +0000)]
Remove "Fast path", it bypass __wcrtomb() and all its error checking.
One of affected encoding example: US-ASCII

MFC after:      7 days

7 years agoDon't check for __SERR which may stick from one of any previous stdio
ache [Thu, 25 Aug 2016 17:13:04 +0000 (17:13 +0000)]
Don't check for __SERR which may stick from one of any previous stdio
functions.
__SERR is for user and the rest of stdio code do not check it
for error sensing internally, only set it.
In vf(w)printf.c here it is more easy to save __SERR, clear and restore it.

7 years agoAdd non-TRUSTEDBSD prefixed knobs for the _PC_ACL* and {CAP,INF,MAC}_PRESENT knobs
ngie [Thu, 25 Aug 2016 17:07:43 +0000 (17:07 +0000)]
Add non-TRUSTEDBSD prefixed knobs for the _PC_ACL* and {CAP,INF,MAC}_PRESENT knobs

It's not necessarily intuitive that the variables to query contain TRUSTEDBSD
in the prefix. Add non-TRUSTEDBSD prefixed knobs for querying things like
"_PC_ACL_NFS4".

MFC after: 1 week
Relnotes: yes
Reviewed by: wollman
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D7618

7 years agoPrevent leak of URWLOCK_READ_WAITERS flag for urwlocks.
kib [Thu, 25 Aug 2016 16:35:42 +0000 (16:35 +0000)]
Prevent leak of URWLOCK_READ_WAITERS flag for urwlocks.

If there was some error, e.g. the sleep was interrupted, as in the
referenced PR, do_rw_rdlock() did not cleared URWLOCK_READ_WAITERS.
Since unlock only wakes up write waiters when there is no read
waiters, for URWLOCK_PREFER_READER kind of locks, the result was
missed wakeups for writers.

In particular, the most visible victims are ld-elf.so locks in
processes which loaded libthr, because rtld locks are urwlocks in
prefer-reader mode.  Normal rwlocks fall into prefer-reader mode only
if thread already owns rw lock in read mode, which is not typical and
correspondingly less visible.  In the PR, unowned rtld bind lock was
waited for in the process where only one thread was left alive.

Note that do_rw_wrlock() correctly clears URWLOCK_WRITE_WAITERS in
case of errors.

Reported and tested by: longwitz@incore.de
PR: 211947
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoCapsicumize bspatch
allanjude [Thu, 25 Aug 2016 15:08:33 +0000 (15:08 +0000)]
Capsicumize bspatch

Move all of the fopen() and open() calls to the top of main()

Restrict each FD to least privilege (read/seek only, write only, etc)

cap_enter(), and make all except the output FD read/seek only.

Reviewed by: emaste, ed, oshogbo, delphij
Approved by: so
MFC after: 3 days
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D7358

7 years agoFix an assert, it should check if, when moving from 1 l1 to 512 l2 blocks,
andrew [Thu, 25 Aug 2016 14:42:29 +0000 (14:42 +0000)]
Fix an assert, it should check if, when moving from 1 l1 to 512 l2 blocks,
the l2 entry is a block type and not an l3 page.

While here fix the string to correct the level name and add a missing ')'.

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

7 years agoAdd support for Allwinner A64.
jmcneill [Thu, 25 Aug 2016 13:59:19 +0000 (13:59 +0000)]
Add support for Allwinner A64.

Reviewed by: andrew, manu
Relnotes: yes

7 years agoLess-quick fix for locking fixes in r172250. r172250 added a second
bde [Thu, 25 Aug 2016 13:46:52 +0000 (13:46 +0000)]
Less-quick fix for locking fixes in r172250.  r172250 added a second
syscons spinlock for the output routine alone.  It is better to extend
the coverage of the first syscons spinlock added in r162285.  2 locks
might work with complicated juggling, but no juggling was done.  What
the 2 locks actually did was to cover some of the missing locking in
each other and deadlock less often against each other than a single
lock with larger coverage would against itself.  Races are preferable
to deadlocks here, but 2 locks are still worse since they are harder
to understand and fix.

Prefer deadlocks to races and merge the second lock into the first one.

Extend the scope of the spinlocking to all of sc_cnputc() instead of
just the sc_puts() part.  This further prefers deadlocks to races.

Extend the kdb_active hack from sc_puts() internals for the second lock
to all spinlocking.  This reduces deadlocks much more than the other
changes increases them.  The s/p,10* test in ddb gets much further now.
Hide this detail in the SC_VIDEO_LOCK() macro.  Add namespace pollution
in 1 nested #include and reduce namespace pollution in other nested
#includes to pay for this.

Move the first lock higher in the witness order.  The second lock was
unnaturally low and the first lock was unnaturally high.  The second
lock had to be above "sleepq chain" and/or "callout" to avoid spurious
LORs for visual bells in sc_puts().  Other console driver locks are
already even higher (but not adjacent like they should be) except when
they are missing from the table.  Audio bells also benefit from the
syscons lock being high so that audio mutexes have chance of being
lower.  Otherwise, console drviver locks should be as low as possible.
Non-spurious LORs now occur if the bell code calls printf() or is
interrupted (perhaps by an NMI) and the interrupt handler calls
printf().  Previous commits turned off many bells in console i/o but
missed ones done by the teken layer.

7 years agoPass the number of segments coalesced by LRO up the stack by repurposing the
lstewart [Thu, 25 Aug 2016 13:33:32 +0000 (13:33 +0000)]
Pass the number of segments coalesced by LRO up the stack by repurposing the
tso_segsz pkthdr field during RX processing, and use the information in TCP for
more correct accounting and as a congestion control input. This is only a start,
and an audit of other uses for the data is left as future work.

Reviewed by: gallatin, rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D7564

7 years agoRemove the gratuitous check for $FreeBSD$ and rename the function
cy [Thu, 25 Aug 2016 13:24:11 +0000 (13:24 +0000)]
Remove the gratuitous check for $FreeBSD$ and rename the function
to ntpd_init_leapfile, to ensure a copy exists in /var/db if a copy
isn't already there.

Reported by: ache@
MFC after: 1 day

7 years agoDon't set *dev in the zfs root case, it may be NULL and will correctly be
andrew [Thu, 25 Aug 2016 12:42:41 +0000 (12:42 +0000)]
Don't set *dev in the zfs root case, it may be NULL and will correctly be
set later in the function. This fixes a potential NULL pointer dereference
found on arm64.

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

7 years agoFix logic errors in bounds checks in previous commit. The 2-entry stack
bde [Thu, 25 Aug 2016 12:04:57 +0000 (12:04 +0000)]
Fix logic errors in bounds checks in previous commit.  The 2-entry stack
was overrun for grab levels larger than 2.

Reported by: pluknet

7 years agoMap coherent memory in a non-coherent dma tag as uncached. This is similar
andrew [Thu, 25 Aug 2016 10:53:03 +0000 (10:53 +0000)]
Map coherent memory in a non-coherent dma tag as uncached. This is similar
to what the 32-bit arm code does, with the exception that it always assumes
the tag is non-coherent.

Tested by: jmcneill
Obtained from: ABT Systems Ltd
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

7 years agoAdd support for Allwinner A64 PLL_PERIPH0/PLL_PERIPH1 and PLL_HSIC clocks.
jmcneill [Thu, 25 Aug 2016 10:29:41 +0000 (10:29 +0000)]
Add support for Allwinner A64 PLL_PERIPH0/PLL_PERIPH1 and PLL_HSIC clocks.

Reviewed by: andrew, manu

7 years agoMake use of Kyua's work directories.
jmmv [Thu, 25 Aug 2016 10:28:47 +0000 (10:28 +0000)]
Make use of Kyua's work directories.

Change the vnode tests to use the current directory when creating temporary
files, which we can assume is a volatile work directory, and then make the
kqueue_test.sh driver _not_ abandon the directory created by Kyua.

This makes the various kqueue tests independent of each other, and ensures
the temporary file is cleaned up on failure.

Problem spotted by asomers@ when reviewing D4254.

7 years agoSwitch parent clock when setting frequency if a new parent is a better
jmcneill [Thu, 25 Aug 2016 10:27:22 +0000 (10:27 +0000)]
Switch parent clock when setting frequency if a new parent is a better
candidate for the target rate.

Reviewed by: andrew, manu

7 years agoAdd support for Allwinner multi-parent bus gates.
jmcneill [Thu, 25 Aug 2016 10:24:14 +0000 (10:24 +0000)]
Add support for Allwinner multi-parent bus gates.

Reviewed by: andrew, manu

7 years agoExpose DC1SW as a regulator switch. On Pine64 this is used to control EMAC
jmcneill [Thu, 25 Aug 2016 10:20:27 +0000 (10:20 +0000)]
Expose DC1SW as a regulator switch. On Pine64 this is used to control EMAC
PHY power.

Reviewed by: andrew, manu

7 years agoRemove dependency on allwinner_soc_family() as it is not available on arm64.
jmcneill [Thu, 25 Aug 2016 10:14:56 +0000 (10:14 +0000)]
Remove dependency on allwinner_soc_family() as it is not available on arm64.

Reviewed by: andrew, manu

7 years agohyperv/storvsc: Increase queue depth and rework channel selection.
sephe [Thu, 25 Aug 2016 05:50:19 +0000 (05:50 +0000)]
hyperv/storvsc: Increase queue depth and rework channel selection.

- Increasing queue depth gives ~100% performance improvement for
  randwrite fio test in Azure.
- New channel selection, which takes LUN id and the current cpuid
  into consideration, gives additional ~20% performance improvement
  for ranwrite fio test in Azure.

Submitted by:   Hongzhang Jiang <honzhan microsoft com>
Modified by:    sephe
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D7622

7 years agohyperv/vmbus: Add function to calculate max # of elements in a bufring.
sephe [Thu, 25 Aug 2016 05:35:51 +0000 (05:35 +0000)]
hyperv/vmbus: Add function to calculate max # of elements in a bufring.

MFC after: 1 week
Sponsored by: Microsoft

7 years agoBump __FreeBSD_version for r304787 and add a note about it to UPDATING.
np [Thu, 25 Aug 2016 05:28:02 +0000 (05:28 +0000)]
Bump __FreeBSD_version for r304787 and add a note about it to UPDATING.

7 years agohyperv/ic: Update total message size if negotiate message size grows.
sephe [Thu, 25 Aug 2016 05:24:57 +0000 (05:24 +0000)]
hyperv/ic: Update total message size if negotiate message size grows.

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