freebsd.git
7 years agoSync instruction cache's after writing user breakpoints on MIPS.
jhb [Tue, 15 Nov 2016 17:01:48 +0000 (17:01 +0000)]
Sync instruction cache's after writing user breakpoints on MIPS.

Add an implementation for pmaps_sync_icache() on MIPS that sync's the
instruction cache on all CPUs via smp_rendezvous() after a debugger
inserts a breakpoint via ptrace(PT_IO).

Tested by: kan (on Creator CI20 running Ingenic JZ4780 SOC)
MFC after: 2 weeks
Sponsored by: DARPA / AFRL

7 years agoPass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and
kib [Tue, 15 Nov 2016 09:43:26 +0000 (09:43 +0000)]
Pass CPUID[1] %edx (cpu_feature), %ecx (cpu_feature2) and
CPUID[7].%ebx (cpu_stdext_feature), %ecx (cpu_stdext_feature2) to the
ifunc resolvers on x86.

It is much more clean to use CPUID instruction in usermode to retrieve
this information than to pass AT_HWCAP aux vector from kernel, on
x86.  Still, the change does allow for use of AT_HWCAP on arches where it is
needed, by passing aux array to ifunc_init() initializer which should
prepare arguments for ifunc resolvers.

Current signature for resolvers on x86 is
func_t iresolve(uint32_t cpu_feature, uint32_t cpu_feature2,
    uint32_t cpu_stdext_feature, uint32_t cpu_stdext_feature2);
where arguments have identical meaning as the kernel variables of the
same name.  The ABIs allow to use resolvers with the void or shortened
list of arguments.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D8448

7 years agoAssert that there is no unresolved symbols during rtld linking.
kib [Tue, 15 Nov 2016 09:40:03 +0000 (09:40 +0000)]
Assert that there is no unresolved symbols during rtld linking.

Reviewed by: emaste, jhb
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
X-Differential revision: https://reviews.freebsd.org/D8448

7 years agoUpdate hint to utilize user variable.
kib [Tue, 15 Nov 2016 09:37:35 +0000 (09:37 +0000)]
Update hint to utilize user variable.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoAdd myself (dexuan) as a src committer and sephe as my mentor.
dexuan [Tue, 15 Nov 2016 09:20:28 +0000 (09:20 +0000)]
Add myself (dexuan) as a src committer and sephe as my mentor.

Approved by: sephe (mentor)

7 years agoAdd missing support of named lookup tables to the IPv6 code.
ae [Tue, 15 Nov 2016 07:13:16 +0000 (07:13 +0000)]
Add missing support of named lookup tables to the IPv6 code.

PR: 214419
MFC after: 1 week
Sponsored by: Yandex LLC

7 years agoUpstream DTS provides PLL3 and PLL7 nodes (and their x2 form),
manu [Tue, 15 Nov 2016 07:08:33 +0000 (07:08 +0000)]
Upstream DTS provides PLL3 and PLL7 nodes (and their x2 form),
so remove them from our DTS and adapt the code to handle them correctly.
This fix HDMI video on A20.

7 years agoWhen you select make OLDTIMEZONES=1 then you need a few added directories
julian [Tue, 15 Nov 2016 06:37:44 +0000 (06:37 +0000)]
When you select make OLDTIMEZONES=1 then you need a few added directories
to be made or the command fails

Sponsored by: panzura

7 years agoAdd sdhci and mmc drivers to MPC85XX/MPC85XXSPE
jhibbits [Tue, 15 Nov 2016 05:05:51 +0000 (05:05 +0000)]
Add sdhci and mmc drivers to MPC85XX/MPC85XXSPE

sdhci was missing from MPC85XXSPE, and mmc/mmcsd were missing from both.

7 years agoWrite to the correct GPIO registers.
jhibbits [Tue, 15 Nov 2016 04:49:26 +0000 (04:49 +0000)]
Write to the correct GPIO registers.

Offset 0 is the direction register, not the data register.

MFC after: 1 week

7 years ago[evdev] Add evdev support to kbdmux(4) driver
gonzo [Tue, 15 Nov 2016 04:12:19 +0000 (04:12 +0000)]
[evdev] Add evdev support to kbdmux(4) driver

To enable event sourcing from kbdmux(4) kern.evdev.rcpt_mask value
should have bit 1 set (this is default)

Submitted by: Vladimir Kondratiev <wulf@cicgroup.ru>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D8437

7 years agocache: plug a write-only variable in cache_negative_zap_one
mjg [Tue, 15 Nov 2016 03:43:10 +0000 (03:43 +0000)]
cache: plug a write-only variable in cache_negative_zap_one

7 years agocache: fix a race between entry removal and demotion
mjg [Tue, 15 Nov 2016 03:38:05 +0000 (03:38 +0000)]
cache: fix a race between entry removal and demotion

The negative list shrinker can demote an entry with only hotlist + neglist
locks held. On the other hand entry removal possibly sets the NCF_DVDROP
without aformentioned locks held prior to detaching it from the respective
netlist., which can lose the update made by the shrinker.

Reported and tested by: truckman

