]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
6 years agoMFC r321876:
ian [Mon, 11 Sep 2017 20:33:20 +0000 (20:33 +0000)]
MFC r321876:

In xdev-links, when installing symlinks to the cross-compiler pieces that
includes the OS version (armv6-freebsd12.0-cc, etc), use the OS version of
the compiler/world source code, not the version of the build host machine.

6 years agoMFC r323128: Increase negotiation polling period from 10ms to 100ms.
mav [Mon, 11 Sep 2017 18:51:02 +0000 (18:51 +0000)]
MFC r323128: Increase negotiation polling period from 10ms to 100ms.

There is no big need to burn CPU if other side may be not there yet.  For
example, the PLX hardware by default enables the NTB link up on reset, not
dependig on driver to do it.  In case of Intel hardware this also reduces
race between MSI-X workaround negotiation and upper layers, using the same
scratchpad registers in different time.

6 years agoMFC r323126: Make NTB drivers report more info via NewBus methods.
mav [Mon, 11 Sep 2017 18:50:36 +0000 (18:50 +0000)]
MFC r323126: Make NTB drivers report more info via NewBus methods.

6 years agoMFC r323074: Clear doorbell bits after masking them before processing.
mav [Mon, 11 Sep 2017 18:50:09 +0000 (18:50 +0000)]
MFC r323074: Clear doorbell bits after masking them before processing.

In theory this allows to avoid one more expensive doorbell register read
later in some scenarios.  But in practice it also significantly increases
packet rate on PLX hardware, that I can't explain yet, possibly work-
arounding some interrupt delays.

6 years agoMFC r323032, r323053, r323058, r323059, r323084, r323114, r323127:
mav [Mon, 11 Sep 2017 18:48:09 +0000 (18:48 +0000)]
MFC r323032, r323053, r323058, r323059, r323084, r323114, r323127:
Add NTB driver for PLX/Avago/Broadcom PCIe switches.

This driver supports both NTB-to-NTB and NTB-to-Root Port modes (though
the second with predictable complications on hot-plug and reboot events).
I tested it with PEX 8717 and PEX 8733 chips, but expect it should work
with many other compatible ones too.  It supports up to two NT bridges
per chip, each of which can have up to 2 64-bit or 4 32-bit memory windows,
6 or 12 scratchpad registers and 16 doorbells.  There are also 4 DMA engines
in those chips, but they are not yet supported.

While there, rename Intel NTB driver from generic ntb_hw(4) to more specific
ntb_hw_intel(4), so now it is on par with this new ntb_hw_plx(4) driver and
alike to Linux naming.

6 years agoMFC r322981: Mask doorbells while processing them.
mav [Mon, 11 Sep 2017 18:31:51 +0000 (18:31 +0000)]
MFC r322981: Mask doorbells while processing them.

This fixes interrupt storms on hardware using legacy level-triggered
interrupts, since doorbell processing could take time after interrupt
handler completion, that triggered extra interrupts in a loop.

6 years agoMFC r322980: Fix fake interrupt when set doorbell is unmasked.
mav [Mon, 11 Sep 2017 18:30:50 +0000 (18:30 +0000)]
MFC r322980: Fix fake interrupt when set doorbell is unmasked.

Since the doorbell bit is already set when interrupt handler is called,
the event was not propagated to upper layer.  It was working normally
because present code was not using masking actively, but that is going
to change.

6 years agoMFC r320901-r320902, r320996-r320997, r321002, r321048, r321400, r321743,
ian [Mon, 11 Sep 2017 17:32:26 +0000 (17:32 +0000)]
MFC r320901-r320902, r320996-r320997, r321002, r321048, r321400, r321743,
    r321745

r320901:
Protect access to the AT realtime clock with its own mutex.

The mutex protecting access to the registered realtime clock should not be
overloaded to protect access to the atrtc hardware, which might not even be
the registered rtc. More importantly, the resettodr mutex needs to be
eliminated to remove locking/sleeping restrictions on clock drivers, and
that can't happen if MD code for amd64 depends on it. This change moves the
protection into what's really being protected: access to the atrtc date and
time registers.

This change also adds protection when the clock is accessed from
xentimer_settime(), which bypasses the resettodr locking.

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

r320902:
Support multiple realtime clocks, and remove locking/sleeping restrictions
on clock drivers.

This tracks multiple concurrent realtime clock drivers in a list sorted by
clock resolution.  When system time changes (and periodically) the
clock_settime() methods of all registered clocks are invoked.

To initialize system time, each driver is tried in turn from best to worst
resolution, until one succesfully returns a valid time.

The code no longer holds a mutex while calling the clock_settime() and
clock_gettime() methods of the registered clocks. This allows clock drivers
to do whatever kind of locking or sleeping is necessary (this is especially
important for i2c clock chips since i2c drivers often need to sleep).

A new clock_register_flags() function allows the clock driver to pass
flags. The flags currently defined help support drivers that use their own
techniques to avoid roundoff errors (prevents the 4/5 rounding done by the
subr_rtc code). A driver which may need to wait for resources (such as bus
ownership) may pass a flag to indicate that it will obtain system time for
itself after waiting for resources; this is merely an optimization to avoid
the common code retrieving a timespec that will never get used.

Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D11484

r320996:
Allow setting debug.clocktime as a tunable.  Print 64-bit time_t correctly
on 32-bit systems.

r320997:
Minor optimization: instead of converting between days and years using
loops that start in 1970, assume most conversions are going to be for recent
dates and use a precomputed number of days through the end of 2016.

