freebsd.git
8 years agoSince contrib/libcxxrt's ancestry was never correct, subversion 1.8 and
dim [Thu, 5 May 2016 22:30:00 +0000 (22:30 +0000)]
Since contrib/libcxxrt's ancestry was never correct, subversion 1.8 and
higher cannot merge to it from the vendor area.

Re-bootstrap the ancestry by doing (apologies to your retinas):
* svn pg svn:mergeinfo contrib/libcxxrt > mergeinfo.txt
* svn rm contrib/libcxxrt
* svn cp ^/vendor/libcxxrt/dist@297299 contrib/libcxxrt
* svn rm CMakeLists.txt doxygen_config
* svn cp ^/head/contrib/libcxxrt/FREEBSD-upgrade@297299 contrib/libcxxrt
* svn cp ^/head/contrib/libcxxrt/exception.cc@297299 contrib/libcxxrt
* svn cp ^/head/contrib/libcxxrt/unwind-arm.h@297299 contrib/libcxxrt
* svn pd -R svn:mergeinfo contrib/libcxxrt
* svn ps -F mergeinfo.txt svn:mergeinfo contrib/libcxxrt

8 years agoNative PCI-express HotPlug support.
jhb [Thu, 5 May 2016 22:26:23 +0000 (22:26 +0000)]
Native PCI-express HotPlug support.

PCI-express HotPlug support is implemented via bits in the slot
registers of the PCI-express capability of the downstream port along
with an interrupt that triggers when bits in the slot status register
change.

This is implemented for FreeBSD by adding HotPlug support to the
PCI-PCI bridge driver which attaches to the virtual PCI-PCI bridges
representing downstream ports on HotPlug slots. The PCI-PCI bridge
driver registers an interrupt handler to receive HotPlug events. It
also uses the slot registers to determine the current HotPlug state
and drive an internal HotPlug state machine. For simplicty of
implementation, the PCI-PCI bridge device detaches and deletes the
child PCI device when a card is removed from a slot and creates and
attaches a PCI child device when a card is inserted into the slot.

The PCI-PCI bridge driver provides a bus_child_present which claims
that child devices are present on HotPlug-capable slots only when a
card is inserted. Rather than requiring a timeout in the RC for
config accesses to not-present children, the pcib_read/write_config
methods fail all requests when a card is not present (or not yet
ready).

These changes include support for various optional HotPlug
capabilities such as a power controller, mechanical latch,
electro-mechanical interlock, indicators, and an attention button.
It also includes support for devices which require waiting for
command completion events before initiating a subsequent HotPlug
command. However, it has only been tested on ExpressCard systems
which support surprise removal and have none of these optional
capabilities.

PCI-express HotPlug support is conditional on the PCI_HP option
which is enabled by default on arm64, x86, and powerpc.

Reviewed by: adrian, imp, vangyzen (older versions)
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D6136

8 years agoMake libcrypto position independent on i386
emaste [Thu, 5 May 2016 21:25:41 +0000 (21:25 +0000)]
Make libcrypto position independent on i386

Prior to this change libcrypto ended up with a .text relocation.

Submitted by: Rafael EspĂ­ndola (earlier version)
Reviewed by: kib
Approved by: so (glebius)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6164

8 years agoLimit Options.inc generation to desired targets
emaste [Thu, 5 May 2016 21:20:09 +0000 (21:20 +0000)]
Limit Options.inc generation to desired targets

As mentioned in the Makefile there's an "atrocious" hack to generate a
different version of Options.inc.h, depending on the library being
built.

Remove the catch-all else case and limit it to specific libraries, so
that we don't accidentally use the Options.inc.h from clangdriver if a
future libary also uses Options.inc.h.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D6209

8 years ago.. delete this; I don't know why this was here. oops!
adrian [Thu, 5 May 2016 20:16:58 +0000 (20:16 +0000)]
.. delete this; I don't know why this was here. oops!

8 years agoRename find_name_tlv_type() to ipfw_find_name_tlv_type() and make it
ae [Thu, 5 May 2016 20:15:46 +0000 (20:15 +0000)]
Rename find_name_tlv_type() to ipfw_find_name_tlv_type() and make it
global. Use it in ip_fw_table.c instead of find_name_tlv() to reduce
duplicated code.

Obtained from: Yandex LLC
Sponsored by: Yandex LLC

8 years ago[bhnd] don't use anonymous unions.
adrian [Thu, 5 May 2016 19:56:18 +0000 (19:56 +0000)]
[bhnd] don't use anonymous unions.

Found by: gcc-4.2

8 years ago[bhnd] default to BUS_PROBE_DEFAULT for unknown BHND classes.
adrian [Thu, 5 May 2016 19:55:16 +0000 (19:55 +0000)]
[bhnd] default to BUS_PROBE_DEFAULT for unknown BHND classes.

Found by: gcc-4.2

8 years ago[bhnd] handle unknown bhnd port type.
adrian [Thu, 5 May 2016 19:54:17 +0000 (19:54 +0000)]
[bhnd] handle unknown bhnd port type.

8 years ago[bwn] fix signed-ness of the rssi parameter.
adrian [Thu, 5 May 2016 19:40:26 +0000 (19:40 +0000)]
[bwn] fix signed-ness of the rssi parameter.