7 years agohyperv/vss: Add driver and tools for VSS
sephe [Tue, 15 Nov 2016 02:36:12 +0000 (02:36 +0000)]
hyperv/vss: Add driver and tools for VSS

VSS stands for "Volume Shadow Copy Service".  Unlike virtual machine
snapshot, it only takes snapshot for the virtual disks, so both
filesystem and applications have to aware of it, and cooperate the
whole VSS process.

This driver exposes two device files to the userland:

    /dev/hv_fsvss_dev

    Normally userland programs should _not_ mess with this device file.
    It is currently used by the hv_vss_daemon(8), which freezes and
    thaws the filesystem.  NOTE: currently only UFS is supported, if
    the system mounts _any_ other filesystems, the hv_vss_daemon(8)
    will veto the VSS process.

    If hv_vss_daemon(8) was disabled, then this device file must be
    opened, and proper ioctls must be issued to keep the VSS working.

    /dev/hv_appvss_dev

    Userland application can opened this device file to receive the
    VSS freeze notification, hold the VSS for a while (mainly to flush
    application data to filesystem), release the VSS process, and
    receive the VSS thaw notification i.e. applications can run again.

    The VSS will still work, even if this device file is not opened.
    However, only filesystem consistency is promised, if this device
    file is not opened or is not operated properly.

hv_vss_daemon(8) is started by devd(8) by default.  It can be disabled
by editting /etc/devd/hyperv.conf.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
Reviewed by: kib, mckusick
MFC after: 3 weeks
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8224

7 years ago[net80211] announce 11n capabilities in probe requests in IBSS mode.
adrian [Tue, 15 Nov 2016 01:47:37 +0000 (01:47 +0000)]
[net80211] announce 11n capabilities in probe requests in IBSS mode.

The 802.11-2012 specification notes that a subset of IEs should be present
in IBSS probe requests.  This is what (initially) allows nodes to discover
that other nodes are 11n capable.  Notably - HTCAP, but not HTINFO.

This isn't everything required to reliably enable 11n between net80211
peers; there's more work to come.

Tested:

* AR9380, IBSS+11n mode

7 years ago[mips] enable relbuf on mips for now to work around page aliasing in mips hardware.
adrian [Tue, 15 Nov 2016 01:41:45 +0000 (01:41 +0000)]
[mips] enable relbuf on mips for now to work around page aliasing in mips hardware.

Although the higher end MIPS hardware handles cache aliasing issues in
hardware, the older cores (r4k, etc) and some compile versions of the
newer cores (mips24k, mips34k, mips74k) don't have this feature.
This means we end up with some very unfortunate behaviour that was
made very obvious by some recent changes to the FFS pager by kib.

So, flip this off until we get our MIPS pmap/cache code upgraded to
handle aliased pages in software.

Discussed with: kib, bsdimp, juli

7 years ago[mips] make UMTX_CHAINS configurable at compile time.
adrian [Tue, 15 Nov 2016 01:34:38 +0000 (01:34 +0000)]
[mips] make UMTX_CHAINS configurable at compile time.

The default (512) wastes quite a bit of space which doesn't really buy
us much on highly embedded systems which don't take a lot of locks in
parallel.

This makes it at least build time configurable so people can experiment.

7 years agoReduce dmesg verbosity.
loos [Tue, 15 Nov 2016 00:58:31 +0000 (00:58 +0000)]
Reduce dmesg verbosity.

7 years agofold(1): Revert incorrect r308432
cem [Tue, 15 Nov 2016 00:24:18 +0000 (00:24 +0000)]
fold(1): Revert incorrect r308432

As Jean-Sébastien notes, fold(1) requires handling argv-supplied files.  That
will require a slightly more sophisticated approach.

Reported by: dumbbell@
Sponsored by: Dell EMC Isilon

7 years agonet80211: switch from ieee80211_iterate_nodes() to
avos [Mon, 14 Nov 2016 23:51:28 +0000 (23:51 +0000)]
net80211: switch from ieee80211_iterate_nodes() to
ieee80211_iterate_nodes_vap() where possible; this should
make the code a bit cleaner.

7 years ago[MIPS] Print Config7 on boot for several MIPS architectures
mizhka [Mon, 14 Nov 2016 21:38:36 +0000 (21:38 +0000)]
[MIPS] Print Config7 on boot for several MIPS architectures

Config7 contains useful fields, for instance, field AR indicating that the D-cache is configured to avoid cache aliases. This patch brings printing of config7 for MIPS 24K, 74K, 1004K.

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

7 years agoAdd the cpsw, the NIC driver for ti/am335x, to GENERIC kernel.
loos [Mon, 14 Nov 2016 20:57:30 +0000 (20:57 +0000)]
Add the cpsw, the NIC driver for ti/am335x, to GENERIC kernel.

While here:

 - remove 'device mii' - included by miibus;
 - remove 'device smcphy' - included by miibus;
 - sorted the network drivers list;
 - added a comment about miibus based on amd64/GENERIC.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agortwn: drop excessive includes.
avos [Mon, 14 Nov 2016 20:37:07 +0000 (20:37 +0000)]
rtwn: drop excessive includes.