r321002:
Revert r320997.  There are reports of it getting the wrong results, so
clearly my testing was insuffficent, and it's best to just revert it
until I get it straightened out.

r321048:
Minor optimization: instead of converting between days and years using loops
that start in 1970, assume most conversions are going to be for recent dates
and use a precomputed number of days through the end of 2016.

This is a do-over of r320997, hopefully this time with 100% more workiness.

The first attempt had an off-by-one error, but instead of just adding
another mysterious +1 adjustment, this rearranges the relationship between
recent_base_year and recent_base_days so that the latter is the number of
days that occurred before the start of the associated year (instead of the
count thru the end of that year).  This makes the recent_base stuff work
more like the original loop logic that didn't need any +1 adjustments.

r321400:
Add common code to support realtime clocks that store year without century.

Most realtime clocks store the year as 2 BCD digits.  Some add a century bit
to extend the range another hundred years.  Every clock driver has its own
code to determine the century and pass a full year value to clock_ct_to_ts().
Now clock drivers can just convert BCD to bin and store the result in the
clocktime struct and let the common code figure out the century.  Clocks
with a century bit can just add 100 to year if the century bit is on.

r321743:
Add taskqueue_enqueue_timeout_sbt(), because sometimes you want more control
over the scheduling precision than 'ticks' can offer, and because sometimes
you're already working with sbintime_t units and it's dumb to convert them
to ticks just so they can get converted back to sbintime_t under the hood.

r321745:
Add clock_schedule(), a feature that allows realtime clock drivers to
request that their clock_settime() methods be called at a given offset
from top-of-second.  This adds a timeout_task to the rtc_instance so that
each clock can be separately added to taskqueue_thread with the scheduling
it prefers, instead of looping through all the clocks at once with a
single task on taskqueue_thread.  If a driver doesn't call clock_schedule()
the default is the old behavior: clock_settime() is queued immediately.

6 years agoMFC r321583, r321584:
ian [Mon, 11 Sep 2017 17:01:26 +0000 (17:01 +0000)]
MFC r321583, r321584:

Add a pair of convenience routines for doing simple "register" read/writes
on i2c devices, where the "register" can be any length.

Add support for tracking nested calls to iicbus_request/release_bus().
Usually it is sufficient to use iicbus_transfer_excl(), or one of the
higher-level convenience functions that use it, to reserve the bus for the
duration of each register access.  Occasionally it is important that a
series of accesses or read-modify-write operations must be done without any
other intervening access to the device, to prevent corrupting state.

6 years agobsdgrep: add a primitive literal matcher to unbreak fgrep in some scenarios
kevans [Mon, 11 Sep 2017 15:52:24 +0000 (15:52 +0000)]
bsdgrep: add a primitive literal matcher to unbreak fgrep in some scenarios

MFC r322825: bsdgrep: add some additional tests for fgrep

Previously added tests only check that fgrep is somewhat sane and works. Add
some more tests that check that the implementation is basically functional
and not producing incorrect results with various flags.

MFC r322826: bsdgrep: add a primitive literal matcher

fgrep/grep -F will error out at runtime if compiled with a regex(3)
that does not define REG_NOSPEC or REG_LITERAL. glibc is one such regex(3)
implementation, and as it turns out they don't support literal matching at
all.

Provide a primitive literal matcher for use with glibc and other
implementations that don't support literal matching so that we don't
completely lose fgrep/grep -F if compiled against libgnuregex on stable/10,
stable/11, or other systems that we don't necessarily support.

This is a wholly unoptimized implementation with no plans to optimize it as
of now. This is due to both its use-case being primarily on unsupported
systems in the near-distant future and that it's reinventing the wheel that
we already have available as a feature of regex(3).

PR: 222201
Approved by: emaste (mentor, blanket MFC)

6 years agoMFC r321586:
ian [Mon, 11 Sep 2017 15:31:29 +0000 (15:31 +0000)]
MFC r321586:

Add a debug sysctl that lets you see i2c bus traffic through this device.

6 years agoMFC r322762, r322799, r322832, r322833:
kib [Mon, 11 Sep 2017 08:48:36 +0000 (08:48 +0000)]
MFC r322762, r322799, r322832, r322833:
Make WRFSBASE and WRGSBASE instructions functional.

Bump stable/11 __FreeBSD_version.

6 years agoMFC r322984:
kib [Mon, 11 Sep 2017 08:18:56 +0000 (08:18 +0000)]
MFC r322984:
Style.

6 years agoMFC r322982:
kib [Mon, 11 Sep 2017 08:16:38 +0000 (08:16 +0000)]
MFC r322982:
Verify that the BPB media descriptor and FAT ID match.

6 years agobhyve: actually call bhyve_caph_cache_catpages
rlibby [Mon, 11 Sep 2017 07:24:56 +0000 (07:24 +0000)]
bhyve: actually call bhyve_caph_cache_catpages

Gcc noticed that bhyve_caph_cache_catpages was defined but unused.
It is a stable/11 copy of caph_cache_catpages in head.

Direct commit to stable/11. This bug does not apply to head.

Reviewed by: grehan
Approved by: markj (mentor)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12212

6 years agoMFC r321669:
rlibby [Mon, 11 Sep 2017 07:22:53 +0000 (07:22 +0000)]
MFC r321669:

  bhyve/vga.c: fix atc_color_select_67 bit shift

6 years agoMFC r321668:
rlibby [Mon, 11 Sep 2017 07:21:34 +0000 (07:21 +0000)]
MFC r321668:

  bhyve/pci_e82545.c: squelch gcc warning for noreturn procedure