It's a uint8_t from the hardware.

Found by: gcc

8 years ago[bhnd] quieten gcc warning.
adrian [Thu, 5 May 2016 19:38:53 +0000 (19:38 +0000)]
[bhnd] quieten gcc warning.

8 years ago[bhnd] handle unknown port type.
adrian [Thu, 5 May 2016 19:30:14 +0000 (19:30 +0000)]
[bhnd] handle unknown port type.

Reported by: emaste

8 years agoFix intmax_t to uintptr_t casting on 32-bit platforms. Found by GCC.
jkim [Thu, 5 May 2016 18:43:31 +0000 (18:43 +0000)]
Fix intmax_t to uintptr_t casting on 32-bit platforms.  Found by GCC.

Submitted by: bde

8 years agoFix kernel build with parallel make.
zeising [Thu, 5 May 2016 17:55:10 +0000 (17:55 +0000)]
Fix kernel build with parallel make.

Approved by: jhb

8 years agoFix GICv3 build after r299090
zbb [Thu, 5 May 2016 17:51:14 +0000 (17:51 +0000)]
Fix GICv3 build after r299090

Obtained from: Semihalf
Sponsored by: Cavium

8 years agobhnd: another build fix for GCC-using architectures
emaste [Thu, 5 May 2016 17:47:03 +0000 (17:47 +0000)]
bhnd: another build fix for GCC-using architectures

Further to r299119. GCC architectures failed with
bcma_subr.c:138: warning: control reaches end of non-void function

Sponsored by: The FreeBSD Foundation

8 years agoFix <sys/_bitset.h> and <sys/_cpuset.h> to not require <sys/param.h>.
jhb [Thu, 5 May 2016 15:43:26 +0000 (15:43 +0000)]
Fix <sys/_bitset.h> and <sys/_cpuset.h> to not require <sys/param.h>.

- Hardcode '8' instead of NBBY in _BITSET_BITS.
- Define a private version of 'howmany' for use in __bitset_words().
- While here, move a few more things out of _bitset.h and _cpuset.h to
  bitset.h and cpuset.h, respectively.  The only things left in
  _bitset.h and _cpuset.h are the bits needed to define a bitset
  structure.

Reviewed by: bde, kib (ish)

8 years agompr(4) and mps(4) shouldn't indefinitely retry for "terminated ioc" errors
asomers [Thu, 5 May 2016 15:32:47 +0000 (15:32 +0000)]
mpr(4) and mps(4) shouldn't indefinitely retry for "terminated ioc" errors

Submitted by: ken
Reviewed by: slm
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6210

8 years agoAdd explicit cast to fix mips and powerpc build after r299090
emaste [Thu, 5 May 2016 15:21:33 +0000 (15:21 +0000)]
Add explicit cast to fix mips and powerpc build after r299090

Sponsored by: The FreeBSD Foundation

8 years agobhnd: fix build on gcc architectures
emaste [Thu, 5 May 2016 15:07:40 +0000 (15:07 +0000)]
bhnd: fix build on gcc architectures

"make tinderbox" fails on sparc64 GENERIC-NODEBUG with:
bhnd_subr.c:188: warning: control reaches end of non-void function

Sponsored by: The FreeBSD Foundation

8 years agoImplement FBT provider (MD part) for DTrace on MIPS.
br [Thu, 5 May 2016 13:54:50 +0000 (13:54 +0000)]
Implement FBT provider (MD part) for DTrace on MIPS.
Tested on MIPS64.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

8 years agoINTRNG - redefine struct intr_map_data to avoid headers pollution. Each
skra [Thu, 5 May 2016 13:31:19 +0000 (13:31 +0000)]
INTRNG - redefine struct intr_map_data to avoid headers pollution. Each
struct associated with some type defined in enum intr_map_data_type
must have struct intr_map_data on the top of its own definition now.
When such structs are used, correct type and size must be filled in.

There are three such structs defined in sys/intr.h now. Their
definitions should be moved to corresponding headers by follow-up
commits.

While this change was propagated to all INTRNG like PICs,
pic_map_intr() method implementations were corrected on some places.
For this specific method, it's ensured by a caller that the 'data'
argument passed to this method is never NULL. Also, the return error
values were standardized there.

8 years agoRemove superfluous check. The pic_dev member of struct pic
skra [Thu, 5 May 2016 13:23:38 +0000 (13:23 +0000)]
Remove superfluous check. The pic_dev member of struct pic
is never NULL on PIC found by pic_lookup().

8 years agoWarn about consequences of suspending threads in arbitrary state of
kib [Thu, 5 May 2016 10:22:19 +0000 (10:22 +0000)]
Warn about consequences of suspending threads in arbitrary state of
execution.

While there, fix minor nits in markup.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

8 years agoDo not leak THR_FLAGS_SUSPENDED from the previous suspend/resume
kib [Thu, 5 May 2016 10:20:22 +0000 (10:20 +0000)]
Do not leak THR_FLAGS_SUSPENDED from the previous suspend/resume
cycle.  The flag currently is cleared by the resumed thread.  If next
suspend request comes before the thread was able to clean the flag, in
which case suspender skip the thread.