Since rom_defs.h is included in rxxx_var.h there is no need to
include both of them.

Submitted by: kevlo

7 years agoBuild the Ti/AM335x DTBs as part of GENERIC kernel.
loos [Mon, 14 Nov 2016 19:53:46 +0000 (19:53 +0000)]
Build the Ti/AM335x DTBs as part of GENERIC kernel.

Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoCheck if L2 entry exists for the given VA before loading L3 entry.
br [Mon, 14 Nov 2016 18:30:03 +0000 (18:30 +0000)]
Check if L2 entry exists for the given VA before loading L3 entry.

This is a fix for a panic that was easy to reproduce executing
"(/bin/ls &)" in the shell.

Sponsored by: DARPA, AFRL

7 years agoUpdate WOL support for newer em(4) devices.
sbruno [Mon, 14 Nov 2016 17:19:03 +0000 (17:19 +0000)]
Update WOL support for newer em(4) devices.

Do not overwrite the contents of the WUC register, add E1000_WUC_PME_EN
to the register contents, leaving the default contents intact.

PR: 208343
Submitted by: Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
Reviewed by: jeffrey piper <jeffrey.e.pieper@intel.com>
Approved by: erj@
MFC after: 2 weeks

7 years agoInitialize reserved bytes in struct mq_attr and its 32compat
kib [Mon, 14 Nov 2016 13:20:10 +0000 (13:20 +0000)]
Initialize reserved bytes in struct mq_attr and its 32compat
counterpart, to avoid kernel stack content leak in kmq_setattr(2)
syscall.  Also slightly simplify the checks around copyout()s.

Reported by: Vlad Tsyrklevich <vlad902+spam@gmail.com>
PR: 214488
MFC after: 1 week

7 years agoMove text dump version as it's not an architecture version.
def [Mon, 14 Nov 2016 12:56:18 +0000 (12:56 +0000)]
Move text dump version as it's not an architecture version.

Reported by: jhb
Approved by: pjd (mentor)

7 years agoUse the correct OF_getencprop over OF_getprop + fdt32_to_cpu to read
andrew [Mon, 14 Nov 2016 12:03:08 +0000 (12:03 +0000)]
Use the correct OF_getencprop over OF_getprop + fdt32_to_cpu to read
integer data from the device tree.

Sponsored by: ABT Systems Ltd

7 years agoMove including fdt_pinctrl.h after openfirm.h to get th edefinition of
andrew [Mon, 14 Nov 2016 11:52:22 +0000 (11:52 +0000)]
Move including fdt_pinctrl.h after openfirm.h to get th edefinition of
phandle_t and remove the need for including fdt_common.h.

Sponsored by: ABT Systems Ltd

7 years agoStop including fdt_common.h from the arm code when it's unneeded.
andrew [Mon, 14 Nov 2016 11:41:22 +0000 (11:41 +0000)]
Stop including fdt_common.h from the arm code when it's unneeded.

Sponsored by: ABT Systems Ltd

7 years agoFix function prototypes in usbdi(9) man page, and tweak it a little.
trasz [Mon, 14 Nov 2016 10:41:04 +0000 (10:41 +0000)]
Fix function prototypes in usbdi(9) man page, and tweak it a little.

MFC after: 1 month

7 years agoFix mips 32-bit buildworld.
cy [Mon, 14 Nov 2016 00:33:03 +0000 (00:33 +0000)]
Fix mips 32-bit buildworld.

Reported by: adrian
MFC after: 6 weeks
X-MFC with: r308493

7 years agoProvide simple mutual exclusion between mount point update and unmount.
kib [Sun, 13 Nov 2016 21:49:51 +0000 (21:49 +0000)]
Provide simple mutual exclusion between mount point update and unmount.

Currently mount update keeps vfs_busy(9) reference on the mount point
during MNT_UPDATE VFS_MOUNT() vfsops call.  This already provides the
exclusion, but is problematic for filesystems which need to perform
namei(9) during VFS_MOUNT(MNT_UPDATE) operations, e.g. to refresh
mnt_from path, because namei(9) must not be called while the
vfs_busy(9) reference is owned.

Check for MNT_UPDATE flag before setting MNTK_UNMOUNT, and for
MNTK_UNMOUNT before entering innards of vfs_domount_update(), failing
syscalls with EBUSY if conflict is detected.  Keep vfs_busy(9)
reference around VFS_MOUNT(MNT_UPDATE) calls still to not change VFS
KPI.

In the update path in ffs_mount(), drop vfs_busy() reference around
namei(), which is now safe due to unmount never executing in parallel
with VFS_MOUNT(MNT_UPDATE), and which avoids the deadlock.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

7 years agoMove common cleanup code into helper.
kib [Sun, 13 Nov 2016 21:39:55 +0000 (21:39 +0000)]
Move common cleanup code into helper.

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix typo.
tuexen [Sun, 13 Nov 2016 17:55:27 +0000 (17:55 +0000)]
Fix typo.

MFC after: 1 month
Sponsored by: Netflix

7 years agoAttempt to make the parts that people are supposed to change stand out more
brd [Sun, 13 Nov 2016 17:28:32 +0000 (17:28 +0000)]
Attempt to make the parts that people are supposed to change stand out more
by capitalizing them.

