]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 years agoasc/ascq 44/0 is typically a non-transient, permanent error (at least until
scottl [Fri, 4 Nov 2016 16:56:36 +0000 (16:56 +0000)]
asc/ascq 44/0 is typically a non-transient, permanent error (at least until
the components are reset).  Therefore retries are pointless.  This is very
visible in SATL systems, for example an LSI SAS controller and a SATA HDD/SSD.

Reviewed by: ken
Obtained from: Netflix
MFC after: 3 days

7 years ago[gpio] Add GPIO driver for Intel Bay Trail SoC
gonzo [Fri, 4 Nov 2016 16:24:38 +0000 (16:24 +0000)]
[gpio] Add GPIO driver for Intel Bay Trail SoC

Bay Trail has three banks of GPIOs exposed to userland as /dev/gpiocN,
where N is 1, 2, and 3. Pins in each bank are pre-named to match names
on boards schematics: GPIO_S0_SCnn, GPIO_S0_NCnn, and GPIO_S5_nn.

Controller supports edge-triggered and level-triggered interrupts but
current version of the driver does not have interrupts support

7 years agolibgcc_s: make unspecified shlib symbols local
emaste [Fri, 4 Nov 2016 15:44:00 +0000 (15:44 +0000)]
libgcc_s: make unspecified shlib symbols local

We want only symbols explicitly specified in the Version.map.

Sponsored by: The FreeBSD Foundation

7 years agoFix grammar in a fortune.
vangyzen [Fri, 4 Nov 2016 15:11:51 +0000 (15:11 +0000)]
Fix grammar in a fortune.

7 years agoSystem Binary Interface (SBI) page was moved in latest version of
br [Fri, 4 Nov 2016 13:07:54 +0000 (13:07 +0000)]
System Binary Interface (SBI) page was moved in latest version of
Berkeley Boot Loader (BBL) due to code size increase.

We will need to dehardcode this somehow.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoDo not sleep in vm_wait() if pagedaemon did not yet started. Panic instead.
kib [Fri, 4 Nov 2016 12:58:50 +0000 (12:58 +0000)]
Do not sleep in vm_wait() if pagedaemon did not yet started.  Panic instead.

Requests which cannot be satisfied by allocators at boot time often
have unrealizable parameters.  Waiting for the pagedaemon' start would
hang the boot if done in the thread0 context and just never succeed if
executed from another thread.  In fact, for very early stages, sleep
attempt panics with obscure diagnostic about the scheduler state, and
explicit panic in vm_wait() makes the investigation much shorter by
cut off the examination of the thread and scheduler.

Theoretically, some subsystem might grab a resource to exhaustion, and
free it later in the boot process.  If this unlikely scenario does
appear for real, the way to diagnose the trouble can be revisited.

Reported by: emaste
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D8421

7 years agoTEGRA: Fix numerous issues in clock code.
mmel [Fri, 4 Nov 2016 11:40:11 +0000 (11:40 +0000)]
TEGRA: Fix numerous issues in clock code.
Define and export clocks related to XUSB driver.

7 years agoTEGRA: Add basic driver for memory controller.
mmel [Fri, 4 Nov 2016 11:39:19 +0000 (11:39 +0000)]
TEGRA: Add basic driver for memory controller.
For now, it only reports memory and SMMU access errors.

7 years agoAdd Allwinner UP SoC support to GENERIC on armv6
manu [Fri, 4 Nov 2016 04:47:08 +0000 (04:47 +0000)]
Add Allwinner UP SoC support to GENERIC on armv6

Relnotes: yes

7 years agohyperv/vmbus: Reset ch_dev, once the child is deleted.
sephe [Fri, 4 Nov 2016 01:14:41 +0000 (01:14 +0000)]
hyperv/vmbus: Reset ch_dev, once the child is deleted.

So it will not be mis-used later on, e.g. in vmbus_chan_printf().

Submitted by: dexuan
Reported by: dexuan
MFC after: 1 week
Sponsored by: Microsoft

7 years agoMFV r308265: Update tzdata to 2016i.
gjb [Thu, 3 Nov 2016 23:34:11 +0000 (23:34 +0000)]
MFV r308265: Update tzdata to 2016i.

Sponsored by: The FreeBSD Foundation

7 years agoAdd support for Allwinner H3 audio codec.
jmcneill [Thu, 3 Nov 2016 23:22:04 +0000 (23:22 +0000)]
Add support for Allwinner H3 audio codec.

The audio controller in the H3 is more or less the same as A10/A20 except
some registers are shuffled around. The mixer interface, however, is
completely different between SoCs. Separate a10_mixer_class and
h3_mixer_class implementations are now made available. This will also make
adding support for other SoCs easier in the future.

Reviewed by: andrew, ganbold
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D8425

7 years agoAdd a witness check to enforce that no non-sleeping locks are held when
adrian [Thu, 3 Nov 2016 23:11:33 +0000 (23:11 +0000)]
Add a witness check to enforce that no non-sleeping locks are held when
they shouldn't be.

I used this during driver bring-up to find that the Linux driver holds a
whole lot of locks whilst doing their equivalent of busdma operations.

If this works out well, it should be added to the other architecture busdma
implementations to aid in similar debugging.

Tested:

* bounce buffer and dmar busdma, Lenovo X230 laptop, all the internal
  hardware
* ath(4) too

Discussed with: jhb

7 years ago[ath] add the MIMO per-chain RSSI and noise floor information.
adrian [Thu, 3 Nov 2016 23:05:39 +0000 (23:05 +0000)]
[ath] add the MIMO per-chain RSSI and noise floor information.

This is a long time coming.  The general pieces have been floating around
in a local repo since circa 2012 when I dropped the net80211 support
into the tree.

This allows the per-chain RSSI and NF to show up in 'ifconfig wlanX list sta'.
I haven't yet implemented the EVM hookups so that'll show up; that'll come
later.

Thanks to Susie Hellings <susie@susie.id.au> who did the original work
on this a looong time ago for a company we both worked at.

7 years agoImport tzdata2016i.
gjb [Thu, 3 Nov 2016 22:50:41 +0000 (22:50 +0000)]
Import tzdata2016i.

Sponsored by: The FreeBSD Foundation

7 years agoReplace basename(3) by a thread-safe implementation.
ed [Thu, 3 Nov 2016 20:21:34 +0000 (20:21 +0000)]
Replace basename(3) by a thread-safe implementation.

Now that the changes to the dirname(3) function had some time to settle,
let's go ahead and use the same approach for replacing basename(3) by a
simple implementation that modifies the input string, thereby making it
thread-safe and guaranteed to succeed.

Unlike dirname(3), this function already had a thread-safe variant
basename_r(3). This function had its own set of problems, like having an
upper bound on the pathname length. Keep this function around for
compatibility, but remove most references from the man page. Make the
man page more similar to that of dirname(3).

As the basename_r(3) function is only provided by FreeBSD (and Bionic),
depending on its use is even more implementation defined than assuming
that basename(3) is thread-safe.

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

7 years agoUse proper MACHINE_ARCH.
bdrewery [Thu, 3 Nov 2016 19:39:32 +0000 (19:39 +0000)]
Use proper MACHINE_ARCH.

This fixes ports on mips after r308130.

7 years agoIn vm_fault()'s loop over the shadow chain, move a comment describing our
alc [Thu, 3 Nov 2016 16:44:55 +0000 (16:44 +0000)]
In vm_fault()'s loop over the shadow chain, move a comment describing our
invariants to a better place.  Also, add two comments concerning the
relationship between the map and vnode locks.

Reviewed by: kib
MFC after: 3 days

7 years agoo Add support for long double.
br [Thu, 3 Nov 2016 13:06:17 +0000 (13:06 +0000)]
o Add support for long double.
o Add support for latest RISC-V GNU toolchain.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoCheck for lengths being <= 0. Note that this interface can only
trasz [Thu, 3 Nov 2016 10:11:59 +0000 (10:11 +0000)]
Check for lengths being <= 0.  Note that this interface can only
be accessed by root.  It uses unsigned ints instead of size_t
to preserve the ABI.

PR: 207627
Submitted by: ryan@ryanday.net (with slight tweaks)
MFC after: 1 month

7 years agoMFV r308222: 6051 lzc_receive: allow the caller to read the begin record
avg [Thu, 3 Nov 2016 09:24:27 +0000 (09:24 +0000)]
MFV r308222: 6051 lzc_receive: allow the caller to read the begin record

illumos/illumos-gate@620f322510b2d6433f7f6af60fa52380c07756ad
https://github.com/illumos/illumos-gate/commit/620f322510b2d6433f7f6af60fa52380c07756ad

https://www.illumos.org/issues/6051
  Currently lzc_receive() requires that its snapname argument is a snapshot name
  (contains '@').
  zfs receive allows to specify just a dataset name and would try to deduce the
  snapshot name from the stream.
  I propose to allow lzc_receive() to do the same.
  That seems to be quite easy to implement, it requires only a small amount of
  logic, it does not require any additional system calls or any additional data
  from the stream.
  The benefit is that the new behavior would allow to keep the snapshot names the
  same between the sender and receiver at zero cost, without a need to pass the
  names out of band.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@icyb.net.ua>
MFC after: 2 weeks

7 years agosmbus: remove smbus_trans / SMB_TRANS
avg [Thu, 3 Nov 2016 07:40:52 +0000 (07:40 +0000)]
smbus: remove smbus_trans / SMB_TRANS

This change reverts most of r281985.

The method did not map to anything defined by SMBus protocol and could
not be implemented for SMBus controllers.

This change is obviously not backwards compatible, but I have good
reasons to believe that there have never been any users of SMB_TRANS.

Discussed with: grembo, jhb
MFC after: 6 weeks

7 years ago[evdev] Add evdev support to atkbd(4) driver
gonzo [Thu, 3 Nov 2016 00:56:59 +0000 (00:56 +0000)]
[evdev] Add evdev support to atkbd(4) driver

To enable event sourcing from atkbd kern.evdev.rcpt_mask value
should have bit 3 set.

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

7 years agoRemove the mbuf tag after use (for reinjected packets).
loos [Thu, 3 Nov 2016 00:26:58 +0000 (00:26 +0000)]
Remove the mbuf tag after use (for reinjected packets).

Fixes the packet processing in dummynet l2 rules.

Obtained from: pfSense
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoAdd support for the integrated DMA controller found in the Allwinner A31,
jmcneill [Wed, 2 Nov 2016 23:58:10 +0000 (23:58 +0000)]
Add support for the integrated DMA controller found in the Allwinner A31,
A64, A83T, and H3 SoCs.

Relnotes: yes

7 years agoRegister the device's xref handle at attach time.
jmcneill [Wed, 2 Nov 2016 23:53:47 +0000 (23:53 +0000)]
Register the device's xref handle at attach time.

7 years agoAdd support for H3 PLL2 (PLL_Audio).
jmcneill [Wed, 2 Nov 2016 23:49:57 +0000 (23:49 +0000)]
Add support for H3 PLL2 (PLL_Audio).

7 years agoThe DTS may report fewer than 4 parents for a module clock. Avoid setting
jmcneill [Wed, 2 Nov 2016 23:46:23 +0000 (23:46 +0000)]
The DTS may report fewer than 4 parents for a module clock. Avoid setting
the module clock parent to an out-of-range index in these cases.

7 years agoSince it's no longer accessing a powerpc-specific register, drop the #ifdef.
jhibbits [Wed, 2 Nov 2016 23:44:30 +0000 (23:44 +0000)]
Since it's no longer accessing a powerpc-specific register, drop the #ifdef.

7 years agoFix the build. protctl is only used on powerpc.
jhibbits [Wed, 2 Nov 2016 23:43:18 +0000 (23:43 +0000)]
Fix the build.  protctl is only used on powerpc.

While here, remove the need to check the SVR SPR, as others may be compatible
with the p1022-esdhc type.

7 years agoioat(4): Read CHANSTS register for suspended/halted checks
cem [Wed, 2 Nov 2016 23:18:16 +0000 (23:18 +0000)]
ioat(4): Read CHANSTS register for suspended/halted checks

The device doesn't accurately update the CHANCMP address with the device state
when the device is suspended or halted.  So, read the CHANSTS register to check
for those states.

We still need to read the CHANCMP address for the last completed descriptor.

Sponsored by: Dell EMC Isilon

7 years agosh: Add simple test for 'set -C' (noclobber).
jilles [Wed, 2 Nov 2016 22:33:37 +0000 (22:33 +0000)]
sh: Add simple test for 'set -C' (noclobber).

To ensure fast test runs, race conditions are not tested.

7 years agoRemove remnants of the recursive sleep support. Instead assert that
kib [Wed, 2 Nov 2016 20:57:20 +0000 (20:57 +0000)]
Remove remnants of the recursive sleep support.  Instead assert that
we never try to sleep while the thread is on a sleepqueue.

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

7 years agodev/cpuctl: put debug output under CPUCTL_DEBUG rather than DEBUG
avg [Wed, 2 Nov 2016 17:47:19 +0000 (17:47 +0000)]
dev/cpuctl: put debug output under CPUCTL_DEBUG rather than DEBUG

DEBUG is a well-known flag.
It doesn't imply that there is a particular interest in cpuctl.

MFC after: 1 week

7 years agofix typo in a comment
avg [Wed, 2 Nov 2016 17:12:15 +0000 (17:12 +0000)]
fix typo in a comment

MFC after: 5 weeks
X-MFC with: r308219

7 years agosmbus: remove the potentially very dangerous slave probing code
avg [Wed, 2 Nov 2016 17:07:18 +0000 (17:07 +0000)]
smbus: remove the potentially very dangerous slave probing code

MFC after: 5 weeks

7 years agoichiic/ig4: completely disengage from smbus
avg [Wed, 2 Nov 2016 17:04:00 +0000 (17:04 +0000)]
ichiic/ig4: completely disengage from smbus

MFC after: 5 weeks

7 years agoAdd support for microcode update on newer AMD CPUs (10h+)
avg [Wed, 2 Nov 2016 16:15:49 +0000 (16:15 +0000)]
Add support for microcode update on newer AMD CPUs (10h+)

This includes new code for parsing microcode files as well as
the kernel-side change to apply the update on all processors
at the same time.

Developed with help from Borislav Petkov, formerly bp@amd64.org.

Tested using Athlon II X2 processor on a system where BIOS does
not have the latest microcode version:
/boot/firmware/microcode_amd.bin: updating cpu /dev/cpuctl0 to revision 0x10000c7... done.

The microcode file is taken from here:
https://web.archive.org/web/20160528230514/http://www.amd64.org/microcode.html
(note that the original site seems to be down at the moment)
It can also be found here:
https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/amd-ucode

Reviewed by: kib, stas
MFC after: 2 weeks
Relnotes: maybe
Differential Revision: https://reviews.freebsd.org/D8384

7 years agoAdd a fallback to the device mapper logic. We've seen systems in the field
scottl [Wed, 2 Nov 2016 15:13:25 +0000 (15:13 +0000)]
Add a fallback to the device mapper logic.  We've seen systems in the field
that are apparently misconfigured by the manufacturer and cause the mapping
logic to fail.  The fallback allows drive numbers to be assigned based on the
PHY number that they're attached to.  Add sysctls and tunables to overrid
this new behavior, but they should be considered only necessary for debugging.

Reviewed by:  imp, smh
Obtained from: Netflix
MFC after: 3 days
Sponsored by: D8403

7 years agoIn rtadvd, interface lookup calls if_indextoname() many times in a loop,
fabient [Wed, 2 Nov 2016 15:11:23 +0000 (15:11 +0000)]
In rtadvd, interface lookup calls if_indextoname() many times in a loop,
(it takes a long time on systems with many interfaces)
without reason and without checking its return value.

Reviewed by: cem
Obtained from: Maryse Levavasseur <maryse.levavasseur@stormshield.eu>
MFC after: 1 month
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D6979

7 years agoRemoved unused M_TSO_LEN.
sbruno [Wed, 2 Nov 2016 14:25:30 +0000 (14:25 +0000)]
Removed unused M_TSO_LEN.

MFC after: 2 weeks

7 years agoAdd BeagleBone Black support to GENERIC on armv6.
andrew [Wed, 2 Nov 2016 13:11:19 +0000 (13:11 +0000)]
Add BeagleBone Black support to GENERIC on armv6.

Reviewed by: mmel, imp
Relnotes: yes
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D8335

7 years agoAllow an SMP kernel to boot on Cortex-A8:
andrew [Wed, 2 Nov 2016 13:10:08 +0000 (13:10 +0000)]
Allow an SMP kernel to boot on Cortex-A8:
 * Rename ARM_HAVE_MP_EXTENSIONS to ARM_USE_MP_EXTENSIONS and extend it to
   handle more cases, including when SMP is not enabled.
 * Check ARM_USE_MP_EXTENSIONS when building for ARMv7+, even if no SMP.
 * Use ARM_USE_MP_EXTENSIONS in pmap-v6.c to detect when to set PRRR_NS1.

With this we should be able to boot on all ARMv7+ Cortex-A cores with
32-bit support.

Reviewed by: mmel, imp (earlier version)
Relnotes: yes
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D8335

7 years agoAllow some dotdot lookups in capability mode.
kib [Wed, 2 Nov 2016 12:43:15 +0000 (12:43 +0000)]
Allow some dotdot lookups in capability mode.

If dotdot lookup does not escape from the file descriptor passed as
the lookup root, we can allow the component traversal.  Track the
directories traversed, and check the result of dotdot lookup against
the recorded list of the directory vnodes.

Dotdot lookups are enabled by sysctl vfs.lookup_cap_dotdot, currently
disabled by default until more verification of the approach is done.

Disallow non-local filesystems for dotdot, since remote server might
conspire with the local process to allow it to escape the namespace.
This might be too cautious, provide the knob
vfs.lookup_cap_dotdot_nonlocal to override as well.

Idea by: rwatson
Discussed with: emaste, jonathan, rwatson
Reviewed by: mjg (previous version)
Tested by: pho (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 2 week
Differential revision: https://reviews.freebsd.org/D8110

7 years agoRemove tautological casts.
kib [Wed, 2 Nov 2016 12:10:39 +0000 (12:10 +0000)]
Remove tautological casts.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoStyle fixes.
kib [Wed, 2 Nov 2016 12:02:31 +0000 (12:02 +0000)]
Style fixes.

Discussed with: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 years agoFix getfsstat(2) with MNT_WAIT to not skip filesystems that are in the
trasz [Wed, 2 Nov 2016 09:43:19 +0000 (09:43 +0000)]
Fix getfsstat(2) with MNT_WAIT to not skip filesystems that are in the
process of being unmounted.  Previously it would skip them, even if the
unmount eventually failed eg due to the filesystem being busy.

This behaviour broke autounmountd(8) - if you tried to manually unmount
a mounted filesystem, using 'automount -u', and the autounmountd attempted
to refresh the filesystem list in that very moment, it would conclude that
the filesystem got unmounted and not try to unmount it afterwards.

Reviewed by: kib@
Tested by: pho@
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D8030

7 years agoMake autounmountd(8) not die when traced with "truss -p".
trasz [Wed, 2 Nov 2016 08:12:37 +0000 (08:12 +0000)]
Make autounmountd(8) not die when traced with "truss -p".

MFC after: 1 month

7 years agohyperv/kvp: Don't mix message status codes and function return values.
sephe [Wed, 2 Nov 2016 07:18:27 +0000 (07:18 +0000)]
hyperv/kvp: Don't mix message status codes and function return values.

While I'm here, move message status codes to hv_utilreg.h, since they
will be used by the upcoming VSS stuffs.

Submitted by: Hongjiang Zhang <honzhan microsoft com>
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8391

7 years agoMFV r308196:
delphij [Wed, 2 Nov 2016 06:49:25 +0000 (06:49 +0000)]
MFV r308196:

Fix OpenSSH remote Denial of Service vulnerability.

Security: CVE-2016-8858

7 years agoefinet_dev_print should honor verbose option.
tsoome [Wed, 2 Nov 2016 06:37:35 +0000 (06:37 +0000)]
efinet_dev_print should honor verbose option.

lsdev should display detailed information about net devices only with -v
switch. This will make EFI and BIOS version of the loader to have the
same behavior.

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

7 years agohyperv: GC unused functions.
sephe [Wed, 2 Nov 2016 05:41:23 +0000 (05:41 +0000)]
hyperv: GC unused functions.

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

7 years agoAdd P1022 and compatible SVR IDs
jhibbits [Wed, 2 Nov 2016 03:07:01 +0000 (03:07 +0000)]
Add P1022 and compatible SVR IDs

The eSDHC driver requires these IDs.  Missed in r308188.

7 years ago[psm] Fix choosing wrong mode for synaptic device + trackpoint
gonzo [Wed, 2 Nov 2016 01:27:20 +0000 (01:27 +0000)]
[psm] Fix choosing wrong mode for synaptic device + trackpoint

With guest trackpoint present trackpoint probing switched synaptics
device to absolute mode with different protocol instead of keeping it
in relative mode.

PR: 213757
Submitted by: Vladimir Kondratyev <wulf@cicgroup.ru>
MFC after: 1 week

7 years agoMerge i.MX and PowerPC SDHCI drivers
jhibbits [Wed, 2 Nov 2016 00:57:04 +0000 (00:57 +0000)]
Merge i.MX and PowerPC SDHCI drivers

Summary:
i.MX5 and PowerPC use a very similar eSDHC controller, which is also
similar to the uSDHC controller used by i.MX6.  The imx_sdhci driver works
almost completely with PowerPC, with some minor tweaks.

There is one caveat with this: reset currently does not work on PowerPC, so has
been #ifdef'd out until this can be tracked down and fixed.  If resets are done
the controller will timeout all data transactions.  Without a reset, it appears
to work just fine.

This is part 3, following up r308186 and r308187.

Test Plan:
This has been tested on a PowerPC QorIQ P1022 board.  It has not been
tested on i.MX, but no regressions are expected.

Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D8407

7 years agoToggle card insert/remove interrupt enable bits on events
jhibbits [Wed, 2 Nov 2016 00:54:39 +0000 (00:54 +0000)]
Toggle card insert/remove interrupt enable bits on events

Some controllers (namely Freescale's eSDHC, tested) will continue to assert
the card removed or card insert interrupts even after being handled.  To work
around this, disable watching the interrupt that just occurred until the
opposite interrupt is triggered.

Linux has a similar change in its driver to address the same problem.

7 years agoMove imx_sdhci driver over to a dev/sdhci in preparation for QorIQ support.
jhibbits [Wed, 2 Nov 2016 00:51:09 +0000 (00:51 +0000)]
Move imx_sdhci driver over to a dev/sdhci in preparation for QorIQ support.

Freescale uses eSDHC in both i.MX (ARM) and QorIQ (PowerPC), with slight
differences.  This is part one in unifying the drivers.

Reviewed by: imp

7 years ago[iwm] Set full-offload scan flag. Fixes fw panic when already associated.
ivadasz [Tue, 1 Nov 2016 22:47:58 +0000 (22:47 +0000)]
[iwm] Set full-offload scan flag. Fixes fw panic when already associated.

* Starting a scan from wpa_supplicant or via ifconfig while associated,
  should no longer cause firmware panics or abort early.

Tested:

* AC7260, STA mode

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

7 years ago[iwm] Get rid of SYNC_RESP_STRUCT and SYNC_RESP_PTR macros.
ivadasz [Tue, 1 Nov 2016 22:38:26 +0000 (22:38 +0000)]
[iwm] Get rid of SYNC_RESP_STRUCT and SYNC_RESP_PTR macros.

* SYNC_RESP_STRUCT and SYNC_RESP_PTR originate from the OpenBSD version of
  iwm, and they weren't serving any real purpose in the FreeBSD port.

* We just do a single bus_dmamap_sync for syncing the complete received frame,
  instead of explicitly bus_dmamap_sync-ing subranges of the frame like in
  the OpenBSD iwm code.

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

7 years agoRemove MATCHOUI macro, unused since r197980.
gavin [Tue, 1 Nov 2016 22:03:36 +0000 (22:03 +0000)]
Remove MATCHOUI macro, unused since r197980.

7 years agoAdd rules to build LLVM IR binaries and libraries.
jonathan [Tue, 1 Nov 2016 21:27:42 +0000 (21:27 +0000)]
Add rules to build LLVM IR binaries and libraries.

Running `make libfoo.ll` or `make libfoo.bc` within a library directory
will now give us an LLVM IR version of the library, and `make foo.full.ll`
or `make foo.full.bc` will give us an IR version of a binary.

As part of this change, we add an LLVM_LINK variable to sys.mk that can be
specified/overridden using an external toolchain.

Reviewed by: bdrewery, brooks
Approved by: rwatson (mentor)
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8388

7 years agoSet slow start threshold more accurately on loss to be flightsize/2 instead of
hiren [Tue, 1 Nov 2016 21:08:37 +0000 (21:08 +0000)]
Set slow start threshold more accurately on loss to be flightsize/2 instead of
cwnd/2 as recommended by RFC5681. (spotted by mmacy at nextbsd dot org)

Restore pre-r307901 behavior of aligning ssthresh/cwnd on mss boundary. (spotted
by slawa at zxy dot spb dot ru)

Tested by:     dim, Slawa <slawa at zxy dot spb dot ru>
MFC after:     1 month
X-MFC with:     r307901
Sponsored by:     Limelight Networks
Differential Revision: https://reviews.freebsd.org/D8349

7 years agoioat(4): Allocate contiguous descriptors
cem [Tue, 1 Nov 2016 19:18:54 +0000 (19:18 +0000)]
ioat(4): Allocate contiguous descriptors

This allows us to make strong assertions about descriptor address
validity.  Additionally, future generations of the ioat(4) hardware will
require contiguous descriptors.

Reviewed by: markj
Sponsored by: Dell EMC Isilon

7 years agoioat(4): Simplify by removing dynamic scaling
cem [Tue, 1 Nov 2016 19:18:52 +0000 (19:18 +0000)]
ioat(4): Simplify by removing dynamic scaling

This paves the way for a contiguous descriptor array.

A contiguous descriptor array has the benefit that we can make strong
assertions about whether an address is a valid descriptor or not.  The
other benefit is that future generations of I/OAT hardware will require
a contiguous descriptor array anyway.  The downside is that after system
boot, big chunks of contiguous memory is much harder to find.  So
dynamic scaling after boot is basically impossible.

Reviewed by: markj
Sponsored by: Dell EMC Isilon

7 years agoAdd test case for >65535 segment coredumps
cem [Tue, 1 Nov 2016 19:18:16 +0000 (19:18 +0000)]
Add test case for >65535 segment coredumps

A long-belated follow-up to r303099.

With feedback from: jmmv, ngie
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D7264

7 years agoStop abusing from struct ifnet presence to determine the packet direction
loos [Tue, 1 Nov 2016 18:42:44 +0000 (18:42 +0000)]
Stop abusing from struct ifnet presence to determine the packet direction
for dummynet, use the correct argument for that, remove the false coment
about the presence of struct ifnet.

Fixes the input match of dummynet l2 rules.

Obtained from: pfSense
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC (Netgate)

7 years agoRevisit blacklistd support in ftpd
lidl [Tue, 1 Nov 2016 18:18:09 +0000 (18:18 +0000)]
Revisit blacklistd support in ftpd

Enhance blacklistd support to not log anything by default,
unless blacklistd support is enabled on the command line.
Document new flag in man page, cleanup patches to be less
intrusive in code.

Reported by: Rick Adams
Reviewed by: cem, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8374

7 years agoMove and revise a comment about the relation between the object's paging-
alc [Tue, 1 Nov 2016 17:11:10 +0000 (17:11 +0000)]
Move and revise a comment about the relation between the object's paging-
in-progress count and the vnode.  Prior to r188331, we always acquired
the vnode lock before incrementing the object's paging-in-progress count.
Now, we increment it before attempting to acquire the vnode lock with
LK_NOWAIT, but we never sleep acquiring the vnode lock while we have the
count incremented.

Reviewed by: kib
MFC after: 3 days

7 years agoFix ZIL records ordering when ZVOL opened both with and without FSYNC.
mav [Tue, 1 Nov 2016 16:03:31 +0000 (16:03 +0000)]
Fix ZIL records ordering when ZVOL opened both with and without FSYNC.

Before this an earlier writes to a ZVOL opened without FSYNC could get to
ZIL after later writes to the same ZVOL opened with FSYNC.  Fix this by
replicating functionality of ZPL (zv_sync_cnt equivalent to z_sync_cnt),
marking all log records sync if anybody opened the ZVOL with FSYNC.

MFC after: 2 weeks

7 years agolibm: add braces around initialization of subobjects
emaste [Tue, 1 Nov 2016 15:11:10 +0000 (15:11 +0000)]
libm: add braces around initialization of subobjects

This cleans up a warning when building libm at higher WARNS levels and
makes the intent more clear. By the C standard the values are assigned
to subobject members in order so this change introduces no functional
change. (6.7.9 20)

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

7 years agoarm64 make-memstick.sh: use 'set -e' to abort if any step fails
emaste [Tue, 1 Nov 2016 14:50:32 +0000 (14:50 +0000)]
arm64 make-memstick.sh: use 'set -e' to abort if any step fails

Also remove the now-redundant error handling that was only for makefs.

This script was run on an older FreeBSD host that lacked efi-on-mbr
support in makefs. A warning was emitted on the console (from makefs)
but the script continued running and exited with 0.

Reviewed by: gjb
Sponsored by: The FreeBSD Foundation

7 years agoLocale fix for endian big (EB) machines.
br [Tue, 1 Nov 2016 13:54:44 +0000 (13:54 +0000)]
Locale fix for endian big (EB) machines.

We have locale files generated on EL machines (e.g. during cross-build
on amd64 host), but then we are using them on EB machines (e.g. MIPS64EB),
so proceed byte-swap if necessary.

All the libc tests passed successfully, including Russian collation.

Tested by: br@, Hongyan Xia <hx242@cam.ac.uk>
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D8281

7 years agoPass to zvol_log_truncate() same sync values as to zvol_log_write().
mav [Tue, 1 Nov 2016 12:47:19 +0000 (12:47 +0000)]
Pass to zvol_log_truncate() same sync values as to zvol_log_write().

Surplus marking of TX_TRUNCATE records as sync could result in putting them
into ZIL before previous writes if ones were async.

MFC after: 2 weeks

7 years agohyperv/vmbus: Avoid extra header copy.
sephe [Tue, 1 Nov 2016 08:30:06 +0000 (08:30 +0000)]
hyperv/vmbus: Avoid extra header copy.

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

7 years agohyperv/hn: Directly fill chimney sending buffer for small packets.
sephe [Tue, 1 Nov 2016 08:20:33 +0000 (08:20 +0000)]
hyperv/hn: Directly fill chimney sending buffer for small packets.

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

7 years agohyperv/hn: Move TSO packet fixup to an earlier place for if_transmit.
sephe [Tue, 1 Nov 2016 07:41:26 +0000 (07:41 +0000)]
hyperv/hn: Move TSO packet fixup to an earlier place for if_transmit.

While TSO packet header may be still cache-hot.

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

7 years agoMake sure the virtual T-axis buttons generate button release event(s)
hselasky [Tue, 1 Nov 2016 07:15:39 +0000 (07:15 +0000)]
Make sure the virtual T-axis buttons generate button release event(s)
for continuous tilting.

PR: 213957
MFC after: 3 days

7 years agohyperv/hn: Regroup if_start related functions.
sephe [Tue, 1 Nov 2016 07:10:43 +0000 (07:10 +0000)]
hyperv/hn: Regroup if_start related functions.

And put them under HN_IFSTART_SUPPORT, which is by default on until
we whack the if_start related bits from base system.

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

7 years agohyperv/hn: Rename cleaned up file.
sephe [Tue, 1 Nov 2016 06:54:25 +0000 (06:54 +0000)]
hyperv/hn: Rename cleaned up file.

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

7 years agohyperv/hn: Cosmetic cleanup; no functional changes.
sephe [Tue, 1 Nov 2016 04:44:11 +0000 (04:44 +0000)]
hyperv/hn: Cosmetic cleanup; no functional changes.

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

7 years ago- Fix `make` in sys/modules/bhnd
lwhsu [Tue, 1 Nov 2016 03:49:31 +0000 (03:49 +0000)]
- Fix `make` in sys/modules/bhnd

Reviewed by: landonf, imp
Differential Revision: https://reviews.freebsd.org/D8385

7 years agosyslogd(8): add an 'include' keyword
bapt [Tue, 1 Nov 2016 01:41:24 +0000 (01:41 +0000)]
syslogd(8): add an 'include' keyword

All the '.conf' files not beginning with a '.' contained int he directory
following the keyword will be included.

This keyword can only be used in the first level configuration files.

Modify the default syslogd.conf to 'include' /etc/syslog.d and
/usr/local/etc/syslog.d

It simplify a lot handling of syslog from automation tools.

Reviewed by: markj, kib (via irc)
Approved by: markj
MFC after: 2 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D8402

7 years agoAllow symlinks to be followed in cron.d directories and fix detection of
bapt [Mon, 31 Oct 2016 23:40:04 +0000 (23:40 +0000)]
Allow symlinks to be followed in cron.d directories and fix detection of
regular files on NFS

Reported by: jilles

7 years agoFix typo in cron(8) date
bapt [Mon, 31 Oct 2016 23:32:38 +0000 (23:32 +0000)]
Fix typo in cron(8) date

Reported by: jilles

7 years agoFix packaging /usr/lib{,32}/libgcc_eh{,_p}.a.
gjb [Mon, 31 Oct 2016 23:13:09 +0000 (23:13 +0000)]
Fix packaging /usr/lib{,32}/libgcc_eh{,_p}.a.

Reported by: woodsb02
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

7 years agoAdd BUF_TRACKING and FULL_BUF_TRACKING buffer debugging
cem [Mon, 31 Oct 2016 23:09:52 +0000 (23:09 +0000)]
Add BUF_TRACKING and FULL_BUF_TRACKING buffer debugging

Upstream the BUF_TRACKING and FULL_BUF_TRACKING buffer debugging code.
This can be handy in tracking down what code touched hung bios and bufs
last. The full history is especially useful, but adds enough bloat that
it shouldn't be enabled in release builds.

Function names (or arbitrary string constants) are tracked in a
fixed-size ring in bufs. Bios gain a pointer to the upper buf for
tracking. SCSI CCBs gain a pointer to the upper bio for tracking.

Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D8366

7 years agoFix packaging /usr/share/examples/etc.
gjb [Mon, 31 Oct 2016 21:11:46 +0000 (21:11 +0000)]
Fix packaging /usr/share/examples/etc.

Reported by: woodsb02
MFC after: 3 days
X-MFC-With: r308148
Sponsored by: The FreeBSD Foundation

7 years agoANSIfy ffs_subr.c
emaste [Mon, 31 Oct 2016 20:43:43 +0000 (20:43 +0000)]
ANSIfy ffs_subr.c

Also renumber license clause to avoid skipping #3

7 years agoFix packaging calendar(1) files.
gjb [Mon, 31 Oct 2016 20:31:56 +0000 (20:31 +0000)]
Fix packaging calendar(1) files.

Sponsored by: The FreeBSD Foundation

7 years agoDetect integer overflow and limit the number of positional
br [Mon, 31 Oct 2016 18:38:58 +0000 (18:38 +0000)]
Detect integer overflow and limit the number of positional
arguments in the string format.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D8286

7 years agoMake sure the virtual T-axis buttons gets cleared for USB mice which has
hselasky [Mon, 31 Oct 2016 18:38:50 +0000 (18:38 +0000)]
Make sure the virtual T-axis buttons gets cleared for USB mice which has
less than 6 buttons.

PR: 213919
MFC after: 3 days

7 years agoMove declarations of invpcid_works and pmap_pcid_enabled to pmap.h.
jhb [Mon, 31 Oct 2016 18:37:05 +0000 (18:37 +0000)]
Move declarations of invpcid_works and pmap_pcid_enabled to pmap.h.

Previously these were only declared under #ifdef SMP in <machine/smp.h>.
However, these variables are defind in pmap.c unconditionally, and efirt.c
references them unconditionally.  This fixes non-SMP kernel builds.

Discussed with: kib
MFC after: 1 week

7 years agocron(8): add support for /etc/cron.d and /usr/local/etc/cron.d
bapt [Mon, 31 Oct 2016 18:20:12 +0000 (18:20 +0000)]
cron(8): add support for /etc/cron.d and /usr/local/etc/cron.d

For automation tools it is way easier to maintain files in directories rather
than modifying /etc/crontab.

The files in those directories are in the same format as /etc/crontab

Reviewed by: adrian
MFC after: 2 weeks
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D8400

7 years agoFix alignment issues on MIPS: align the pointers properly.
br [Mon, 31 Oct 2016 16:55:14 +0000 (16:55 +0000)]
Fix alignment issues on MIPS: align the pointers properly.

All the 5520 GEOM_ELI tests passed successfully on MIPS64EB.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D7905

7 years agoThere appeared to be even more copy/pastes. :)
mav [Mon, 31 Oct 2016 16:06:57 +0000 (16:06 +0000)]
There appeared to be even more copy/pastes. :)

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

7 years agoFix wrong copy/paste in error message.
mav [Mon, 31 Oct 2016 16:01:22 +0000 (16:01 +0000)]
Fix wrong copy/paste in error message.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 2 weeks

7 years agoUse correct signal number for floating point exceptions.
br [Mon, 31 Oct 2016 15:49:41 +0000 (15:49 +0000)]
Use correct signal number for floating point exceptions.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5

7 years agoAdd full softfloat and hardfloat support for MIPS.
br [Mon, 31 Oct 2016 15:33:58 +0000 (15:33 +0000)]
Add full softfloat and hardfloat support for MIPS.

This adds new target architectures for hardfloat:
mipselhf mipshf mips64elhf mips64hf.

Tested in QEMU only.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D8376

7 years agoWhen issuing a PXE dhcp request, always issue a param request (DHCP option 55)
bapt [Mon, 31 Oct 2016 15:11:55 +0000 (15:11 +0000)]
When issuing a PXE dhcp request, always issue a param request (DHCP option 55)
with all dhcp parameters we might be interested in.

Some DHCP server like the new kea (by ISC) expect it.

This makes pxeboot functional with ISC kea.

Submitted by: Vincent Legout <vincent.legout@gandi.net>
MFC after: 1 month
Sponsored by: Gandi.net

7 years agoxen: add a grant-table user-space device
royger [Mon, 31 Oct 2016 13:12:58 +0000 (13:12 +0000)]
xen: add a grant-table user-space device

A grant-table user-space device will allow user-space applications to map
and share grants (Xen way to share memory) among Xen domains. This grant
table user-space device has been tested with the QEMU Qdisk Xen backed.

Submitted by: jaggi
Reviewed by: royger
Differential review: https://reviews.freebsd.org/D7293