Instead, clear the THR_FLAGS_SUSPEND flag in resume_common(), we do
not care how much code was executed in the resumed thread when the
pthread_resume_*np(s) functions returned.

PR: 209233
Reported by: Lawrence Esswood <le277@cam.ac.uk>
MFC after: 1 week

8 years agoAdd support for the Allwinner A83T (sun8iw6p1) SoC.
jmcneill [Thu, 5 May 2016 09:41:57 +0000 (09:41 +0000)]
Add support for the Allwinner A83T (sun8iw6p1) SoC.

Clocks, GPIO, UART, SD card / eMMC, USB, watchdog, and ethernet are
supported. Note that the A83T contains two clusters of four Cortex-A7
CPUs, and only CPUs in first cluster are started for now.

Tested on a Sinovoip Banana Pi BPI-M3.

8 years ago[bwn] implement firmware tx/rx versioning and fix RSSI calculation.
adrian [Thu, 5 May 2016 07:04:38 +0000 (07:04 +0000)]
[bwn] implement firmware tx/rx versioning and fix RSSI calculation.

Different versions of firmware have different requirments for TX/RX
packet layouts (and other things, of course.)  Currently the driver
checks between 3xx and 4xx firmware by using the BWN_ISOLDFMT() macro,
which doesn't take into account the 5xx firmware (which I think I need
for the HT and N series PHY chips.  I'll know when I do the port.)
BWN_HDRSIZE() also needs to learn about the 5xx series firmware
as well.

So:

* add a firmware version enum
* populate it based on the firmware version we read at load time
* don't finish loading if the firmware is the 5xx firmware; any
  code using BWN_ISOLDFMT or BWN_HDRSIZE needs updating (most notably
  the TX and RX bits.)

Then, for RX RSSI:

* write down and reimplement the b43 rssi calculation method;
* use it for the correct PHYs (which are all the ones we support);
* do the RSSI calculation before radiotap, not after.

Tested:

* Broadcom BCM4312, STA mode

Obtained from: Linux b43 (careful writing and reimplementing; lots of integer math..)

8 years ago[bhnd] add missing bus file.
adrian [Thu, 5 May 2016 06:58:30 +0000 (06:58 +0000)]
[bhnd] add missing bus file.

8 years agoRevert r299096
ngie [Thu, 5 May 2016 02:51:31 +0000 (02:51 +0000)]
Revert r299096

The change broke buildworld when building lib/libkvm

This change likely needs to be run through a ports -exp run as a sanity
check, as it might break downstream consumers.

Pointyhat to: adrian
Reported by: kargl (confirmed on $work workstation)
Sponsored by: EMC / Isilon Storage Division

8 years agoefipart: Support an arbitrary number of partitions
cem [Thu, 5 May 2016 00:07:08 +0000 (00:07 +0000)]
efipart: Support an arbitrary number of partitions

Don't crash if the user has more than 31 of them.  A follow-up to
r298230.

Reviewed by: allanjude
Relnotes: maybe
Sponsored by: EMC / Isilon Storage Division
Differential Revision: https://reviews.freebsd.org/D6212

8 years ago[bwn] [bhnd] initial support for using bhnd for if_bwn devices.
adrian [Wed, 4 May 2016 23:38:27 +0000 (23:38 +0000)]
[bwn] [bhnd] initial support for using bhnd for if_bwn devices.

This is an initial work in progress to use the replacement bhnd
bus code for devices which support it.

* Add manpage updates for bhnd, bhndb, siba
* Add kernel options for bhnd, bhndbus, etc
* Add initial support in if_bwn_pci / if_bwn_mac for using bhnd
  as the bus transport for suppoted NICs
* if_bwn_pci will eventually be the PCI bus glue to interface to bwn,
  which will use the right backend bus to attach to, versus direct
  nexus/bhnd attachments (as found in embedded broadcom devices.)

The PCI glue defaults to probing at a lower level than the bwn glue,
so bwn should still attach as per normal without a boot time tunable set.

It's also not fully fleshed out - the bwn probe/attach code needs to be
broken out into platform and bus specific things (just like ath, ath_pci,
ath_ahb) before we can shift the driver over to using this.

Tested:

* BCM4311, STA mode
* BCM4312, STA mode