Approved by: dteske

7 years agoAllow embeding DRM2 code into kernel.
mmel [Sun, 13 Nov 2016 16:31:23 +0000 (16:31 +0000)]
Allow embeding DRM2 code into kernel.
It's usefull for development (for netboot) and it also helps to boot
FreeBSD on some embeded platforms (where we must boot kernel directly,
without standard boot loader).

MFC after: 3 weeks

7 years agoAllow DRM2 code to be built on platforms without AGP.
mmel [Sun, 13 Nov 2016 13:31:23 +0000 (13:31 +0000)]
Allow DRM2 code to be built on platforms without AGP.
This patch is taken from original drm-3.8 code.

Differential Revision: https://reviews.freebsd.org/D8454
MFC after: 3 weeks

7 years agoRemove spurious space.
trasz [Sun, 13 Nov 2016 12:06:25 +0000 (12:06 +0000)]
Remove spurious space.

MFC after: 1 month

7 years agoUse the new ofw_bus_node_is_compatible function in the mips code.
andrew [Sun, 13 Nov 2016 09:33:41 +0000 (09:33 +0000)]
Use the new ofw_bus_node_is_compatible function in the mips code.

Sponsored by: ABT Systems Ltd

7 years agoRemove bcm2835_common.c from files.arm64, it no longer exists.
andrew [Sun, 13 Nov 2016 08:42:02 +0000 (08:42 +0000)]
Remove bcm2835_common.c from files.arm64, it no longer exists.

Sponsored by: ABT Systems Ltd

7 years agoUse providergone method to cover race between destroy and g_access().
mav [Sun, 13 Nov 2016 03:56:26 +0000 (03:56 +0000)]
Use providergone method to cover race between destroy and g_access().

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

7 years agoAdd two new ddb commands: show device/show all devices
jhibbits [Sun, 13 Nov 2016 00:46:11 +0000 (00:46 +0000)]
Add two new ddb commands: show device/show all devices

Shows several useful pieces of information from the device including the softc
and ivars pointers.

7 years agoDIRDEPS_BUILD: Update dependencies.
bdrewery [Sun, 13 Nov 2016 00:11:30 +0000 (00:11 +0000)]
DIRDEPS_BUILD: Update dependencies.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoDIRDEPS_BUILD: Connect new dependencies.
bdrewery [Sun, 13 Nov 2016 00:11:23 +0000 (00:11 +0000)]
DIRDEPS_BUILD: Connect new dependencies.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoRemove lingering ELFCOPY_AS_OBJCOPY missed in r306649.
bdrewery [Sun, 13 Nov 2016 00:11:19 +0000 (00:11 +0000)]
Remove lingering ELFCOPY_AS_OBJCOPY missed in r306649.

Sponsored by: Dell EMC Isilon

7 years agoMove libsysdecode-specific hack out of buildworld.
bdrewery [Sun, 13 Nov 2016 00:11:15 +0000 (00:11 +0000)]
Move libsysdecode-specific hack out of buildworld.

This should fix the lib32 build since it was not removing the generated
ioctl.c.  This file is generated by a find(1) call, so cannot use normal
dependency tracking methods.

Reported by: jhb
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoGenerate and use a proper .depend file for tables.h.
bdrewery [Sun, 13 Nov 2016 00:11:12 +0000 (00:11 +0000)]
Generate and use a proper .depend file for tables.h.

Reported by: jhb
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoFix 'rebuild during install' error to only trigger on 'make install'.
bdrewery [Sun, 13 Nov 2016 00:11:09 +0000 (00:11 +0000)]
Fix 'rebuild during install' error to only trigger on 'make install'.

This allows 'make foo install' or 'make all install'.  It is a similar
fix as r304697 did for reading dependency files.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoDIRDEPS_BUILD: Consolidate some logic for skipping of reading Makefile.depend.
bdrewery [Sun, 13 Nov 2016 00:11:05 +0000 (00:11 +0000)]
DIRDEPS_BUILD: Consolidate some logic for skipping of reading Makefile.depend.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoConsolidate the "don't build" optimizations into _SKIP_BUILD.
bdrewery [Sun, 13 Nov 2016 00:11:02 +0000 (00:11 +0000)]
Consolidate the "don't build" optimizations into _SKIP_BUILD.

_SKIP_BUILD will be set when nothing is expected to be built.  This can
be used to optimize some tree-walks and operations which don't need to
load dependency files or generate dependencies via beforebuild-style
hacks.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoDIRDEPS_BUILD: Don't hook 'beforebuild' into 'all' in MAKELEVEL 0.
bdrewery [Sun, 13 Nov 2016 00:10:59 +0000 (00:10 +0000)]
DIRDEPS_BUILD: Don't hook 'beforebuild' into 'all' in MAKELEVEL 0.

This was a mistake in r295641, but is effectively prevented from
being a problem due to r296699 preventing 'make all' from being
usable at MAKELEVEL 0 for DIRDEPS_BUILD.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoAlways set CLEANFILES, even if not building.
bdrewery [Sun, 13 Nov 2016 00:10:56 +0000 (00:10 +0000)]
Always set CLEANFILES, even if not building.