6 years agoMFC r321686:
ian [Mon, 11 Sep 2017 04:22:25 +0000 (04:22 +0000)]
MFC r321686:

Add inline functions to convert between sbintime_t and decimal time units.
Use them in some existing code that is vulnerable to roundoff errors.

6 years agoMFC r321489:
ian [Mon, 11 Sep 2017 03:24:50 +0000 (03:24 +0000)]
MFC r321489:

Use the MD __size_t to avoid a dependency on/include of non-MD header files.
This should fix the compilation of the lua 5.3.4 port, among others.

6 years agoMFC r320928, r320929:
ian [Mon, 11 Sep 2017 02:57:55 +0000 (02:57 +0000)]
MFC r320928, r320929:

Support the "disable-over-current" property for imx ehci controllers.
It turns out that this is more than a power optization.  The OTG port
won't work on boards that have this property unless this setting is honored.
Also ensure that the usb phy device attaches before ehci.

Put an #ifdef notyet wrapper around a function that's not being used yet,
to avoid compile warnings.

6 years agoMFC r320743:
ian [Mon, 11 Sep 2017 02:56:45 +0000 (02:56 +0000)]
MFC r320743:

Fix drivers that assume ticks starts at zero. These drivers all have logic
similar to "if (ticks > localvar+interval) {localvar=ticks; ...}" where
localvar is initialized to zero.  Ticks is initialized to a negative value
since r278230, and that leads to these if statements never being true.

6 years agoMFC r320655, r321933:
ian [Mon, 11 Sep 2017 02:52:41 +0000 (02:52 +0000)]
MFC r320655, r321933:

Add a driver for the imx6 on-chip realtime clock (snvs).

The imx6_snvs driver is not strictly required for the system to run, so
change it from standard to optional and add a device statement for it so
that it's included unless someone uses nodevice to eliminate it.

6 years agoMFC r320460, r320461, r320462, r320463:
ian [Mon, 11 Sep 2017 02:50:24 +0000 (02:50 +0000)]
MFC r320460, r320461, r320462, r320463:

If an i2c transfer ends due to error, issue a stop on the bus even if the
nostop option is set, if a start was issued.

Add iic_recover_bus(), a helper function that can be used by any i2c driver
which is able to manipulate the clock and data lines directly.
When an i2c bus is hung by a slave device stuck in the middle of a
transaction that didn't complete properly, this function manipulates the
clock and data lines in a sequence known to reliably reset slave devices.
The most common cause of a hung i2c bus is a system reboot in the middle of
an i2c transfer (so it doesnt' happen often, but now there is a way other
than power cycling to recover from it).

Add bus recovery handling to the imx5/imx6 i2c driver.

6 years agoMFC r320076:
ian [Mon, 11 Sep 2017 02:38:57 +0000 (02:38 +0000)]
MFC r320076:

Add a driver for the imx6 EPIT timer that can be used as the system
timecounter instead of the GPT timer, freeing up the more flexible GPT
hardware for other uses.  The EPIT driver is a standard (always in the
kernel) driver, and the existing GPT driver is now optional and included
only if you ask for device imx_gpt.

6 years agoMFC r320456:
ian [Mon, 11 Sep 2017 02:26:01 +0000 (02:26 +0000)]
MFC r320456:

Implement gpio input by reading the pad state register, not the data register.

6 years agoMFC r319899: Add missing header dependencies.
ian [Mon, 11 Sep 2017 02:14:28 +0000 (02:14 +0000)]
MFC r319899:  Add missing header dependencies.

6 years agoMFC r319817: Add a driver for the Vitesse/Microsemi VSC8501 PHY.
ian [Mon, 11 Sep 2017 02:13:51 +0000 (02:13 +0000)]
MFC r319817:  Add a driver for the Vitesse/Microsemi VSC8501 PHY.

6 years agoMFC r319814, r319815, r319818:
ian [Mon, 11 Sep 2017 01:59:24 +0000 (01:59 +0000)]
MFC r319814, r319815, r319818:

Add a set of constants describing the ways a MAC and PHY can be connected.
While the initial need for this is to help support phy drivers which are
configured with FDT data, there is nothing devicetree-specific about the
concept or the names, so they are available for use even on non-FDT systems.

Add some utility functions to help a PHY driver on an FDT-configured
system retrieve its config data from the fdt data.

Convert if_ffec from local code and constants for mac<->phy connection type
to new common fdt helper code.

6 years agoMFC r319859, r319888:
ian [Mon, 11 Sep 2017 01:53:22 +0000 (01:53 +0000)]
MFC r319859, r319888:

Add support for "make universe_kernels -DMAKE_GENERIC_KERNELS" to build
just the GENERIC kernels for each arch (including variations such as
GENERIC-NODEBUG, GENERIC64, etc).
This helps with quickly doing a test build for all[*] arches without
building dozens of variant kernels for the arches that have lots of
hardware/board/system variations.
[*] Not all arches have a generic kernel (but they probably should for
test-building purposes, even if it can't boot on any real hardware).

By popular demand: change MAKE_GENERIC_KERNELS to MAKE_LINT_KERNELS.
It appears that the same arches that lack GENERIC kernel configs also lack
LINT.  But enough different arches get built to ensure a kernel change
should build everywhere (32 and 64 bit, clang and old gcc, little and big
endian).

6 years agoMFC r319811, r319813:
ian [Mon, 11 Sep 2017 01:26:26 +0000 (01:26 +0000)]
MFC r319811, r319813:

Allow building if_ffec as a module.

if_ffec bugfixes related to harvesting of hardware-maintained statistics...

After harvesting the hardware statistics counters and summing them into the
interface stats, properly clear the hardware counters back to zero.  On imx5
and earlier hardware it is necessary to disable collection of stats while
writing zeroes to all the registers.  On imx6 and newer it turns out it's
not even possible to write zeroes, instead you have to toggle a special
"zero everything" control bit in a register.

Count incoming packets with a bad start frame delim as input errors, and
incoming packets dropped due to no fifo space as input drops.

Remove all code related to harvesting the hardware stats less often than
once per second.  It turns out the 32-bit stats registers are backed by
16-bit counters under the hood, and they can easily roll over if you only
harvest them once every 3 seconds like the old code was doing.  Now we just
read all the regs once a second.

The combination of not properly zeroing the stats registers and 16-bit
counters sometimes wrapping between harvest calls resulted in basically
unusable statistics before these changes.

6 years agoMFC r316664, r316670, r316972, r316996, r317033:
ian [Mon, 11 Sep 2017 01:01:00 +0000 (01:01 +0000)]
MFC r316664, r316670, r316972, r316996, r317033:

Add imx6ul support (applies to all files).

Add code/constants for detecting imx6ul (ultralite) chips, a species of
imx6 based on a single cortex-a7 core.  Other changes to imx6 drivers
and support code are needed to fully support the imx6ul.

if_ffec: Add imx6ul SoC support, and get the PHY number from the FDT data.
If there is no phy-handle property, fall back to using MII_PHY_ANY.
This still doesn't support an mdio bus with multiple PHYs on it, or the
possibility that the PHY being used by this instance of ffec is on the
mdio bus of some other instance (which is now a possibility with imx6ul).
Adding that support will require changes in fdt_get_phyaddr(), which is
currently making some assumptions that don't work with modern fdt data.

6 years agoMFC r316374, r316377:
ian [Mon, 11 Sep 2017 00:55:18 +0000 (00:55 +0000)]
MFC r316374, r316377:

Preserve the registers containing argc, argv, and return address values
passed in from u-boot across the call to self_reloc and any other early-init
code, and restore them before calling main().

Correct a comment... the stack used by ubldr is the same stack u-boot was
running on when it jumped to the ubldr entry point.  None of the arches
that use this code set up a different stack in their start.S routines.

6 years agoMFC r316995: Add support for the Micrel KSZ8081 ethernet PHY.
ian [Mon, 11 Sep 2017 00:51:47 +0000 (00:51 +0000)]
MFC r316995: Add support for the Micrel KSZ8081 ethernet PHY.

6 years agoMFC r315692: Eliminate a "format string is not a string literal" warning.
ian [Mon, 11 Sep 2017 00:19:09 +0000 (00:19 +0000)]
MFC r315692: Eliminate a "format string is not a string literal" warning.

6 years agoMFC r315589, r315591, r316659, r316661:
ian [Sun, 10 Sep 2017 23:48:20 +0000 (23:48 +0000)]
MFC r315589, r315591, r316659, r316661:

Eliminate unnecessary read/modify/write sequences during eventtimer setup.

Replace the hard-coded way-too-small minimum event timer period with a value
calculated at runtime based on how long it takes to set up an event in
hardware.  This fixes the intermittant 1-minute hang at boot on imx5
systems, and also the occasional oversleeping while running.  It doesn't
affect imx6 systems, which use different hardware for eventtimers.

Remove some old interrupt handling workaround code from the pre-INTRNG days.
At this point, INTRNG is not going away (the option may go away, but the
code is not), so we no longer need code to support workarounds that handled
the lack of INTRNG functionality.

Update the code that compensates for the lack of a GPC interrupt controller
driver for imx6.  Some newer dts source puts the GIC node at the root
instead of under /soc, so look in both places.  Also, sometimes the GIC
node doesn't list itself as its own interrupt-parent, allow that too.

6 years agoMFC r315574, r315576, r315577:
ian [Sun, 10 Sep 2017 23:41:23 +0000 (23:41 +0000)]
MFC r315574, r315576, r315577:

Convert the imx5 interrupt controller driver to INTRNG.

Add INTRNG option to EFIKA_MX config, it is an imx5-based platform.

Delete our local imx53-qsb.dts file; the code now runs fine using the
standard vendor-supplied file in sys/gnu/dts/arm.

6 years agoMFC r315572, r315573, r315575, r315578:
ian [Sun, 10 Sep 2017 23:31:21 +0000 (23:31 +0000)]
MFC r315572, r315573, r315575, r315578:

Add a module to build imx5 dtb files.

Add dtb/imx5 module build to the IMX53 kernel config.

Remove configs for IMX53-QSB and DIGI-CCWMX53. They were just
standard IMX53 with static dtb added, and now that imx53 can use vendor-
supplied dts files and ubldr, there is no need for a static-dtb variant.

6 years agoMFC r315530:
ian [Sun, 10 Sep 2017 23:12:07 +0000 (23:12 +0000)]
MFC r315530:

Remove unreferenced global function imx_gpt_get_timerfreq() and do some
cleanups enabled by that.

6 years agoMFC r315490, r315508:
ian [Sun, 10 Sep 2017 23:09:17 +0000 (23:09 +0000)]
MFC r315490, r315508:

Make the imx5 clocks driver work with vendor-supplied dts (which does not
supply the addresses for the DPLL register blocks) by hard-coding the
addresses in the driver source code.  Yes, this is just as bad an idea as
it sounds, but we have no choice.

Remove hardcoded bootverbose=1; imx53 systems boot using loader(8) and
users can set verbose if they want to.

6 years agoMFC r314723: Build the dtb files for the revb1 versions of wandboard.
ian [Sun, 10 Sep 2017 23:04:55 +0000 (23:04 +0000)]
MFC r314723:  Build the dtb files for the revb1 versions of wandboard.

6 years agoMFC r315167:
ian [Sun, 10 Sep 2017 20:17:31 +0000 (20:17 +0000)]
MFC r315167:

Change 'Hz' back to 'HZ'... it's referring to the kernel config option

6 years agoMFC r315165:
ian [Sun, 10 Sep 2017 20:16:35 +0000 (20:16 +0000)]
MFC r315165:

Correct the abbreviations for microseconds (us, not ms), and for Hz (not HZ).

6 years agoMFC r315089: Document uiomove_frombuf(9).
ian [Sun, 10 Sep 2017 20:13:20 +0000 (20:13 +0000)]
MFC r315089:  Document uiomove_frombuf(9).

6 years agoMFC r322374: bsdinstall: record DHCP config after obtaining lease
emaste [Sat, 9 Sep 2017 00:33:19 +0000 (00:33 +0000)]
MFC r322374: bsdinstall: record DHCP config after obtaining lease

Previously we added an ifconfig_$INTERFACE line to rc.conf for each
unsuccessful DCHP attempt.

PR: 219515
Sponsored by: The FreeBSD Foundation

6 years agoRegenerate src.conf(5) based on recent changes to src.opts.mk, etc.
ngie [Fri, 8 Sep 2017 04:51:16 +0000 (04:51 +0000)]
Regenerate src.conf(5) based on recent changes to src.opts.mk, etc.

6 years agoMFC r321952:
ngie [Fri, 8 Sep 2017 04:48:25 +0000 (04:48 +0000)]
MFC r321952:

Allowing MK_NLS_CATALOGS to be enabled if MK_NLS == no doesn't make a whole lot
of sense. Anchor MK_NLS_CATALOGS being enabled off of MK_NLS.

6 years agoMFC r320701:
ngie [Fri, 8 Sep 2017 04:46:55 +0000 (04:46 +0000)]
MFC r320701:

Remove SUBDIR ordering/uniquifying in *bin/Makefile

After the addition of SUBDIR.yes, uniquifying/ordering the SUBDIRs doesn't
make a whole lot of sense, and it's in effect a half measure.

Ordering SUBDIR (after adding SUBDIR.yes to it) in bsd.subdir.mk is a
separate change that warrants more discussion/testing, because while
the SUBDIR_PARALLEL work largely fixed dependency ordering for SUBDIRs,
there might be downstream FreeBSD consumers that rely on the SUBDIR
ordering.

6 years agoMFC r321704,r321705,r321706:
ngie [Fri, 8 Sep 2017 04:45:18 +0000 (04:45 +0000)]
MFC r321704,r321705,r321706:

r321704:

Add sys/socket.h to SYNOPSIS for libprocstat(3)

sys/socket.h is required for procstat_get_socket_info(3), added in
r221807.

PR: 217884

r321705:

libprocstat(3): fix reference (typo) to procstat_freeenvv in description for
procstat_getargv(3)

PR: 217884

r321706:

libprocstat(3): fix arguments list for procstat_getargv(3) and procstat_getenvv(3)

Neither libcall takes a fourth argument (`char *errbuf`).

PR: 217884

6 years agoMFC r321702,r321703:
ngie [Fri, 8 Sep 2017 04:39:59 +0000 (04:39 +0000)]
MFC r321702,r321703:

r321702:

Load geom_gate(4) if necessary before running tests; skip if it can't be loaded

The test code prior to r311893 loaded geom_gate at test start if necessary and
skipped the tests if it couldn't be loaded.

The ATF-ifcation of this test done in r311893 unfortunately dropped this
functionality.

This change restores the geom_gate module load and skips the test(s) if unavailable
in an ATF-like way.

PR: 220164

r321703:

Remove superfluous `exit 0` added in r321702

atf_skip triggers equivalent functionality, which means the `exit 0`
is unreachable code.

PR: 220164
MFC with: r321702

6 years agoMFC r321455:
ngie [Fri, 8 Sep 2017 04:37:49 +0000 (04:37 +0000)]
MFC r321455:

Raise WARNS to 1

This will enable warnings with the msun tests.

6 years agoMFC r321456,r321484,r321486:
ngie [Fri, 8 Sep 2017 04:35:44 +0000 (04:35 +0000)]
MFC r321456,r321484,r321486:

r321456:

Convert lib/msun/trig_test from TAP to ATF format

Only expose :accuracy and :reduction if !i386, similar to before,
but more holistically to avoid future -Wunused issue with the unused
functions.

r321484:

Only test ld_pi_odd with LDBL_MANT_DIG == 64 to fix the build

The empty (unimplemented) test inputs for sparc64 trigger a -Wtype-limits build
failure because nitems of an empty array is always false, i.e., deadcode.

MFC with: r321455

r321486:

Re-add #endif accidentally deleted in r321484

MFC with: r321455, r321484

6 years agoMFC r322633:
ngie [Fri, 8 Sep 2017 04:33:24 +0000 (04:33 +0000)]
MFC r322633:

Honor NO_RTLD for rtld-elf, similar to what's done in libexec/Makefile, with
libexec/rtld-elf/... for MK_{LIB32,LIBSOFT}.

6 years agoMFC r322636:
ngie [Fri, 8 Sep 2017 04:32:02 +0000 (04:32 +0000)]
MFC r322636:

Don't leak bpf on early return when YP isn't defined (NIS support)

6 years ago- Ever since the workaround for the silicon bug of TSO4 causing MAC hangs
marius [Fri, 8 Sep 2017 00:11:10 +0000 (00:11 +0000)]
- Ever since the workaround for the silicon bug of TSO4 causing MAC hangs
  was committed in r295133, CSUM_TSO gets always disabled by em(4) on the
  first invocation of em_init_locked() given that at that point no link is
  established, yet. In turn, this causes CSUM_TSO also to be off when em(4)
  is used as a parent device for vlan(4), i. e. besides IFCAP_TSO4, also
  IFCAP_VLAN_HWTSO effectively doesn't work.

  In head an attempt to fix this was made with r308345, but that revision
  had several problems on its own. One of which was that r308345 caused
  IFCAP_TSO4 to also be cleared from both the interface capability and
  capability enable bits. Thus, once a link switched from gigabit to a
  lower speed, TSO no longer could be enabled, even not via ifconfig(8).
  So this change moves the aforementioned WAR to em_update_link_status()
  like r308345 did, but only alters the hardware assist bits accordingly,
  leaving IFCAP_TSO4 flags alone.

  Still, this isn't the only problem r308345 had. Another one is that there
  just is no way to atomically flush TSO-using descriptors already queued
  at the point in time a link speed switch to below GbE occurs. Thus, such
  in-flight descriptors still may hang the MAC. Moreover, at least currently
  there also is no way of triggering a reconfiguration of vlan(4) when the
  state of IFCAP_VLAN_HWTSO support changes at runtime, causing vlan(4) to
  continue employing TSO. Last but not least, testing shows that - despite
  all the WARs for TSO-related silicon bugs in em(4) - at least 82579 still
  may hang at gigabit speed with IFCAP_TSO4 enabled. Therefore, this change
  further removes IFCAP_TSO4 and IFCAP_VLAN_HWTSO from interface capability
  enable bits as set by em(4). While at it, the use of CSUM_TCP is replaced
  with CSUM_IP_TSO as em(4) only implements support for IFCAP_TSO4 but not
  IFCAP_TSO6 (although in principle available with a subset of the supported
  MACs).

  At the bottom line, this change allows IFCAP_TSO4 and IFCAP_VLAN_HWTSO to
  be used again with em(4), but these hardware offloading capabilities now
  need to be explicitly enabled via ifconfig(8). Beware that it's only
  considered safe to do so (and also only may work) in environments where
  the link speed is not to be expected to change from GbE. Moreover, em(4)
  appears to still be missing some more TSO workarounds for at least some
  models, specifically the 82579 (I could not find an errata sheet and
  "specification update" respectively for these latter, though, and the
  generic ICH8 one doesn't list any TSO related bugs).

- Let igb_tso_setup() handle EtherType protocols that are unsupported or
  for which support hasn't been compiled in gracefully instead of calling
  panic(9).

- Make em_allocate_{legacy,msix}() and lem_allocate_irq() match their
  prototypes WRT static.

This is a direct commit to stable/11 as corresponding code is no longer
present in head.

6 years agoMFC r322546:
asomers [Thu, 7 Sep 2017 20:18:57 +0000 (20:18 +0000)]
MFC r322546:

Fix some ZFS debugging messages

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Be more careful about the use of provider names vs vdev names in
ZFS_LOG statements.

Sponsored by: Spectra Logic Corp

6 years agoMFC r322255:
asomers [Thu, 7 Sep 2017 19:57:31 +0000 (19:57 +0000)]
MFC r322255:

tests/sys/netinet/fibs_test: skip selected tests when firewalls are enabled

Some tests send packets over epair(4) interfaces. Firewalls can cause
spurious failures.

Reviewed by: ngie
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11917

6 years agoMFC r323278: Fix an incorrectly used conditional causing buffer overflow.
gordon [Thu, 7 Sep 2017 19:23:08 +0000 (19:23 +0000)]
MFC r323278: Fix an incorrectly used conditional causing buffer overflow.

Reported by: Thomas Jarosch of Intra2net AG
Reviewed by: emaste, jhb
Approved by: re (marius)
Security: CVE-2017-1000249

6 years agoMFC r323046: Make ntb_transport(4) ready receive early link events.
mav [Thu, 7 Sep 2017 12:51:39 +0000 (12:51 +0000)]
MFC r323046: Make ntb_transport(4) ready receive early link events.

Those events may be reported as soon as callback is registered, if the link
is enabled by hardware or some other application.

While there, clean link_is_up variable on link down event.

6 years agoMFC r323047: Make ntb_set_ctx() always generate fake link event.
mav [Thu, 7 Sep 2017 12:50:21 +0000 (12:50 +0000)]
MFC r323047: Make ntb_set_ctx() always generate fake link event.

It allows application driver get initial link state without racing with
hardware interrupts, thanks to the context rmlock held here.

6 years agoMFC r323054:
kib [Thu, 7 Sep 2017 09:03:12 +0000 (09:03 +0000)]
MFC r323054:
The nvme module should explicitly declare dependency on the cam.

6 years agoMFC r322329:
rlibby [Thu, 7 Sep 2017 05:41:13 +0000 (05:41 +0000)]
MFC r322329:

  i386/boot2: -fno-asynchronous-unwind-tables for gcc

6 years agoMFC r321864 (by mw):
rlibby [Thu, 7 Sep 2017 05:01:02 +0000 (05:01 +0000)]
MFC r321864 (by mw):

  Merge ena-com 1.1.4.2

6 years agoMFC r322810 and r322830:
hselasky [Wed, 6 Sep 2017 13:10:33 +0000 (13:10 +0000)]
MFC r322810 and r322830:
Add new mlx5ib(4) driver to the kernel source tree which supports
Remote DMA over Converged Ethernet, RoCE, for the ConnectX-4 series of
PCI express network cards.

There is currently no user-space support and this driver only supports
kernel side non-routable RoCE V1. The krping kernel module can be used
to test this driver. Full user-space support including RoCE V2 will be
added as part of the ongoing upgrade to ibcore from Linux 4.9. Otherwise
this driver is feature equivalent to mlx4ib(4). The mlx5ib(4) kernel
module will only be built when WITH_OFED=YES is specified.

Sponsored by: Mellanox Technologies

6 years agoMFC r323086:
ae [Wed, 6 Sep 2017 10:21:28 +0000 (10:21 +0000)]
MFC r323086:
  Fix possible double releasing for SA reference.

  This is missing part of r318734. When crypto subsystem returns error
  the xform code handles an error independently.

  PR: 221849

6 years agoMFC r321376:
rlibby [Wed, 6 Sep 2017 07:19:22 +0000 (07:19 +0000)]
MFC r321376:

  linuxkpi compiler.h: avoid gcc -Wunused-value in dummy expressions

6 years agoMFC r321106:
rlibby [Wed, 6 Sep 2017 07:15:21 +0000 (07:15 +0000)]
MFC r321106:

  qlnx: gcc build errors

6 years agoMFC r323024:
kib [Wed, 6 Sep 2017 07:09:59 +0000 (07:09 +0000)]
MFC r323024:
Only make the if_ix module depend on netmap when netmap is configured.

6 years agoMFC r320977:
rlibby [Wed, 6 Sep 2017 07:08:52 +0000 (07:08 +0000)]
MFC r320977:

  ixl: gcc build errors

6 years agoMFC r323018:
kib [Wed, 6 Sep 2017 07:06:58 +0000 (07:06 +0000)]
MFC r323018:
Adjust interface of swapon_check_swzone() to its actual usage.

PR: 221356

6 years agoMFC r323017:
kib [Wed, 6 Sep 2017 07:04:29 +0000 (07:04 +0000)]
MFC r323017:
Make the swap_pager_full variable static.

PR: 221356

6 years agoMFC r320714:
rlibby [Wed, 6 Sep 2017 06:57:18 +0000 (06:57 +0000)]
MFC r320714:

  hptmv: avoid gcc variably-modified warning

6 years agoMFC r320517:
rlibby [Wed, 6 Sep 2017 06:51:52 +0000 (06:51 +0000)]
MFC r320517:

  netfront.c: avoid gcc variably-modified warning

6 years agoMFC r323022: arge: correct bzero sizeof (pointed-to object, not pointer)
emaste [Wed, 6 Sep 2017 02:07:44 +0000 (02:07 +0000)]
MFC r323022: arge: correct bzero sizeof (pointed-to object, not pointer)

Sponsored by: The FreeBSD Foundation

6 years agoMFC r323011: usb: Add external "Intenso Memory" disk quirk
emaste [Wed, 6 Sep 2017 02:06:51 +0000 (02:06 +0000)]
MFC r323011: usb: Add external "Intenso Memory" disk quirk

PR: 221852
Submitted by: Fabian Keil
Obtained from: ElectroBSD

6 years agoMFC r323010: hv_vss.4: Fix spelling of 'responsibility'
emaste [Wed, 6 Sep 2017 02:05:19 +0000 (02:05 +0000)]
MFC r323010: hv_vss.4: Fix spelling of 'responsibility'

PR: 221300
Submitted by: Fabian Keil
Obtained from: ElectroBSD

6 years agoMFC r323040: xls_ehci: eliminate string literal warning
emaste [Wed, 6 Sep 2017 02:04:14 +0000 (02:04 +0000)]
MFC r323040: xls_ehci: eliminate string literal warning

Sponsored by: The FreeBSD Foundation

6 years agoMFC r323039: octeon_ebt3000_cf: eliminate string literal warning
emaste [Wed, 6 Sep 2017 02:03:22 +0000 (02:03 +0000)]
MFC r323039: octeon_ebt3000_cf: eliminate string literal warning

Sponsored by: The FreeBSD Foundation

6 years agoMFC r322073:
cy [Wed, 6 Sep 2017 01:38:01 +0000 (01:38 +0000)]
MFC r322073:

Fix matchcing of NATed ICMP queries (resolving NATed MTU discovery).

6 years agoMFC r323014:
dim [Tue, 5 Sep 2017 17:12:12 +0000 (17:12 +0000)]
MFC r323014:

Follow-up to r323001: if the actually selected CPUTYPE is capable of
SSE2 instructions, we can use them.

Suggested by: jkim
PR: 221733

6 years agoMFC r323001:
dim [Tue, 5 Sep 2017 16:59:19 +0000 (16:59 +0000)]
MFC r323001:

In compiler-rt, a few assembler implementations for i386 floating point
conversion functions use SSE2 instructions, but these are not guarded by
#ifdef __SSE2__, and there is no implementation using general purpose
registers.  For these functions, use the generic C variants instead,
otherwise they will cause SIGILL on older processors.

Reported by: bsdpr@phoe.frmug.org
PR: 221733

6 years agoMFC r316397 (by bde):
rlibby [Tue, 5 Sep 2017 15:21:34 +0000 (15:21 +0000)]
MFC r316397 (by bde):

  Remove the unportable -msse4 here too after fixing crc32_sse42.c to
  not depend on it.  This should have been part of r315983.

Note, r315983 was MFC'd to stable/11 in r317149.

Approved by: markj (mentor)

6 years agoMFC r319933:
markj [Tue, 5 Sep 2017 13:55:14 +0000 (13:55 +0000)]
MFC r319933:
Free the request page if an I/O error occurs while reading from swap.

6 years agoMFC r319934:
markj [Tue, 5 Sep 2017 13:54:27 +0000 (13:54 +0000)]
MFC r319934:
Don't call vm_pager_page_unswapped() when writing or deleting a dirty page.

6 years agoMFC r321963:
markj [Tue, 5 Sep 2017 13:52:15 +0000 (13:52 +0000)]
MFC r321963:
Rework and simplify the ksyms implementation.

6 years agoMFC r322987:
markj [Tue, 5 Sep 2017 13:40:10 +0000 (13:40 +0000)]
MFC r322987:
Synchronize page laundering with pmap_extract_and_hold().

6 years agoMFC r322798: newvers.sh: accommodate `git worktree`
emaste [Tue, 5 Sep 2017 00:46:50 +0000 (00:46 +0000)]
MFC r322798: newvers.sh: accommodate `git worktree`

newvers.sh looks for a .vcs subdirectory (e.g. .git, .svn) to determine
which vcs info tool to run (e.g., git rev-parse, svn info).

(As of r308789 in head / r323167 in stable/11 if a .vcs subdirectory is
not found at ${TOPDIR} then newvers.sh walks up successive parent
directories, testing for the .vcs subdirectory at each step.  This is
done in case the FreeBSD source is built in a subdirectory as part of
some larger project, but either way newvers.sh still tests for the .vcs
subdirectory.)

However, when using git worktree there is no .git subdirectory but
rather a plain text .git file which contains a reference to the main
working tree.

Change findvcs() to test that the .vcs entry exists, regardless of type.

Sponsored by: The FreeBSD Foundation

6 years agoMFC r308789 (glebius):
emaste [Tue, 5 Sep 2017 00:44:04 +0000 (00:44 +0000)]
MFC r308789 (glebius):

If FreeBSD source tree is a subproject of a bigger project, then .git or
.hg may reside above FreeBSD sources root.  Provide function findvcs()
that will climb up and seek for presence of a VCS directory.

6 years agoMFC r303188,r303190,r303271,r303438,r303453: Warn flags for gcc 6.1
rlibby [Mon, 4 Sep 2017 21:58:35 +0000 (21:58 +0000)]
MFC r303188,r303190,r303271,r303438,r303453: Warn flags for gcc 6.1

  r303188 (by br):
    Add warn flags for GCC 6.1 compiler.
  r303190 (by br):
    Add GCC 6.1 warn flags for kernel as well.
  r303271 (by br):
    Fix style.
  r303438 (by br):
    o Add warn flags required to build modules with GCC 6.1;
    o Sort GCC 4.8 warn flags.
  r303453 (by br):
    Normalise the CWARNFLAGS inter-word spacing: remove all leading and
    trailing space, and convert multiple consecutive spaces to single
    space.

Approved by: markj (mentor)

6 years agoMFC r322757, r322883:
kib [Mon, 4 Sep 2017 08:41:51 +0000 (08:41 +0000)]
MFC r322757, r322883:
Avoid dereferencing potentially freed workitem in
softdep_count_dependencies().

6 years agoMFC r323102:
kib [Mon, 4 Sep 2017 08:38:34 +0000 (08:38 +0000)]
MFC r323102:
Add serial comma.

6 years agoMFH (r314888): silence aliasing warning in nvme.h
des [Sun, 3 Sep 2017 16:45:18 +0000 (16:45 +0000)]
MFH (r314888): silence aliasing warning in nvme.h

Approved by: imp

6 years agoMFC r322929:
kib [Sun, 3 Sep 2017 09:18:39 +0000 (09:18 +0000)]
MFC r322929:
Simplify i386 trap().

6 years agoMFC r322928:
kib [Sun, 3 Sep 2017 09:16:23 +0000 (09:16 +0000)]
MFC r322928:
Remove unused code.

6 years agoMFC r322927:
kib [Sun, 3 Sep 2017 09:15:13 +0000 (09:15 +0000)]
MFC r322927:
Use ANSI C declaration for trap_pfault().  Style.

6 years agoMFC r322926:
kib [Sun, 3 Sep 2017 09:14:06 +0000 (09:14 +0000)]
MFC r322926:
Trim excessive 'extern'.

6 years agoMFC r322722:
kib [Sun, 3 Sep 2017 09:12:02 +0000 (09:12 +0000)]
MFC r322722:
Do not drop NFS vnode lock when performing consistency checks.

6 years agoMFC r322721:
kib [Sun, 3 Sep 2017 09:09:28 +0000 (09:09 +0000)]
MFC r322721:
Allow vinvalbuf() to operate with the shared vnode lock.

6 years agoMFC r322948:
kib [Sun, 3 Sep 2017 09:05:48 +0000 (09:05 +0000)]
MFC r322948:
Let g_access() log the actual error number.

PR: 221855

6 years agoMFC r322947:
kib [Sun, 3 Sep 2017 09:03:29 +0000 (09:03 +0000)]
MFC r322947:
Add PCI Id for MosChip MCS9900.

6 years agoMFC r323045: Fix flags field decoding in ACPI_NFIT_CONTROL_REGION.
mav [Sun, 3 Sep 2017 06:43:08 +0000 (06:43 +0000)]
MFC r323045: Fix flags field decoding in ACPI_NFIT_CONTROL_REGION.

It looked like incomplete copy/paste, printing absolute garbage.

While there, print ValidFields field ax hex, since it is a bitmask.