Submitted by: Landon Fuller <landonf@landonf.org>
Differential Revision: https://reviews.freebsd.org/D6191

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 23:32:57 +0000 (23:32 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 23:31:52 +0000 (23:31 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agoMerge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
ngie [Wed, 4 May 2016 23:20:53 +0000 (23:20 +0000)]
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
  namespacing is kept with FILES appropriately, and that this shouldn't need
  to be repeated if the namespace changes -- only the definition of PACKAGE
  needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
  `tests`. In the event we get to the point where things can be split up
  enough in the base system, it would make more sense to group the tests
  with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
  previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
  bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
  ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
  and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division

8 years agoFix the acpi attachment to always start the worker thread.
jhb [Wed, 4 May 2016 23:00:57 +0000 (23:00 +0000)]
Fix the acpi attachment to always start the worker thread.

The previous change to split the worker thread start out of fdc_attach()
did not start the worker thread if the fdc device in the ACPI namespace
did not have an _FDE method.  This fixes hangs when booting with a
floppy controller enabled on certain machines with ACPI.

Tested by: joel

8 years agoImprove performance and functionality of the bitstring(3) api
asomers [Wed, 4 May 2016 22:34:11 +0000 (22:34 +0000)]
Improve performance and functionality of the bitstring(3) api

Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which allow
for efficient searching of set or cleared bits starting from any bit offset
within the bit string.

Performance is improved by operating on longs instead of bytes and using
ffsl() for searches within a long. ffsl() is a compiler builtin in both
clang and gcc for most architectures, converting what was a brute force
while loop search into a couple of instructions.

All of the bitstring(3) API continues to be contained in the header file.
Some of the functions are large enough that perhaps they should be uninlined
and moved to a library, but that is beyond the scope of this commit.

sys/sys/bitstring.h:
        Convert the majority of the existing bit string implementation from
        macros to inline functions.

        Properly protect the implementation from inadvertant macro expansion
        when included in a user's program by prefixing all private
        macros/functions and local variables with '_'.

        Add bit_ffs_at() and bit_ffc_at(). Implement bit_ffs() and
        bit_ffc() in terms of their "at" counterparts.

        Provide a kernel implementation of bit_alloc(), making the full API
        usable in the kernel.

        Improve code documenation.

share/man/man3/bitstring.3:
        Add pre-exisiting API bit_ffc() to the synopsis.

        Document new APIs.

        Document the initialization state of the bit strings
        allocated/declared by bit_alloc() and bit_decl().

        Correct documentation for bitstr_size(). The original code comments
        indicate the size is in bytes, not "elements of bitstr_t". The new
        implementation follows this lead. Only hastd assumed "elements"
        rather than bytes and it has been corrected.

etc/mtree/BSD.tests.dist:
tests/sys/Makefile:
tests/sys/sys/Makefile:
tests/sys/sys/bitstring.c:
        Add tests for all existing and new functionality.

include/bitstring.h
Include all headers needed by sys/bitstring.h

lib/libbluetooth/bluetooth.h:
usr.sbin/bluetooth/hccontrol/le.c:
        Include bitstring.h instead of sys/bitstring.h.

sbin/hastd/activemap.c:
        Correct usage of bitstr_size().

sys/dev/xen/blkback/blkback.c
        Use new bit_alloc.

sys/kern/subr_unit.c:
        Remove hard-coded assumption that sizeof(bitstr_t) is 1.  Get rid of
        unrb.busy, which caches the number of bits set in unrb.map.  When
        INVARIANTS are disabled, nothing needs to know that information.
        callapse_unr can be adapted to use bit_ffs and bit_ffc instead.
        Eliminating unrb.busy saves memory, simplifies the code, and
        provides a slight speedup when INVARIANTS are disabled.

sys/net/flowtable.c:
        Use the new kernel implementation of bit-alloc, instead of hacking
        the old libc-dependent macro.

sys/sys/param.h
        Update __FreeBSD_version to indicate availability of new API

Submitted by:   gibbs, asomers
Reviewed by:    gibbs, ngie
MFC after:      4 weeks
Sponsored by:   Spectra Logic Corp
Differential Revision:  https://reviews.freebsd.org/D6004

8 years agofsck_msdosfs: Adjust a check.
pfg [Wed, 4 May 2016 22:27:22 +0000 (22:27 +0000)]
fsck_msdosfs: Adjust a check.

The on-disk FAT array does not include anything before CLUST_FIRST,
compensate in size check.

Obtained from: NetBSD (CVS Rev. 1.20)
MFC after: 2 weeks

8 years agoDefault NO_INSTALLEXTRAKERNELS to yes, not no
ngie [Wed, 4 May 2016 21:15:28 +0000 (21:15 +0000)]
Default NO_INSTALLEXTRAKERNELS to yes, not no

The old (^/stable/9) default was yes, not no ("no" was the new default
introduced recently that broke POLA). Restore it to keep POLA like
glebius intended in r299077

MFC after: 3 days
X-MFC with: r299086
Pointyhat to: ngie (research before assuming and committing next time)
Sponsored by: EMC / Isilon Storage Division

8 years agoFix "getextattr -x" with non-ascii attribute values
asomers [Wed, 4 May 2016 21:07:30 +0000 (21:07 +0000)]
Fix "getextattr -x" with non-ascii attribute values

extattr/rmextattr.c
When printing hex output, treat all attribute values as unsigned
char arrays instead of sign extending them to 32 bit values.

extattr/tests/extattr_test.sh
Add a regression test

PR: 209039
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

8 years agoDefault NO_INSTALLEXTRAKERNELS to "no" to unbreak the build
ngie [Wed, 4 May 2016 21:00:41 +0000 (21:00 +0000)]
Default NO_INSTALLEXTRAKERNELS to "no" to unbreak the build

MFC after: soon (was insta-MFCed -_-..)
Pointyhat to: glebius
Sponsored by: EMC / Isilon Storage Division

8 years agoAllow setextattr(8) to take attribute values from stdin
asomers [Wed, 4 May 2016 20:20:55 +0000 (20:20 +0000)]
Allow setextattr(8) to take attribute values from stdin

Add the -i option to setextattr. This option allow extended attribute data
to be provided via stdin. Add a -qq option to getextattr, which omits the
trailing newline. Together these options can be used to work with extended
attributes whose values are large and/or binary.

usr.sbin/extattr/Makefile:
Link against libsbuf which is used for processing stdin data.

usr.sbin/extattr/rmextattr.8:
Document setextattr's -i option, getextattr's -qq option, and remove
the BUG about setextattr only being useful for strings.

usr.sbin/extattr/rmextattr.c:
For setextattr operations, buffer attribute data in an sbuf. If -i
is specified, pull the data from stdin, otherwise from the
appropriate argurment.

Update usage text and argument validation code for setextattr's -i
option.

usr.sbin/extattr/tests/extattr_test.sh
Add tests for -q and -i.

Reviewed by: wblock (manpage)
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D6090

8 years agoAdd driver for Allwinner A83T/H3/A64 Gigabit Ethernet.
jmcneill [Wed, 4 May 2016 20:06:20 +0000 (20:06 +0000)]
Add driver for Allwinner A83T/H3/A64 Gigabit Ethernet.

The datasheets refer to this controller as EMAC, not to be confused with
the fast ethernet controller (also named EMAC) found in A10/A20 SoCs.

Tested on a BananaPi M3 (A83T), which uses an external RGMII PHY (RTL8211E).

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D6169

8 years agowi: fix a comment (0x1fff has 13 bits set).
avos [Wed, 4 May 2016 18:08:38 +0000 (18:08 +0000)]
wi: fix a comment (0x1fff has 13 bits set).

8 years agoExplain why pmap_copy(), pmap_enter_pde(), and pmap_enter_quick_locked()
alc [Wed, 4 May 2016 17:54:13 +0000 (17:54 +0000)]
Explain why pmap_copy(), pmap_enter_pde(), and pmap_enter_quick_locked()
call pmap_invalidate_page() even though they are not destroying a leaf-
level page table entry.

Eliminate some bogus white-space characters in a comment.

Reviewed by: kib

8 years agodev/pms: minor spelling fixes for the FreeBSD-specific part.
pfg [Wed, 4 May 2016 17:52:53 +0000 (17:52 +0000)]
dev/pms: minor spelling fixes for the FreeBSD-specific part.

8 years agotools: minor spelling fix in locales template.
pfg [Wed, 4 May 2016 17:29:07 +0000 (17:29 +0000)]
tools: minor spelling fix in locales template.

No functional change.

8 years agonet80211: do not hardcode size of ic_modecaps field.
avos [Wed, 4 May 2016 17:22:35 +0000 (17:22 +0000)]
net80211: do not hardcode size of ic_modecaps field.

8 years agoMake it possible to override NO_INSTALLEXTRAKERNELS.
glebius [Wed, 4 May 2016 17:21:34 +0000 (17:21 +0000)]
Make it possible to override NO_INSTALLEXTRAKERNELS.

Reviewed by: gjb

8 years ago[net80211] add extra debugging around negotiated A-MPDU parameters.
adrian [Wed, 4 May 2016 16:42:53 +0000 (16:42 +0000)]
[net80211] add extra debugging around negotiated A-MPDU parameters.

8 years agoWhile gem5 is not qemu, we treat it as "simulators" or "virtual environments".
bz [Wed, 4 May 2016 16:24:12 +0000 (16:24 +0000)]
While gem5 is not qemu, we treat it as "simulators" or "virtual environments".
Add the needed hardcoded gem5 attachments for the UART there, re-using all
the other bits.

In collaboration with: andrew
Sponsored by: DARPA/AFRL
Reviewed by: andrew
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6204

8 years agoThe virtual timer is optional on ARM64. Properly handle that condition. [1]
bz [Wed, 4 May 2016 16:15:39 +0000 (16:15 +0000)]
The virtual timer is optional on ARM64. Properly handle that condition. [1]
In case we do not have an interrupt assignment for the virtual timer,
force the physical timer.
Also skip resource allocation for any timer we do not have an interrupt
assignment for.

In collaboration with: andrew
Submitted by: br ([1] from his gem5 arm64 work)
Sponsored by: DARPA/AFRL
Reviewed by: andrew
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6203

8 years agoThe ARM generic timer keeps ticking even if disabled or it expired.
bz [Wed, 4 May 2016 16:09:51 +0000 (16:09 +0000)]
The ARM generic timer keeps ticking even if disabled or it expired.
In case of updating it with a very low value it might expire again
after writing the tval but before updating ctrl. In that case we do
lose the status bit saying that the timer expired and we will consequently
not get an interrupt for it, leaving the timer in a "dead" state.

In order to solve this increase the minimum period with what the timer
can be loaded to something higher.

Found & analysed with: gem5
Debugged with: andrew
Sponsored by: DARPA/AFRL
Reviewed by: andrew
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D6202

8 years agosys/sparc64: minor spelling fixes.
pfg [Wed, 4 May 2016 15:52:40 +0000 (15:52 +0000)]
sys/sparc64: minor spelling fixes.

Only affects comments: no functional change.

8 years agosys/arm: Minor spelling fixes.
pfg [Wed, 4 May 2016 15:48:59 +0000 (15:48 +0000)]
sys/arm: Minor spelling fixes.

Only affects comments: no functional change.

8 years agoxen/pvclock: set the correct resolution for the Xen PV clock
royger [Wed, 4 May 2016 13:49:59 +0000 (13:49 +0000)]
xen/pvclock: set the correct resolution for the Xen PV clock

The Xen PV clock has a resolution of 1ns, so set the resolution to the
highest one that FreeBSD supports, which is 1us.

MFC after: 2 weeks
Sponsored by: Citrix Systems R&D

8 years agortc: fix inverted resolution check
royger [Wed, 4 May 2016 13:48:59 +0000 (13:48 +0000)]
rtc: fix inverted resolution check

The current code in clock_register checks if the newly added clock has a
resolution value higher than the current one in order to make it the
default, which is wrong. Clocks with a lower resolution value should be
better than ones with a higher resolution value, in fact with the current
code FreeBSD is always selecting the worse clock.

Reviewed by: kib jhb jkim
Sponsored by: Citrix Systems R&D
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D6185

8 years agoiwn: fix device reset after watchdog timeout.
avos [Wed, 4 May 2016 12:51:27 +0000 (12:51 +0000)]
iwn: fix device reset after watchdog timeout.

Simple device reset (stop/start) is not enough here;
post-init state changes must be applied too.

8 years agoExtend the UQ_NO_STRINGS quirk to also cover the USB language string
hselasky [Wed, 4 May 2016 08:57:40 +0000 (08:57 +0000)]
Extend the UQ_NO_STRINGS quirk to also cover the USB language string
descriptor. This fixes enumeration of some older Samsung Galaxy S3
phones.

MFC after: 1 week

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 06:26:27 +0000 (06:26 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 06:25:12 +0000 (06:25 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 06:24:51 +0000 (06:24 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 06:24:10 +0000 (06:24 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agos/struct device */device_t/g
adrian [Wed, 4 May 2016 06:23:49 +0000 (06:23 +0000)]
s/struct device */device_t/g

Submitted by: kmacy

8 years agoFix build without "options PCI_IOV".
jkim [Wed, 4 May 2016 06:22:41 +0000 (06:22 +0000)]
Fix build without "options PCI_IOV".

8 years agoDIRDEPS_BUILD: Update dependencies.
bdrewery [Wed, 4 May 2016 03:14:34 +0000 (03:14 +0000)]
DIRDEPS_BUILD: Update dependencies.

Sponsored by: EMC / Isilon Storage Division

8 years agoDIRDEPS_BUILD: Exclude secure/lib* libraries for host builds.
bdrewery [Wed, 4 May 2016 03:13:48 +0000 (03:13 +0000)]
DIRDEPS_BUILD: Exclude secure/lib* libraries for host builds.

Sponsored by: EMC / Isilon Storage Division

8 years agokern: Factor out function to convert hash flags to malloc(9) flags
sephe [Wed, 4 May 2016 03:07:52 +0000 (03:07 +0000)]
kern: Factor out function to convert hash flags to malloc(9) flags

Suggested by: jhb
Reviewed by: jhb, kib
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D6184

8 years ago[bwn] fix rate control feedback.
adrian [Wed, 4 May 2016 02:11:45 +0000 (02:11 +0000)]
[bwn] fix rate control feedback.

* Add a debug print for the xmit completion status fields.
  Yes, I like staring at a stream of DWORDS.

* Set the retrycnt to the number of full frame retries for now;
  I'll figure out how to factor rts/cts failures into it when
  I figure out what the difference is.

  It's -1 because it's not "retries", it's "tries".

It now passes the youtube test.

Tested:

* BCM4312, STA mode

8 years agosh: Handle empty hostname and $PWD when building prompt
vangyzen [Wed, 4 May 2016 02:06:46 +0000 (02:06 +0000)]
sh: Handle empty hostname and $PWD when building prompt

If the hostname is empty and \h is used in $PS1,
the remainder of the prompt following \h will be empty.
Likewise for $PWD and \w.  Fix it.

Reviewed by: jilles
MFC after: 1 week
Sponsored by: Dell Inc.
Differential Revision: https://reviews.freebsd.org/D6188

8 years agoFix nvram2env after bus_space_fdt removal.
kan [Wed, 4 May 2016 01:56:37 +0000 (01:56 +0000)]
Fix nvram2env after bus_space_fdt removal.

The generic bus space does the mapping now, no need to pre-translate
phys addresses to KSEG1 anymore.

Submitted by: Hiroki Mori

8 years agoUse imin() macro from sys/libkern.h.
araujo [Wed, 4 May 2016 01:43:07 +0000 (01:43 +0000)]
Use imin() macro from sys/libkern.h.

MFC after: 2 weeks.

8 years ago[bwn] accurately(ish) account transmit/recieve failures for rate control.
adrian [Wed, 4 May 2016 01:36:19 +0000 (01:36 +0000)]
[bwn] accurately(ish) account transmit/recieve failures for rate control.

I noticed that it'd associate fine, but it'd quickly stop exchanging traffic.
Receive was okay, but transmit just failed.

Then I went "wlandebug +rate".  I discovered it started at 36M OFDM, and then
quickly rose to 54M, which then showed 0% transmit success.

Then, I dug into how the completion path works.  We are reading 'ack=0'
in the TX status side, so .. then I discovered we were only processing the
TX completion status /if/ ack=1.  So, we'd only ever count successes;
we'd never count failures, and thus the rate control code thought
everything was a-ok.

We also have to set retrycnt to something non-zero so it indeed does
bring the rate down upon failure.

So:

* Delete the rate control completion code from the tx completion
  routine, it's just duplicate and never worked.  Putting it behind
  'if (status->ack) was pointless.

* Move it to the PIO and DMA completion routines which actually
  do free the node reference and mbuf.  We know at that point
  what the status is, so do it there.

* Fake a retrycnt of 1 for now, so we at least count failures.

Also:

* Start adding comments about weird stuff I find with rate selection.
  In this instance, we shouldn't be selecting a fallback rate that
  doesn't match the currently configured mode (11a, 11b, 11g, etc.)

This isn't perfect - AMRR does try 54mbit and takes a few packets
before it figures out it's a bad idea - but it's better than nothing.

This makes the bwn(4) driver actually useful for the first time since
I've tried using it - and that dates back to 2011.  I've resisted
successfully until now.

Tested:

* Broadcom BCM4312 802.11b/g Wireless, STA mode
  WLAN (chipid 0x4312 rev 15) PHY (analog 6 type 5 rev 1) RADIO (manuf 0x17f ver 0x2062 rev 2)

TODO:

* See if the fallback rate actually /is/ working
* Question my own sanity over touching this driver in the first place.

8 years ago[bwn] ensure the fallback rate stays in the same PHY mode.
adrian [Wed, 4 May 2016 01:29:00 +0000 (01:29 +0000)]
[bwn] ensure the fallback rate stays in the same PHY mode.

Falling back from 6MB OFDM to 5MB CCK (a) may not work well in the
11bg PHYs, (b) won't work at all if you're 11g only, and (c) plainly
won't work for the 11a PHY.

So, don't do that!

Tested:

* BCM4312 802.11b/g Wireless, STA mode
  WLAN (chipid 0x4312 rev 15) PHY (analog 6 type 5 rev 1) RADIO (manuf 0x17f ver 0x2062 rev 2)

8 years agoUse DEVMETHOD_END ({ NULL, NULL }) instead of hardcoding { 0, 0 }
ngie [Tue, 3 May 2016 23:56:52 +0000 (23:56 +0000)]
Use DEVMETHOD_END ({ NULL, NULL }) instead of hardcoding { 0, 0 }

Sponsored by: EMC / Isilon Storage Division

8 years agopmcstudy.8: minor "efficiency" fix.
pfg [Tue, 3 May 2016 22:20:55 +0000 (22:20 +0000)]
pmcstudy.8: minor "efficiency" fix.

No functional change.

8 years agosys/amd64: Small spelling fixes.
pfg [Tue, 3 May 2016 22:13:04 +0000 (22:13 +0000)]
sys/amd64: Small spelling fixes.

No functional change.

8 years agovmm(4): Small spelling fixes.
pfg [Tue, 3 May 2016 22:07:18 +0000 (22:07 +0000)]
vmm(4): Small spelling fixes.

Reviewed by: grehan

8 years agokgssapi: insignificant spelling fix.
pfg [Tue, 3 May 2016 22:05:03 +0000 (22:05 +0000)]
kgssapi: insignificant spelling fix.

No functional change.

8 years agoMisc. build: minor spelling fixes.
pfg [Tue, 3 May 2016 22:01:48 +0000 (22:01 +0000)]
Misc. build: minor spelling fixes.

No functional change.

8 years agosys/isa: minor spelling fixes.
pfg [Tue, 3 May 2016 21:51:52 +0000 (21:51 +0000)]
sys/isa: minor spelling fixes.

No functional change.

8 years agoPrint the fchmodat mode in human readable fashion
bapt [Tue, 3 May 2016 21:27:17 +0000 (21:27 +0000)]
Print the fchmodat mode in human readable fashion

MFC after: 1 week

8 years agoWork around (ignore) broken SRAT tables
vangyzen [Tue, 3 May 2016 20:14:04 +0000 (20:14 +0000)]
Work around (ignore) broken SRAT tables

Instead of panicking when parsing an invalid ACPI SRAT table,
just ignore it, effectively disabling NUMA.

https://lists.freebsd.org/pipermail/freebsd-current/2016-May/060984.html

Reported and tested by:  Bill O'Hanlon (bill.ohanlon at gmail.com)
Reviewed by: jhb
MFC after: 1 week
Relnotes: If dmesg shows "SRAT: Duplicate local APIC ID",
                try updating your BIOS to fix NUMA support.
Sponsored by: Dell Inc.

8 years agoSave and restore SRIOV-related config registers.
jhb [Tue, 3 May 2016 19:45:24 +0000 (19:45 +0000)]
Save and restore SRIOV-related config registers.

Save the value of the IOV control and page size registers and restore
them (along with the VF count) in pci_cfg_save/pci_cfg_restore.  This
ensures ARI remains enabled if a PF driver resets itself during the
PCI_IOV_INIT callback.  This might also properly restore SRIOV state
across suspend/resume.

Reviewed by: rstone, vangyzen
Differential Revision: https://reviews.freebsd.org/D6192

8 years agoUse the correct location of the SRIOV capability when enabling ARI.
jhb [Tue, 3 May 2016 19:37:25 +0000 (19:37 +0000)]
Use the correct location of the SRIOV capability when enabling ARI.

While here, check if ARI was enabled by re-reading the config register
after writing it and return an error if the write fails.

Reviewed by: rstone, vangyzen

8 years agoMerge OpenSSL 1.0.2h.
jkim [Tue, 3 May 2016 18:50:10 +0000 (18:50 +0000)]
Merge OpenSSL 1.0.2h.

Relnotes: yes

8 years agoAdd a debug dir for /boot/modules.
jhb [Tue, 3 May 2016 18:26:07 +0000 (18:26 +0000)]
Add a debug dir for /boot/modules.

This provides a place for standalone modules to store debug symbols.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D6190

8 years agoRe-sync the FreeBSD-specific Subversion template with the one from
dim [Tue, 3 May 2016 18:06:42 +0000 (18:06 +0000)]
Re-sync the FreeBSD-specific Subversion template with the one from
ports.

MFC after: 11 days
X-MFC-With: r298845

8 years agosys/net*: minor spelling fixes.
pfg [Tue, 3 May 2016 18:05:43 +0000 (18:05 +0000)]
sys/net*: minor spelling fixes.

No functional change.

8 years agoImport OpenSSL 1.0.2h.
jkim [Tue, 3 May 2016 18:00:27 +0000 (18:00 +0000)]
Import OpenSSL 1.0.2h.

8 years ago[asmc] Add support for MacBookPro5,1
adrian [Tue, 3 May 2016 17:11:33 +0000 (17:11 +0000)]
[asmc] Add support for MacBookPro5,1

Tested by: Johannes Lundberg <johannes@brilliantservice.co.jp>
PR: kern/209179
Submitted by: Thomas Brierley <tomxor@gmail.com>

8 years agoioat(4): Implement CRC and MOVECRC APIs
cem [Tue, 3 May 2016 17:07:18 +0000 (17:07 +0000)]
ioat(4): Implement CRC and MOVECRC APIs

And document them in ioat.4.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat(4): Add CRC descriptor structure
cem [Tue, 3 May 2016 17:06:33 +0000 (17:06 +0000)]
ioat(4): Add CRC descriptor structure

Add CRC/MOVECRC operations, as well as the TEST and STORE variants.

With these operations, a CRC32C can be computed over one or more
descriptors' source data.  When the STORE operation is encountered, the
accumulated CRC32C is emitted to memory.  A TEST operations triggers an
IOAT channel error if the accumulated CRC32C does not match one in
memory.

These operations are not exposed through any API yet.

Sponsored by: EMC / Isilon Storage Division

8 years agoioat(4): Limit descriptor allocation to low 40 bits
cem [Tue, 3 May 2016 17:05:58 +0000 (17:05 +0000)]
ioat(4): Limit descriptor allocation to low 40 bits

The IOAT engine can only address the low 40 bits (1 TB) of physmem via
the 'next descriptor' pointer.  Restrict acceptable range given to
bus_dma_tag_create to match.

Sponsored by: EMC / Isilon Storage Division

8 years agosys/sys: missed in r298981.
pfg [Tue, 3 May 2016 16:37:09 +0000 (16:37 +0000)]
sys/sys: missed in r298981.

I am sure I've missed others as well, but at least it should
be more readable now.

No functional change.

8 years agoRemove the most useful INET || INET6 check leftover from whenever,
bz [Tue, 3 May 2016 16:01:53 +0000 (16:01 +0000)]
Remove the most useful INET || INET6 check leftover from whenever,
doing nothing.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

8 years agoCorrect wording.
kib [Tue, 3 May 2016 15:58:35 +0000 (15:58 +0000)]
Correct wording.

Submitted by: David A. Bright
MFC after: 2 weeks

8 years agoAdd some device IDs from Intel Sunrise Point chipsets.
mav [Tue, 3 May 2016 15:27:47 +0000 (15:27 +0000)]
Add some device IDs from Intel Sunrise Point chipsets.

MFC after: 2 weeks

8 years agoAdd EVFILT_VNODE open, read and close notifications.
kib [Tue, 3 May 2016 15:17:43 +0000 (15:17 +0000)]
Add EVFILT_VNODE open, read and close notifications.

While there, order EVFILT_VNODE notes descriptions alphabetically.

Based on submission, and tested by: Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after: 2 weeks

8 years agosys/sys: minor spelling fixes.
pfg [Tue, 3 May 2016 15:14:17 +0000 (15:14 +0000)]
sys/sys: minor spelling fixes.

While the changes are minor, these headers are very visible.

MFC after: 2 weeks

8 years agodev/iscsi: minor spelling fixes.
pfg [Tue, 3 May 2016 14:49:49 +0000 (14:49 +0000)]
dev/iscsi: minor spelling fixes.

No functional change.

Reviewed by: trasz