This will ensure that 'make clean' does the right thing.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon

7 years agoMake dpaa work with only slightly modified Linux device trees.
jhibbits [Sat, 12 Nov 2016 20:45:03 +0000 (20:45 +0000)]
Make dpaa work with only slightly modified Linux device trees.

Linux has a slightly different device tree definition for DPAA than originally
done in the FreeBSD driver.  This changes the driver to be mostly compatible
with the Linux device tree definitions.  Currently the differences are:

bman-portals: compatible = "fsl,bman-portals" (Linux is "simple-bus")
qman-portals: compatible = "fsl,qman-portals" (Linux is "simple-bus")
fman: compatible = "fsl,fman" (Linux is "simple-bus")

The Linux device tree doesn't specify anything for rgmii in the mdio.  This
change still requires the device tree to specify the phy-handle, and doesn't yet
support tbi.

7 years agoFix a broken link to the USB audio class specs.
bcr [Sat, 12 Nov 2016 19:45:55 +0000 (19:45 +0000)]
Fix a broken link to the USB audio class specs.

PR: 214240
Submitted by: Tobias Kortkamp t@tobik.me
MFC after: 5 days

7 years agoRemove the DTrace printt and typeref actions.
markj [Sat, 12 Nov 2016 19:26:12 +0000 (19:26 +0000)]
Remove the DTrace printt and typeref actions.

These are FreeBSD-specific and were added in r178576 to provide the ability
to pretty-print instances of compound types. However, the print action has
long since been augmented to provide this functionality with a simpler
interface.

Discussed with: gnn
Differential Revision: https://reviews.freebsd.org/D8478

7 years ago[rpi_ft5406] Add missing dependency on mbox_if.h
gonzo [Sat, 12 Nov 2016 19:05:41 +0000 (19:05 +0000)]
[rpi_ft5406] Add missing dependency on mbox_if.h

Submitted by: hselasky
MFC after: ASAP

7 years agoDon't read if_counters with if_addr_lock held
rstone [Sat, 12 Nov 2016 19:03:23 +0000 (19:03 +0000)]
Don't read if_counters with if_addr_lock held

Calling into an ifnet implementation with the if_addr_lock already
held can cause a LOR and potentially a deadlock, as ifnet
implementations typically can take the if_addr_lock after their
own locks during configuration.  Refactor a sysctl handler that
was violating this to read if_counter data in a temporary buffer
before the if_addr_lock is taken, and then copying the data
in its final location later, when the if_addr_lock is held.

PR: 194109
Reported by: Jean-Sebastien Pedron
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D8498
Reviewed by: sbruno

7 years agoDo not report error on close even if we have no paths left.
mav [Sat, 12 Nov 2016 18:57:38 +0000 (18:57 +0000)]
Do not report error on close even if we have no paths left.

MFC after:  2 weeks

7 years agoiwm: If firmware load fails during init via iwm_preinit() we bail out
gavin [Sat, 12 Nov 2016 18:33:56 +0000 (18:33 +0000)]
iwm: If firmware load fails during init via iwm_preinit() we bail out
before calling ieee80211_ifattach() so the taskqueue hasn't been
initialized. Don't try to drain it, we'll panic.
Looks like this issue was introduced in r303326.

Reviewed by: avos, sbruno, adrian
Differential Revision: https://reviews.freebsd.org/D8499

7 years agoAdd myself (def) as a src committer and pjd as my mentor.
def [Sat, 12 Nov 2016 18:04:03 +0000 (18:04 +0000)]
Add myself (def) as a src committer and pjd as my mentor.

Approved by: pjd (mentor)

7 years agortwn: enable 11n support for RTL8188CE.
avos [Sat, 12 Nov 2016 17:58:37 +0000 (17:58 +0000)]
rtwn: enable 11n support for RTL8188CE.

- Increase Rx buffer size from MCLBYTES to MJUMPAGESIZE.
- Provide an additional defragmentation routine for frames larger
than MCLBYTES; that is required by A-MSDU / Atheros Fast-Frames
support to work with current Tx path implementation.

Enabled features list for RTL8188CE:
- Atheros Fast-Frames;
- A-MPDU (Tx / Rx);
- A-MSDU (Tx / Rx; 4k only);
- Short Guard Interval.

Tested with:
- RTL8188CE (STA+AP) + RTL8821AU (STA).
- RTL8188CE (STA) + RTL8188CUS (AP).

Relnotes: yes

7 years agoThe return type of is_managed() was changed from boolean_t to bool type
skra [Sat, 12 Nov 2016 17:24:41 +0000 (17:24 +0000)]
The return type of is_managed() was changed from boolean_t to bool type
in r308569. Now, propagate this change further for consistency sake.

MFC after: 2 weeks

7 years agoAlways call PHYS_TO_VM_PAGE() in is_managed(). Fast road for addresses
skra [Sat, 12 Nov 2016 17:03:21 +0000 (17:03 +0000)]
Always call PHYS_TO_VM_PAGE() in is_managed(). Fast road for addresses
under first_page cannot be taken as this variable is connected only to
vm_page_array segment. There could be more segments in system like
the ones for various fictitious page ranges. These can be situated
under vm_page_array segment and so, they could be skipped before this
fix. However, as far as I know, there is no report associated with it.

While here, the return type of this function is changed from boolean_t
to bool type.

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

7 years agoSet of improvements to acpi_hp(4) driver.
mav [Sat, 12 Nov 2016 05:09:39 +0000 (05:09 +0000)]
Set of improvements to acpi_hp(4) driver.

 - Attach only to WMI devices that provide supported GUIDs.  HP Spectre x360
has two WMI devices, only one of which provides the GUIDs.
 - Pass proper device to ACPI_WMI_REMOVE_EVENT_HANDLER() on detach.
 - Improve error WMI handling separating status and data paths.  This allows
to hide sysctls not supported by specific hardware/BIOS.
 - Improve CMI block parser to make it work on HP Spectre x360 laptop.
 - In verbose mode log all unknown events to help futher improvements.

7 years agoFix build when WITHOUT_BLACKLIST=yes is specified
lidl [Sat, 12 Nov 2016 03:07:41 +0000 (03:07 +0000)]
Fix build when WITHOUT_BLACKLIST=yes is specified

PR: 214409
Submitted by: matthew
Reported by: matteo
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoReserve space for control message payload (currently a port name).
jceel [Sat, 12 Nov 2016 01:41:43 +0000 (01:41 +0000)]
Reserve space for control message payload (currently a port name).

Approved by: trasz (mentor)
Sponsored by: iXsystems, Inc.

7 years agoAllow scheduling during early boot.
jhb [Sat, 12 Nov 2016 00:23:09 +0000 (00:23 +0000)]
Allow scheduling during early boot.

- Send IPI wakeups once SMP is started even if cold is true.
- Permit preemptions when cold is true.

These changes are needed for EARLY_AP_STARTUP.

MFC after: 2 weeks
Sponsored by: Netflix

7 years agoDon't place threads on the run queue after waking up other CPUs.
jhb [Sat, 12 Nov 2016 00:14:13 +0000 (00:14 +0000)]
Don't place threads on the run queue after waking up other CPUs.

The other CPU might resume and see a still-empty runq and go back to
sleep before sched_add() adds the thread to the runq.  This results
in a lost wakeup and a potential hang if the system is otherwise
completely idle.

The race originated due to a micro-optimization (my fault) in 4BSD in
that it avoided putting a thread on the run queue if the scheduler was
going to preempt to the new thread.  To avoid complexity while fixing
this race, just drop this optimization.  4BSD now always sets the
"owepreempt" flag when a preemption is warranted and defers the actual
preemption to the thread_unlock of the caller the same as ULE.

MFC after: 2 weeks
Sponsored by: Netflix

7 years agolibcc_{s,eh}: build without SSP
emaste [Fri, 11 Nov 2016 23:28:07 +0000 (23:28 +0000)]
libcc_{s,eh}: build without SSP

As in the gnu/lib/libgcc Makefile:
    libgcc is linked in last and thus cannot depend on ssp
    symbols coming from earlier libraries. Disable stack protection
    for this library.

Reviewed by: dim
Sponsored by: The FreeBSD Foundation

7 years agoFix git tools when run against a worktree
rstone [Fri, 11 Nov 2016 23:07:31 +0000 (23:07 +0000)]
Fix git tools when run against a worktree

In a git worktree, the gitdir is in an entirely different location.
In arcgit, use git rev-parse --git-dir to get the correct path to it
always.

When running git from outside of the work tree, as in importgit,
the path provided by git rev-parse --git-dir can be either a
relative or absolute path depending on the work tree.  Rather
than trying to deal with that, just use git -C.

Differential Revision: https://reviews.freebsd.org/D8501
Reviewed by: markj

7 years agoCorrect spelling in syslog: getttimeofday -> gettimeofday
gavin [Fri, 11 Nov 2016 21:53:38 +0000 (21:53 +0000)]
Correct spelling in syslog: getttimeofday -> gettimeofday

7 years agoReplace another fdt_is_compatible() call.
jhibbits [Fri, 11 Nov 2016 21:29:48 +0000 (21:29 +0000)]
Replace another fdt_is_compatible() call.

7 years agoPull in r263169 from upstream llvm trunk (by Tim Northover):
dim [Fri, 11 Nov 2016 21:01:45 +0000 (21:01 +0000)]
Pull in r263169 from upstream llvm trunk (by Tim Northover):

  AArch64: only try to use scaled fcvt ops on legal vector types.

  Before we ended up calling getSimpleVectorType on a <3 x float>, which
  asserted.

This fixes an assertion when building the print/ghostscript9-agpl-base
port for AArch64.

PR: 213865
MFC after: 3 days

7 years agoqueue.3: Document existing QMD_* macros
cem [Fri, 11 Nov 2016 20:44:33 +0000 (20:44 +0000)]
queue.3: Document existing QMD_* macros

Feedback from: bapt, bdrewery, emaste
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D3983

7 years agoioat(4): Fix race between process_events and reset_hw
cem [Fri, 11 Nov 2016 20:09:54 +0000 (20:09 +0000)]
ioat(4): Fix race between process_events and reset_hw

In the case where a hardware error is detected during
ioat_process_events, hardware may advance (by one descriptor, probably)
and a subsequent ioat_process_events may race the intended ioat_reset_hw
followup.  In that case, the second process_events would observe a
completion update that does not match the software "last_seen" status,
and attempt to successfully complete already-failed descriptors.

Guard against this race with the resetting_cleanup flag.

Reviewed by: bdrewery, markj
Sponsored by: Dell EMC Isilon

7 years agoIncrease the max allowed size of the microcode update blob for x86.
kib [Fri, 11 Nov 2016 18:57:41 +0000 (18:57 +0000)]
Increase the max allowed size of the microcode update blob for x86.

Newer CPUs (SkyLakes) have updates of 100K size, which is bigger than
current limit 32K. Increase it to 4M but leave the check around to
prevent kernel memory allocator abuse.  Some time ago, the memory for
update was allocated by contigmalloc(9), and it was reasonable to be
conservative as much as possible.  Since all uses of contigmalloc(9)
appear to be either misunderstanding or too cautious, and were
removed, provide more slack than strictly neccessary.

Submitted by: Oliver Pinter
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D8486

7 years agoSpell 'PACKAGE' correctly.
gjb [Fri, 11 Nov 2016 18:47:53 +0000 (18:47 +0000)]
Spell 'PACKAGE' correctly.

Submitted by: Kyle Evans, emaste
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoUse ofw_bus_node_is_compatible() instead of fdt_is_compatible()
jhibbits [Fri, 11 Nov 2016 18:10:13 +0000 (18:10 +0000)]
Use ofw_bus_node_is_compatible() instead of fdt_is_compatible()

No need to have two functions that do the same thing, let's let fdt_* go away,
and use ofw_bus_* equivalents instead.

Requested by: andrew

7 years agoAdd support for LOADER_RC setting in the pkgfs manifest (defaults to
stevek [Fri, 11 Nov 2016 17:41:17 +0000 (17:41 +0000)]
Add support for LOADER_RC setting in the pkgfs manifest (defaults to
/loader.rc) to specify a Forth file to read from the pkgfs tarball and
process by Ficl.

This allows for the tarball to do runtime things like load a
platform-specific FDT blob, among other things.

Reviewed by: imp
Approved by: sjg (mentor)
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D8494

7 years agoThe file_loadraw function grew an argument, update install function
stevek [Fri, 11 Nov 2016 16:59:26 +0000 (16:59 +0000)]
The file_loadraw function grew an argument, update install function
accordingly.

Reviewed by: imp
Approved by: sjg (mentor)
MFC after: 2 weeks
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D8494

7 years agoUse ofw_bus_node_is_compatible in more drivers used on arm.
andrew [Fri, 11 Nov 2016 15:42:12 +0000 (15:42 +0000)]
Use ofw_bus_node_is_compatible in more drivers used on arm.

Sponsored by: ABT Systems Ltd

7 years agoupdate SMB_BWRITE documentation, clarify SMB_BREAD
avg [Fri, 11 Nov 2016 15:16:37 +0000 (15:16 +0000)]
update SMB_BWRITE documentation, clarify SMB_BREAD

After removal of SMB_TRANS some information in the description of
SMB_BWRITE has become stale.  E.g., the maximum block size has been
restored to 32.

Also, the descriptions of SMB_BREAD and SMB_BWRITE had some
incorrect information on the SMBus protocol details.

MFC after: 1 week
X-MFC with: r308242
Differential Revision: https://reviews.freebsd.org/D8431

7 years agoUse the modern spelling of ofw_bus_node_is_compatible in sys/arm.
andrew [Fri, 11 Nov 2016 15:13:30 +0000 (15:13 +0000)]
Use the modern spelling of ofw_bus_node_is_compatible in sys/arm.

Sponsored by: ABT Systems Ltd

7 years agoiicsmb: SMB_MAXBLOCKSIZE can be used again
avg [Fri, 11 Nov 2016 15:11:54 +0000 (15:11 +0000)]
iicsmb: SMB_MAXBLOCKSIZE can be used again

The constant was set to the correct value in r308242.
While there, fix iicsmb_bread() to not use a value of an out parameter
'count'.

MFC after: 3 weeks
X-MFC after: r308242

7 years agointpm: clean up intsmb_bread and intsmb_pcall
avg [Fri, 11 Nov 2016 15:08:12 +0000 (15:08 +0000)]
intpm: clean up intsmb_bread and intsmb_pcall

The hardware does not implement SMBus Process Call command, so remove
ifdef-ed out code from intsmb_pcall.  The code used exactly the same
start sequence as for Write Word command.

intsmb_bread code used to access an in value of the count parameter,
but that parameter is supposed to be an out only parameter.
For example, smb(4) does not initialize it before calling smbus_bread.

MFC after: 3 weeks

7 years agosmbmsg: use a more convenient way of accessing data read from a slave
avg [Fri, 11 Nov 2016 15:00:13 +0000 (15:00 +0000)]
smbmsg: use a more convenient way of accessing data read from a slave

Developers writing code for accessing /dev/smb may use this base utility
as an example.  Now that SMB_READB, SMB_READW, SMB_PCALL behave as
documented, wwe can use them in a more convenient way than before.

MFC after: 4 weeks
X-MFC after: r308527

7 years agosmb: fix SMB_READB, SMB_READW, SMB_PCALL to work as documented
avg [Fri, 11 Nov 2016 14:41:02 +0000 (14:41 +0000)]
smb: fix SMB_READB, SMB_READW, SMB_PCALL to work as documented

Previously, those ioctls were defined as 'in' only, so rdata.byte and
rdata.word were never updated in the userland.  The read data went only
to rbuf if it was provided.  Thus, consumers were forced to always use it.

Now the ioctls are marked as in-out.
Compatibility handlers are provided for old ioctls.

PR: 213481
Reported by: Lewis Donzis <lew@perftech.com>
MFC after: 2 weeks
Relnotes: maybe
Differential Revision: https://reviews.freebsd.org/D8430

7 years agoFix ata_at91_alloc_resource to use rman_res_t.
andrew [Fri, 11 Nov 2016 14:30:09 +0000 (14:30 +0000)]
Fix ata_at91_alloc_resource to use rman_res_t.

Sponsored by: ABT Systems Ltd

7 years agoRemove more unneeded users of the fdt_pic_decode_t table.
andrew [Fri, 11 Nov 2016 14:22:35 +0000 (14:22 +0000)]
Remove more unneeded users of the fdt_pic_decode_t table.

Sponsored by: ABT Systems Ltd

7 years agoReplace OF_getprop ... fdt32_to_cpu with OF_getencprop. The latter
andrew [Fri, 11 Nov 2016 14:19:12 +0000 (14:19 +0000)]
Replace OF_getprop ... fdt32_to_cpu with OF_getencprop. The latter
correctly adjusts for the endian.

MFC after: 1 week
Sponsored by: ABT Systems Ltd

7 years agoMFV r305100: Update amd from am-utils 6.1.5 to 6.2.
cy [Fri, 11 Nov 2016 02:42:53 +0000 (02:42 +0000)]
MFV r305100: Update amd from am-utils 6.1.5 to 6.2.

Used extensively on my network over the past month.

Reviewed by: pfg, brooks
Suggested by: pfg
Obtained from: ftp://ftp.am-utils.org/pub/am-utils/
MFC after: 6 weeks
Relnotes: yes
Differential Revision: D8405

7 years agoReply to a snmpEngineID discovery PDU with a Report PDU as per the
syrinx [Thu, 10 Nov 2016 20:51:26 +0000 (20:51 +0000)]
Reply to a snmpEngineID discovery PDU with a Report PDU as per the
requirements of RFC 3414 section 4.

PR: 174974
Submitted by: pguyot@kallisys.net
Reported by: several people
Reviewed by: bz@

7 years agoAdd the laundry page count to the displays of systat, top, and vmstat.
markj [Thu, 10 Nov 2016 19:55:45 +0000 (19:55 +0000)]
Add the laundry page count to the displays of systat, top, and vmstat.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D8467

7 years agoPull in r263301 from upstream llvm trunk (by Ahmed Bougacha):
dim [Thu, 10 Nov 2016 19:40:14 +0000 (19:40 +0000)]
Pull in r263301 from upstream llvm trunk (by Ahmed Bougacha):

  [AArch64] Don't blindly lower f16/f128 FCCMPs.

  Instead, extend f16 (like we do when lowering a standalone SETCC),
  and let f128 be legalized to the RT calls.

  Fixes PR26803.

This fixes a fatal "Cannot select" backend error when building the
net/freerdp port for AArch64.

PR: 214380
MFC after: 3 days

7 years agopfctl: fix nested inline anchors
kp [Thu, 10 Nov 2016 18:41:43 +0000 (18:41 +0000)]
pfctl: fix nested inline anchors

Import the OpenBSD fix for nested inline anchors.

PR: 196314
Submitted by: krichy@cflinux.hu
Obtained from: OpenBSD

7 years ago[net80211] implement "first RX defines the BAW" hack.
adrian [Thu, 10 Nov 2016 18:36:40 +0000 (18:36 +0000)]
[net80211] implement "first RX defines the BAW" hack.

Unfortunately (sigh) some firmware doesn't provide the RX BA starting point,
so we need to cope and set a "close enough" sequence number so we (hopefully!)
don't discard frames as duplicates.

Tested:

* QCA9880v2, athp driver (under development), STA mode

7 years agoAdd limits(1) to native-xtools so that it can be used in qemu user-mode jails
antoine [Thu, 10 Nov 2016 16:27:34 +0000 (16:27 +0000)]
Add limits(1) to native-xtools so that it can be used in qemu user-mode jails

7 years agoImplement riscv jumpto() so world can be compiled.
br [Thu, 10 Nov 2016 12:54:33 +0000 (12:54 +0000)]
Implement riscv jumpto() so world can be compiled.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5