]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agopkgbase: Set a default package=runtime for var directories
manu [Wed, 12 Jun 2019 09:16:42 +0000 (09:16 +0000)]
pkgbase: Set a default package=runtime for var directories

This way every directory is at least present in packages.
While here tag some directory from being in sendmail or dma

Reviewed by: bapt
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D20605

4 years agoStop using .OODATE for extracting firmware.
bdrewery [Wed, 12 Jun 2019 00:03:00 +0000 (00:03 +0000)]
Stop using .OODATE for extracting firmware.

This fixes META_MODE rebuilding since it assumes that it this is
a non-consistent build command. These are always unencoded consistently
though and do not need to use the .OODATE/$? mechanism.

MFC after: 2 weeks
Reported by: npn
Sponsored by: DellEMC

4 years agoAdd missing DPSRCS entry for assym.inc.
bdrewery [Tue, 11 Jun 2019 23:35:49 +0000 (23:35 +0000)]
Add missing DPSRCS entry for assym.inc.

This brings in various CLEANFILES/DEPENDOBJS handling.

MFC after: 2 weeks
Sponsored by: DellEMC

4 years agoRestore genassym.o to CLEANFILES.
bdrewery [Tue, 11 Jun 2019 23:35:34 +0000 (23:35 +0000)]
Restore genassym.o to CLEANFILES.

This was lost in r335910 for some reason.

This also fixes a META_MODE rebuild issue in some modules [1].

MFC after: 2 weeks
Reported by: npn [1]
Sponsored by: DellEMC

4 years agoMove declaration of warninterval out from under COMPAT_FREEBSD32.
jhb [Tue, 11 Jun 2019 23:28:07 +0000 (23:28 +0000)]
Move declaration of warninterval out from under COMPAT_FREEBSD32.

This fixes builds of kernels without COMPAT_FREEBSD32.

Reported by: tinderbox
MFC after: 1 month

4 years agoMake the warning intervals for deprecated crypto algorithms tunable.
jhb [Tue, 11 Jun 2019 23:00:55 +0000 (23:00 +0000)]
Make the warning intervals for deprecated crypto algorithms tunable.

New sysctl/tunables can now set the interval (in seconds) between
rate-limited crypto warnings.  The new sysctls are:
- kern.cryptodev_warn_interval for /dev/crypto
- net.inet.ipsec.crypto_warn_interval for IPsec
- kern.kgssapi_warn_interval for KGSSAPI

Reviewed by: cem
MFC after: 1 month
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20555

4 years agoDocument sysctl nodes that translate their values.
jhb [Tue, 11 Jun 2019 22:57:25 +0000 (22:57 +0000)]
Document sysctl nodes that translate their values.

This documents the behavior of sysctl_msec_to_ticks and
SYSCTL_{ADD,}_SBINTIME_[UM]SEC.

Reviewed by: cem
MFC after: 1 week
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20596

4 years agoTo test to see if a free space is big enough compare the required
dougm [Tue, 11 Jun 2019 22:41:39 +0000 (22:41 +0000)]
To test to see if a free space is big enough compare the required
length to the difference of the two offsets that define the gap, to
avoid overflow, rather that adding the length to an offset and
comparing that to another offset.

This addresses an overflow issue reported by Peter Holm on i386.

Reported by: pho
Tested by: pho
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20594

4 years agoAvoid out of boundary access when checking invalid long filenames.
delphij [Tue, 11 Jun 2019 22:21:29 +0000 (22:21 +0000)]
Avoid out of boundary access when checking invalid long filenames.

Obtained from: OpenBSD (dir.c,v 1.25)
MFC after: 3 days

4 years agoSort opt_foo.h #includes and add a missing blank line in ip_output().
jhb [Tue, 11 Jun 2019 22:07:39 +0000 (22:07 +0000)]
Sort opt_foo.h #includes and add a missing blank line in ip_output().

4 years agoAdd M_NOFREE to M_FLAG_BITS.
jhb [Tue, 11 Jun 2019 22:06:31 +0000 (22:06 +0000)]
Add M_NOFREE to M_FLAG_BITS.

4 years agoTrim an extra space.
jhb [Tue, 11 Jun 2019 22:06:05 +0000 (22:06 +0000)]
Trim an extra space.

4 years agoMinor white space changes.
imp [Tue, 11 Jun 2019 20:48:19 +0000 (20:48 +0000)]
Minor white space changes.

Remove trailing white space that's crept into this file.

4 years agobhyve: virtio: introduce vq_kick_enable() and vq_kick_disable()
vmaffione [Tue, 11 Jun 2019 15:52:41 +0000 (15:52 +0000)]
bhyve: virtio: introduce vq_kick_enable() and vq_kick_disable()

The VirtIO standard supports two schemes for notification suppression:
a notification enable bit and a more sophisticated one (event_idx) that
also supports delayed notifications. Currently bhyve fully supports
only the first scheme. This patch hides the notification suppression
internals by means of two inline routines, vq_kick_enable() and
vq_kick_disable(), and makes the code more readable.
Moreover, further improve readability by replacing the call to mb()
with a call to atomic_thread_fence_seq_cst(), which is already used
in virtio.c

Reviewed by: pmooney_pfmooney.com, bryanv
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20581

4 years ago[PPC] Fix build error when POWERNV is disabled
luporl [Tue, 11 Jun 2019 11:23:15 +0000 (11:23 +0000)]
[PPC] Fix build error when POWERNV is disabled

When building a kernel supporting PSERIES but not POWERNV,
the compiler would complain about an error variable being
possibly used before being initialized.

In practice, however, this should never happen. In any case, it
is now initialized to an error value.

4 years ago[PPC64] Fix ofw_initrd
luporl [Tue, 11 Jun 2019 11:16:41 +0000 (11:16 +0000)]
[PPC64] Fix ofw_initrd

Before this change, OFW initrd (as md) handling code was simulating an ofwbus
device. But as there isn't really a Device Tree (DT) node representing OFW
initrd (it is specified in 2 properties under /chosen), its driver was in fact
stealing other driver's DT node.  This was noticed after MD_ROOT_MEM became
default and QEMU's USB keyboard stopped working under VNC.

This change consists in simplifying the process of detection and mapping of
initrd memory, turning it into a simple startup step, instead of trying to
simulate a device.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D20553

4 years agoprocstat: Recognize HWCAP and HWCAP2 with auxv command
mhorne [Tue, 11 Jun 2019 00:59:46 +0000 (00:59 +0000)]
procstat: Recognize HWCAP and HWCAP2 with auxv command

The two most recent additions to the elf auxiliary vector are
HWCAP and HWCAP2 which describe platform specific cpu capabilities.

Make procstat recognize these fields so that they aren't displayed
as UNKNOWN.

Reviewed by: trociny, markj
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20582

4 years agoRISC-V: expose extension bits in AT_HWCAP
mhorne [Tue, 11 Jun 2019 00:55:54 +0000 (00:55 +0000)]
RISC-V: expose extension bits in AT_HWCAP

AT_HWCAP is a field in the elf auxiliary vector meant to describe
cpu-specific hardware features. For RISC-V we want to use this to
indicate the presence of any standard extensions supported by the CPU.
This allows userland applications to query the system for supported
extensions using elf_aux_info(3).

Support for an extension is indicated by the presence of its
corresponding bit in AT_HWCAP -- e.g. systems supporting the 'c'
extension (compressed instructions) will have the second bit set.

Extensions advertised through AT_HWCAP are only those that are supported
by all harts in the system.

Reviewed by: jhb, markj
Approved by: markj (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20493

4 years agoA bit of code hygiene (no functional changes).
bz [Mon, 10 Jun 2019 23:25:40 +0000 (23:25 +0000)]
A bit of code hygiene (no functional changes).

Hide unused code under #ifdef notyet (in one case the only caller is under
that same ifdef), or if it is arm (not arm64) specific code under the
__arm__ ifdef to not yield -Wunused-function warnings during the arm64
kernel compile.

MFC after: 2 weeks

4 years agor348879 introduced a wrong-way comparison that broke mmap.
dougm [Mon, 10 Jun 2019 22:06:40 +0000 (22:06 +0000)]
r348879 introduced a wrong-way comparison that broke mmap.
This change rights that comparison.

Reported by: pho
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20595

4 years agoAdd support for the GPIO SD Card VCC regulator/switch and the GPIO SD Card
loos [Mon, 10 Jun 2019 21:50:07 +0000 (21:50 +0000)]
Add support for the GPIO SD Card VCC regulator/switch and the GPIO SD Card
detection pins to the Marvell Xenon SDHCI controller.

These features are enable by 'vqmmc-supply' and 'cd-gpios' properties in the
DTS.

This fixes the SD Card detection on espressobin.

Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoThe computations of vm_map_splay_split and vm_map_splay_merge touch both
dougm [Mon, 10 Jun 2019 21:34:07 +0000 (21:34 +0000)]
The computations of vm_map_splay_split and vm_map_splay_merge touch both
children of every entry on the search path as part of updating values of
the max_free field. By comparing the max_free values of an entry and its
child on the search path, the code can avoid accessing the child off the
path in cases where the max_free value decreases along the path.

Specifically, this patch changes splay_split so that the max_free field
of every entry on the search path is replaced, temporarily, by the
max_free field from its child not on the search path or, if the child
in that direction is NULL, then a difference between start and end
values of two pointers already available in the split code, without
following any next or prev pointers. However, to find that max_free
value does not require looking toward that other child if either the
child on the search path has a lower max_free value, or the current max_free
value is zero, because in either case we know that the value of max_free for
the other child is the value we already have. So, the changes to
vm_entry_splay_split make sure that we know all the off-search-path entries
we will need to complete the splay, without looking at all of them. There is
an exception at the bottom of the search path where we cannot rely on the
max_free value in the direction of the NULL pointer that ends the search,
because of the behavior of entry-clipping code.

The corresponding change to vm_splay_entry_merge makes it simpler, since it's
just reversing pointers and updating running maxima.

In a test intended to exercise vigorously the vm_map implementation, the
effect of this change was to reduce the data cache miss rate by 10-14% and
the running time by 5-7%.

Tested by: pho
Reviewed by: alc
Approved by: kib (mentor)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D19826

4 years agoAdd the GPIO driver for the North/South bridge in Marvell Armada 37x0.
loos [Mon, 10 Jun 2019 21:27:21 +0000 (21:27 +0000)]
Add the GPIO driver for the North/South bridge in Marvell Armada 37x0.

The A3700 has a different GPIO controller and thus, do not use the old (and
shared) code for Marvell.

The pinctrl driver, also part of the controller, is not supported yet (but
the implementation should be straightforward).

Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoChange the check for 'size' wrapping around to zero in kern_mmap to account
dougm [Mon, 10 Jun 2019 21:26:14 +0000 (21:26 +0000)]
Change the check for 'size' wrapping around to zero in kern_mmap to account
for both the lower and upper bound modifications. Change the error returned
to ENOMEM. Rename the parameter size to len and make size a local variable
that stores the value of len after it has been modified.

This addresses concerns expressed by Bruce Evans after r348843.

Reported by: brde@optusnet.com.au
Reviewed by: kib, markj (mentors)
MFC after: 3 days
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D20592

4 years agoAdd a bus_add_child device method to bcm2835_sdhci.
bz [Mon, 10 Jun 2019 21:24:38 +0000 (21:24 +0000)]
Add a bus_add_child device method to bcm2835_sdhci.

This allows SDIO (through CAM) to attach to an upstream, e.g.,
      ..
      sdhci_bcm0 pnpinfo name=mmc@7e300000 compat=brcm,bcm2835-mmc
        sdiob0
          ..

Without this, upon trying to load sdio, we would panic with
"bus_add_child is not implemented".

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

4 years agoDPSRCS need to be built before recursing.
bdrewery [Mon, 10 Jun 2019 19:38:35 +0000 (19:38 +0000)]
DPSRCS need to be built before recursing.

MFC after: 2 weeks
Sponsored by: DellEMC

4 years agoAdd warnings to /dev/crypto for deprecated algorithms.
jhb [Mon, 10 Jun 2019 19:26:57 +0000 (19:26 +0000)]
Add warnings to /dev/crypto for deprecated algorithms.

These algorithms are deprecated algorithms that will have no in-kernel
consumers in FreeBSD 13.  Specifically, deprecate the following
algorithms:
- ARC4
- Blowfish
- CAST128
- DES
- 3DES
- MD5-HMAC
- Skipjack

MFC after: 1 month
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20554

4 years agoAdd warnings for Kerberos GSS algorithms deprecated in RFCs 6649 and 8429.
jhb [Mon, 10 Jun 2019 19:22:36 +0000 (19:22 +0000)]
Add warnings for Kerberos GSS algorithms deprecated in RFCs 6649 and 8429.

All of these algorithms are explicitly marked SHOULD NOT in one of these
RFCs.

Specifically, RFC 6649 deprecates all algorithms using DES as well as
the "export-friendly" variant of RC4.  RFC 8429 deprecates Triple DES
and the remaining RC4 algorithms.

Reviewed by: cem
MFC after: 1 month
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20343

4 years agoRemove an overly-aggressive assertion.
jhb [Mon, 10 Jun 2019 19:01:54 +0000 (19:01 +0000)]
Remove an overly-aggressive assertion.

While it is true that the new vmspace passed to vmspace_switch_aio
will always have a valid reference due to the AIO job or the extra
reference on the original vmspace in the worker thread, it is not true
that the old vmspace being switched away from will have more than one
reference.

Specifically, when a process with queued AIO jobs exits, the exit hook
in aio_proc_rundown will only ensure that all of the AIO jobs have
completed or been cancelled.  However, the last AIO job might have
completed and woken up the exiting process before the worker thread
servicing that job has switched back to its original vmspace.  In that
case, the process might finish exiting dropping its reference to the
vmspace before the worker thread resulting in the worker thread
dropping the last reference.

Reported by: np
Reviewed by: alc, markj, np, imp
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D20542

4 years agopsm(4): Enable touchpads and trackpads by default
zeising [Mon, 10 Jun 2019 18:19:49 +0000 (18:19 +0000)]
psm(4): Enable touchpads and trackpads by default

Enable synaptics and elantech touchpads, as well as IBM/Lenovo TrackPoints
by default, instead of having users find and toggle a loader tunable.
This makes things like two finger scroll and other modern features work out
of the box with X.  By enabling these settings by default, we get a better
desktop experience in X, since xserver and evdev can make use of the more
advanced synaptics and elantech features.

Reviewed by: imp, wulf, 0mp
Approved by: imp
Sponsored by: B3 Init (zeising)
Differential Revision: https://reviews.freebsd.org/D20507

4 years agoEnhance the comment ieee80211_add_channel() to avoid a
bz [Mon, 10 Jun 2019 14:31:18 +0000 (14:31 +0000)]
Enhance the comment ieee80211_add_channel() to avoid a
misunderstanding that the function does not work additive
when repeatedly called for diffferent bands.

Reviewed by: avos (a few months ago)
MFC after: 2 weeks

4 years agoallwinner mmc: move variable assignment into block
bz [Mon, 10 Jun 2019 13:46:36 +0000 (13:46 +0000)]
allwinner mmc: move variable assignment into block

"blksz is only used in one of the two blocks, so assign it inside
that block rather than outside.

MFC after: 2 weeks

4 years ago/etc/rc.d/local: Fix typo in description
cem [Mon, 10 Jun 2019 13:34:18 +0000 (13:34 +0000)]
/etc/rc.d/local: Fix typo in description

PR: 238448
Submitted by: Marián Černý <majo-bugs.freebsd.org AT cerny.sk>

4 years agoUse C11 anonymous unions.
dchagin [Mon, 10 Jun 2019 05:28:03 +0000 (05:28 +0000)]
Use C11 anonymous unions.

PR: 215202
Reported by: glebius
MFC after: 2 weeks

4 years agopowernv: Port HMI handler to use the message framework
jhibbits [Mon, 10 Jun 2019 03:24:38 +0000 (03:24 +0000)]
powernv: Port HMI handler to use the message framework

When an HMI occurs a message event also gets created with the details of the
exception.  Hook into the messaging framework to retrieve the HMI message.
Nothing is done with it yet, except to panic on unhandled exception.

4 years agopowerpc/powernv: Reduce the scope of the sensor guarding mutex
jhibbits [Mon, 10 Jun 2019 03:16:55 +0000 (03:16 +0000)]
powerpc/powernv: Reduce the scope of the sensor guarding mutex

vmem_xalloc() cannot be called while holding a nonblocking mutex, warned
by WITNESS.  The lock may not be necessary in general, but it avoids
superfluous concurrent OPAL calls for the same sensor.

Reported by: pkubaj

4 years agoThere are times when a len==0 parameter to mmap is okay. But on a
dougm [Mon, 10 Jun 2019 03:07:10 +0000 (03:07 +0000)]
There are times when a len==0 parameter to mmap is okay. But on a
32-bit machine, a len parameter just a few bytes short of 4G, rounded
up to a page boundary and hitting zero then, is not okay. Return
failure in that case.

Reported by: pho
Reviewed by: alc, kib (mentor)
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D20580

4 years agotail: fix the checks if the file was rotated
oshogbo [Sun, 9 Jun 2019 22:55:21 +0000 (22:55 +0000)]
tail: fix the checks if the file was rotated

The freopen(3) was replaced with fileargs_open(3) and fclose(3).
In the following function, we skip if the stream is standard in, so it is
safe to do so.
This also requires us to change the logic first to open the file and then
check its status. The stat(2) is disallowed in capability mode.

This commit unbrakes the -F option.
The bug was introduced in the r348708.

Reported by: pho
Tested by: pho

4 years agoDTrace: add a top level makefile to the new test suit
oshogbo [Sun, 9 Jun 2019 22:45:07 +0000 (22:45 +0000)]
DTrace: add a top level makefile to the new test suit

Pointed out by: markj

4 years agoRemove unused mcall_trap() function
mhorne [Sun, 9 Jun 2019 15:52:26 +0000 (15:52 +0000)]
Remove unused mcall_trap() function

The mcall_trap() dummy function is unused, and should be removed as we
are unlikely to support M-mode traps any time soon.

Reviewed by: markj
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20494

4 years agoRISC-V: Clean up some GENERIC options
mhorne [Sun, 9 Jun 2019 15:50:35 +0000 (15:50 +0000)]
RISC-V: Clean up some GENERIC options

Some of the config options that are disabled by default seem to be only
for historical reasons. Enable those that appear to no longer be
problematic. This includes WITH_CTF, STACK, GEOM_RAID, and re-enabling
blacklisted kernel modules.

Reviewed by: markj
Approved by: markj (mentor)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20495

4 years agoRISC-V: Announce real and available memory at boot
mhorne [Sun, 9 Jun 2019 15:48:36 +0000 (15:48 +0000)]
RISC-V: Announce real and available memory at boot

Most architectures print their total (real) and available memory during
boot. Properly initialize the realmem global and print these messages.
Also print the physical memory chunks (behind a bootverbose flag).

Reviewed by: markj
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20496

4 years agoAdd TSLOG events to initriscv()
mhorne [Sun, 9 Jun 2019 15:45:48 +0000 (15:45 +0000)]
Add TSLOG events to initriscv()

Add the enter and exit events, similar to what's found in
hammer_time() on amd64. We must use TSRAW as the pcpu isn't yet
initialized.

Reviewed by: markj
Approved by: markj (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D20497

4 years agoFix global pointer relaxations in the RISC-V kernel
mhorne [Sun, 9 Jun 2019 15:43:38 +0000 (15:43 +0000)]
Fix global pointer relaxations in the RISC-V kernel

The gp register is intended to used by the linker as another means of
performing relaxations, and should point to the small data section (.sdata).

Currently gp is being used as the pcpu pointer within the kernel, but the more
appropriate choice for this is the tp register, which is unused.

Swap existing usage of gp with tp within the kernel, and set up gp properly
at boot with the value of __global_pointer$ for all harts.

Additionally, remove some cases of accessing tp from the PCB, as it is not
part of the per-thread state. The user's tp and gp should be tracked only
through the trapframe.

Reviewed by: markj, jhb
Approved by: markj (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19893

4 years agoRemove block of dead code
mhorne [Sun, 9 Jun 2019 15:36:51 +0000 (15:36 +0000)]
Remove block of dead code

Approved by: markj (mentor)

4 years agobhyve: vtnet: simplify thread synchronization
vmaffione [Sun, 9 Jun 2019 12:41:21 +0000 (12:41 +0000)]
bhyve: vtnet: simplify thread synchronization

On vtnet device reset it is necessary to wait for threads to stop TX and
RX processing. However, the rx_in_progress variable (used for to wait for
RX processing to stop) is actually useless, and can be removed. Acquiring
and releasing the RX lock is enough to synchronize correctly. Moreover,
it is possible to reset the device while holding both TX and RX locks, so
that the "resetting" variable becomes unnecessary for the RX thread, and
can be protected by the TX lock (instead of being volatile).

Reviewed by: jhb, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20543

4 years agotail: style nits
oshogbo [Sun, 9 Jun 2019 11:21:29 +0000 (11:21 +0000)]
tail: style nits

4 years agoCorrect a new KASSERT() in r348828.
alc [Sun, 9 Jun 2019 05:55:58 +0000 (05:55 +0000)]
Correct a new KASSERT() in r348828.

X-MFC with: r348828

4 years agoImplement an alternative solution to the amd64 and i386 pmap problem that we
alc [Sun, 9 Jun 2019 03:36:10 +0000 (03:36 +0000)]
Implement an alternative solution to the amd64 and i386 pmap problem that we
previously addressed in r348246.

This pmap problem also exists on arm64 and riscv.  However, the original
solution developed for amd64 and i386 cannot be used on arm64 and riscv.  In
particular, arm64 and riscv do not define a PG_PROMOTED flag in their level
2 PTEs.  (A PG_PROMOTED flag makes no sense on arm64, where unlike x86 or
riscv we are required to break the old 4KB mappings before making the 2MB
mapping; and on riscv there are no unused bits in the PTE to define a
PG_PROMOTED flag.)

This commit implements an alternative solution that can be used on all four
architectures.  Moreover, this solution has two other advantages.  First, on
older AMD processors that required the Erratum 383 workaround, it is less
costly.  Specifically, it avoids unnecessary calls to pmap_fill_ptp() on a
superpage demotion.  Second, it enables the elimination of some calls to
pagezero() in pmap_kernel_remove_{l2,pde}().

In addition, remove a related stale comment from pmap_enter_{l2,pde}().

Reviewed by: kib, markj (an earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D20538

4 years agoFix uninitialized variable in camdd
chuck [Sun, 9 Jun 2019 02:06:31 +0000 (02:06 +0000)]
Fix uninitialized variable in camdd

gcc  builds were failing because of this uninitialized warning.

Reported by: bz, imp
Approved by: imp (mentor)
Discussed with: ken
Pointy hat: chuck

4 years agopsm(4): Add extra sanity checks to Elantech trackpoint packet parser.
wulf [Sat, 8 Jun 2019 21:36:22 +0000 (21:36 +0000)]
psm(4): Add extra sanity checks to Elantech trackpoint packet parser.

Add strict checks for unused bit states in Elantech trackpoint packet
parser to filter out spurious events produces by some hardware which
are detected as trackpoint packets. See comment on r328191 for example.

Tested by: Andrey Kosachenko <andrey.kosachenko@gmail.com>

4 years agopsm(4): Fix Elantech trackpoint support.
wulf [Sat, 8 Jun 2019 21:33:34 +0000 (21:33 +0000)]
psm(4): Fix Elantech trackpoint support.

Sign bits for X and Y motion data were taken from wrong places.

PR: 238291
Reported by: Andrey Kosachenko <andrey.kosachenko@gmail.com>
Tested by: Andrey Kosachenko <andrey.kosachenko@gmail.com>
MFC after: 2 weeks

4 years agoStyle MAP_ENTRY_ and MAP_ definitions.
kib [Sat, 8 Jun 2019 20:28:04 +0000 (20:28 +0000)]
Style MAP_ENTRY_ and MAP_ definitions.

Spell all bits in the hex constants.
Since all lines are modified, consistently use <tab> after #define.

Reviewed by: alc (previous version), dougm
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D20560

4 years agoCorrect definition for PGEX_SGX.
kib [Sat, 8 Jun 2019 20:26:04 +0000 (20:26 +0000)]
Correct definition for PGEX_SGX.

At the moment it is only used for page fault error code textual
representation.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 years agoAdd stuff to disable warning for %S
imp [Sat, 8 Jun 2019 19:58:58 +0000 (19:58 +0000)]
Add stuff to disable warning for %S

Add the customary warnings to disable format checking on armv7. Code
move to new files, and the unconditional setting of WARNS to 6
provoked it on tinerbox...

4 years agoMake trap_msg array constant as well.
kib [Sat, 8 Jun 2019 19:50:57 +0000 (19:50 +0000)]
Make trap_msg array constant as well.

Suggested by: tijl
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoCreate gptboot.efi
imp [Sat, 8 Jun 2019 19:02:17 +0000 (19:02 +0000)]
Create gptboot.efi

This is a primary boot loader that is intended to implement the
gptboot partition selection algorithm just like we did for BIOS
booting. While the preferred method for UEFI is to use the UEFI Boot
Manager protocol, there are situations where that can't be done: some
BIOS makers interfere with the protocol in unhelpful ways, there's a
new standard for a zero variable write from the client OS, and finally
for USB drives that might be mobile between systems with multiple
partitions there needs to be a media stable way to select.

Reviewed by: tsoome, bcran
Differential Revision: https://reviews.freebsd.org/D20547

4 years agoBreak out the disk selection protocol from the rest of boot1.
imp [Sat, 8 Jun 2019 18:59:50 +0000 (18:59 +0000)]
Break out the disk selection protocol from the rest of boot1.

Segregate the disk probing and selection protocol from the rest of the
boot loader.

Reviewed by: tsoome, bcran
Differential Revision: https://reviews.freebsd.org/D20547

4 years agoCurrently, MCA entries remain on an every-growing linked list. This means
jtl [Sat, 8 Jun 2019 18:26:48 +0000 (18:26 +0000)]
Currently, MCA entries remain on an every-growing linked list. This means
that it becomes increasingly expensive to process a steady stream of
correctable errors. Additionally, the memory used by the MCA entries can
grow without bound.

Change the code to maintain two separate lists: a list of entries which
still need to be logged, and a list of entries which have already been
logged. Additionally, allow a user-configurable limit on the number of
entries which will be saved after they are logged. (The limit defaults
to -1 [unlimited], which is the current behavior.)

Reviewed by: imp, jhb
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20482

4 years agoSimple code refactoring originally in D13484.
dougm [Sat, 8 Jun 2019 17:49:17 +0000 (17:49 +0000)]
Simple code refactoring originally in D13484.

Extract swp_pager_force_dirty() and swp_pager_force_launder() out of
swp_pager_force_pagein().

Extract swap_pager_swapoff_object() out of swap_pager_swapoff().

Submitted by: ota_j.email.ne.jp
Reviewed by: alc, dougm
Approved by: kib (mentor)
Differential Revision: https://reviews.freebsd.org/D20545

4 years agoFix dpcpu and vnet panics with complex types at the end of the section.
bz [Sat, 8 Jun 2019 17:44:42 +0000 (17:44 +0000)]
Fix dpcpu and vnet panics with complex types at the end of the section.

Apply a linker script when linking i386 kernel modules to apply padding
to a set_pcpu or set_vnet section.  The padding value is kind-of random
and is used to catch modules not compiled with the linker-script, so
possibly still having problems leading to kernel panics.

This is needed as the code generated on certain architectures for
non-simple-types, e.g., an array can generate an absolute relocation
on the edge (just outside) the section and thus will not be properly
relocated. Adding the padding to the end of the section will ensure
that even absolute relocations of complex types will be inside the
section, if they are the last object in there and hence relocation will
work properly and avoid panics such as observed with carp.ko or ipsec.ko.

There is a rather lengthy discussion of various options to apply in
the mentioned PRs and their depends/blocks, and the review.
There seems no best solution working across multiple toolchains and
multiple version of them, so I took the liberty of taking one,
as currently our users (and our CI system) are hitting this on
just i386 and we need some solution.  I wish we would have a proper
fix rather than another "hack".

Also backout r340009 which manually, temporarily fixed CARP before 12.0-R
"by chance" after a lead-up of various other link-elf.c and related fixes.

PR: 230857,238012
With suggestions from: arichardson (originally last year)
Tested by: lwhsu
Event: Waterloo Hackathon 2019
Reported by: lwhsu, olivier
MFC after: 6 weeks
Differential Revision: https://reviews.freebsd.org/D17512

4 years agoRemove extra stray + from a diff from the beginning of the lines after
bz [Sat, 8 Jun 2019 17:38:27 +0000 (17:38 +0000)]
Remove extra stray + from a diff from the beginning of the lines after
r348805 to fix the build.  Please do not ask how 3 more local builds
succeeded without barfing.

Pointyhat to: bz
MFC after: 6 weeks
X-MFC with: r348805

4 years agoAdd NVMe support to camdd(8)
chuck [Sat, 8 Jun 2019 17:17:17 +0000 (17:17 +0000)]
Add NVMe support to camdd(8)

Reviewed by: ken
Approved by: ken (mentor)
MFC after: 1 week
Differential Review: https://reviews.freebsd.org/D12141

4 years agoAdd SDIO support.
bz [Sat, 8 Jun 2019 16:26:56 +0000 (16:26 +0000)]
Add SDIO support.

Add a CAM-Newbus SDIO support module.  This works provides a newbus
infrastructure for device drivers wanting to use SDIO.  On the lower end
while it is connected by newbus to SDHCI, it talks CAM using the MMCCAM
framework to get to it.

This also duplicates the usbdevs framework to equally create sdiodev
header files with #defines for "vendors" and "products".

Submitted by: kibab (initial work, see https://reviews.freebsd.org/D12467)
Reviewed by: kibab, imp (comments on earlier version)
MFC after: 6 weeks
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19749

4 years agobcm2835_sdhci.c: exit DMA if not enough data left to avoid timeout errors
bz [Sat, 8 Jun 2019 16:15:00 +0000 (16:15 +0000)]
bcm2835_sdhci.c: exit DMA if not enough data left to avoid timeout errors

In the DMA case, given we disable the data interrupts, we never seem
to get DATA_END.  Given we are relying on DMA interrupts we are not
using the SDHCI state machine and hence only call into
sdhci_platform_will_handle() for the first check of data.
We do not call "will handle" for any following round trips of the same
transaction if block size * count > BCM_DMA_BLOCK_SIZE.
Manually check "left" in the DMA interrupt handler to see if we have at
least another full BCM_DMA_BLOCK_SIZE to handle.
Without this change we would DMA that and then even start a DMA with
left == 0 which would lead to a timeout and error.
Now we re-enable data interrupts and return and let the SDHCI generic
interrupt handler and state machine pick the SPACE_AVAIL up and then
find that it should punt to the pio_handler for the remaining bytes
or finish the data transaction.

With this change block mode seems to work beyond 7 * 64byte blocks,
which worked as it was below BCM_DMA_BLOCK_SIZE.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20199

4 years agobcm2835_sdhci.c: save block registers to avoid controller bug
bz [Sat, 8 Jun 2019 16:05:43 +0000 (16:05 +0000)]
bcm2835_sdhci.c: save block registers to avoid controller bug

Extending what the initial revision, r273264, r276985, r277346 have
started for the transfer mode and command registers, another pair of
16bit registers written in sequence are block size and block count,
which fall together onto the same 32bit line and hence the same
register(s) would be written twice in sequence for those as well.

Use a similar approach to transfer mode and command and save the writes
to either of the block regiters and then only execute a write once.
We can do this as with transfer mode their values are meaningless until
a command is issued so we can use that write to command as a trigger
to also write out the block registers.
Compared to transfer mode and command the value of block count can
change, so we need to keep state and actually read the block registers
back the first time after a write.

MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20197

4 years agoRemove lazy FPU switch support from amd64.
kib [Sat, 8 Jun 2019 16:03:34 +0000 (16:03 +0000)]
Remove lazy FPU switch support from amd64.

It is incompatible with some future features.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoImprove sdhci slot_printf() debug printing.
bz [Sat, 8 Jun 2019 15:24:03 +0000 (15:24 +0000)]
Improve sdhci slot_printf() debug printing.

Currently slot_printf() uses two printf() calls to print the
device-slot name, and actual message. When other printf()s are
ongoing in parallel this can lead to interleaved message on the console,
which is especially unhelpful for debugging or error messages.

Take a hit on the stack and vsnprintf() the message to the buffer.
This way it can be printed along with the device-slot name in one go
avoiding console gibberish.

Reviewed by: marius
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19747

4 years agoIntroduce sim_dev and cam_sim_alloc_dev().
bz [Sat, 8 Jun 2019 15:19:50 +0000 (15:19 +0000)]
Introduce sim_dev and cam_sim_alloc_dev().

Add cam_sim_alloc_dev() as a wrapper to cam_sim_alloc() which takes
a device_t instead of the unit_number (which we can derive from the
dev again).

Add device_t sim_dev to struct cam_sim. It will be used to pass through
the bus for cases when both sides of CAM speak newbus already and we want
to link them (yet make the calls through CAM for now).

SDIO will be the first consumer of this. For that make use of
cam_sim_alloc_dev() in sdhci under MMCCAM.

This will also allow people to start iterating more on the idea
to newbus-ify CAM without changing 50+ device drivers from the start.
Also to be clear there are callers to cam_sim_alloc() which do not
have a device_t (e.g., XPT) or provide their own unit number so we cannot
simply switch the KPI entirely.

Submitted by: kibab (original idea, see https://reviews.freebsd.org/D12467)
Reviewed by: imp, chuck
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19746

4 years agoi386 trap.c: Remove unused MAX_TRAP_MSG define.
kib [Sat, 8 Jun 2019 13:41:39 +0000 (13:41 +0000)]
i386 trap.c: Remove unused MAX_TRAP_MSG define.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoamd64 trap.c: Modernize syntax around trap_msg[].
kib [Sat, 8 Jun 2019 13:40:57 +0000 (13:40 +0000)]
amd64 trap.c: Modernize syntax around trap_msg[].

Convert the array to use C99 initializers.
Make it constant.
Replace MAX_TRAP_MSG with nitems().

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 years agoFix for reading the configuration descriptor in libusb. Catch invalid
hselasky [Sat, 8 Jun 2019 09:34:02 +0000 (09:34 +0000)]
Fix for reading the configuration descriptor in libusb. Catch invalid
configuration descriptor reads early on to avoid issues with devices
that don't check for a valid USB configuration read request.

Submitted by: takahiro.kurosawa@gmail.com
PR: 238412
MFC after: 3 days

4 years agovtfontcvt: allow out-of-order glyphs
emaste [Sat, 8 Jun 2019 08:25:43 +0000 (08:25 +0000)]
vtfontcvt: allow out-of-order glyphs

PR: 205707
Reported by: mi
MFC after: 2 weeks
Event: Vienna Hackathon 2019
Sponsored by: The FreeBSD Foundation

4 years agopowerpc/pmap: Move the SLB spill handlers to a better place
jhibbits [Sat, 8 Jun 2019 03:07:08 +0000 (03:07 +0000)]
powerpc/pmap: Move the SLB spill handlers to a better place

The SLB spill handlers are AIM-specific, and belong better with the rest of
the SLB code anyway.  No functional change.

4 years agopowerpc/aim: Use nitems() for calculating size of phys_avail in AIM pmaps
jhibbits [Sat, 8 Jun 2019 02:36:07 +0000 (02:36 +0000)]
powerpc/aim: Use nitems() for calculating size of phys_avail in AIM pmaps

Same thing was already done in r347164 for Book-E pmap.

4 years agoFix debug trace after removal of pdu_overhead.
jhb [Fri, 7 Jun 2019 21:30:11 +0000 (21:30 +0000)]
Fix debug trace after removal of pdu_overhead.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoFix comparison signedness in arc_is_overflowing().
mav [Fri, 7 Jun 2019 20:59:24 +0000 (20:59 +0000)]
Fix comparison signedness in arc_is_overflowing().

When ARC size is very small, aggsum_lower_bound(&arc_size) may return
negative values, that due to unsigned comparison caused delays, waiting
for arc_adjust() to "fix" it by calling aggsum_value(&arc_size).  Use
of signed comparison there fixes the problem.

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

4 years agoExplicitly start ARC adjustment on limits change.
mav [Fri, 7 Jun 2019 19:03:17 +0000 (19:03 +0000)]
Explicitly start ARC adjustment on limits change.

While formally it is not necessary, but the sooner it start, the sooner it
finish, and supposedly less disturbing for workload it will be.

MFC after: 2 weeks

4 years agoFix nda(4) PCIe link status output
chuck [Fri, 7 Jun 2019 18:34:48 +0000 (18:34 +0000)]
Fix nda(4) PCIe link status output

Differentiate between PCI Express Endpoint devices and Root Complex
Integrated Endpoints in the nda driver. The Link Status and Capability
registers are not valid for Integrated Endpoints and should not be
displayed. The bhyve emulated NVMe device will advertise as being an
Integrated Endpoint.

Reviewed by: imp
Approved byL imp (mentor)
Differential Revision: https://reviews.freebsd.org/D20282

4 years agoReplace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m).
markj [Fri, 7 Jun 2019 18:23:29 +0000 (18:23 +0000)]
Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m).

These calls are not the same in general: the former will dequeue the
page if it is enqueued, while the latter will just leave it alone.  But,
all existing uses of the former apply to unmanaged pages, which are
never enqueued in the first place.  No functional change intended.

Reviewed by: kib
MFC after: 1 week
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D20470

4 years ago[PPC64] Support QEMU/KVM pseries without hugepages
luporl [Fri, 7 Jun 2019 17:58:59 +0000 (17:58 +0000)]
[PPC64] Support QEMU/KVM pseries without hugepages

This set of changes make it possible to run FreeBSD for PowerPC64/pseries,
under QEMU/KVM, without requiring the host to make hugepages available to the
guest.

While there was already this possibility, by means of setting hw_direct_map to
0, on PowerPC64 there were a couple of issues/wrong assumptions that prevented
this from working, before this changelist.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D20522

4 years agovmrun: Add a missing close-paren to the usage message.
markj [Fri, 7 Jun 2019 17:54:26 +0000 (17:54 +0000)]
vmrun: Add a missing close-paren to the usage message.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

4 years agobhyve: Add PCIe Integrated Endpoint capability
chuck [Fri, 7 Jun 2019 17:09:49 +0000 (17:09 +0000)]
bhyve: Add PCIe Integrated Endpoint capability

The NVMe CAM driver reports the PCIe Link Capability and Status for
devices. For emulated bhyve NVMe devices, this looks like:

nda0: nvme version 1.3 x63 (max x63) lanes PCIe Gen15 (max Gen15) link

The driver outputs this because the emulated device doesn't include the
PCIe Capability structure. The NVMe specification requires these
registers, so the fix is to add this set of capability registers to the
emulated device.

Note that PCI Express devices that are integrated into the Root Complex
(i.e. Bus 0x0) do not have to support the Link Capability or Status
registers. Windows will fail to start (i.e. Code 10) devices that appear
to be part of the Root Complex but report being a PCI Express Endpoint.
So also add a check to pci_emul_add_pciecap() to check if the device is
integrated and change the device type.

Reviewed by: imp, ken, araujo, jhb, rgrimes
Approved by: imp (mentor), ken (mentor), jhb (maintainer)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19904

4 years agoKeep the shadow PCIR_COMMAND synced with the real one for pass through.
jhb [Fri, 7 Jun 2019 15:53:27 +0000 (15:53 +0000)]
Keep the shadow PCIR_COMMAND synced with the real one for pass through.

This ensures that bhyve properly recognizes when decoding is disabled
for BARs on passthru devices.  To properly handle writes to the
register, export a pci_emul_cmd_changed function from pci_emul.c that
the pass through device model invokes for config writes that change
PCIR_COMMAND.

Reviewed by: rgrimes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20531

4 years agoEnable memory and I/O decoding in PCI devices on demand.
jhb [Fri, 7 Jun 2019 15:48:12 +0000 (15:48 +0000)]
Enable memory and I/O decoding in PCI devices on demand.

Rather than uncoditionally setting the MEMEN and PORTEN bits in
PCIR_COMMAND for PCI devices, set the respective bit when the first
BAR of a given type is added to the device.  This more closely matches
what firmware does on bare metal.

BUSMASTEREN is still set unconditionally.  Eventually this bit should
move into the device models as not all device models need this set.

Reviewed by: rgrimes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20530

4 years agoAdd a basic clang-format configuration file
arichardson [Fri, 7 Jun 2019 15:23:52 +0000 (15:23 +0000)]
Add a basic clang-format configuration file

This gets reasonably close to the existing format in sys/kern but will
probably require some changes to upstream clang-format before it can be
used as the default formatting tool.

I tried formatting a few files in sys/kern and the result is pretty close to
the existing code. However, this configuration file is not ready to be used
without manually checking the output.

Reviewed By: emaste
Differential Revision: https://reviews.freebsd.org/D20533

4 years agoTeach readelf about some OpenBSD ELF program headers
csjp [Fri, 7 Jun 2019 14:51:55 +0000 (14:51 +0000)]
Teach readelf about some OpenBSD ELF program headers

- Add constants for OpenBSD wxneeded, bootdata and randomize to the
  FreeBSD elf_common.h file. This is the file that gets used by the
  elftoolchain library.
- Update readelf and elfdump utilities to decode these program headers
  if they are encountered.

Note: FreeBSD has it's own version of elfdump(1), which will be updated
in a subsequent commit. I am adding it here anyway because this diff is
going to be submitted upstream.

Discussed with: emaste
Reviewed by: imp
MFC afer: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20548

M    contrib/elftoolchain/elfdump/elfdump.c
M    contrib/elftoolchain/readelf/readelf.c
M    sys/sys/elf_common.h

4 years agoUse underscores for internal variable name to avoid conflicts.
ae [Fri, 7 Jun 2019 08:30:35 +0000 (08:30 +0000)]
Use underscores for internal variable name to avoid conflicts.

MFC after: 1 week

4 years agoRestore ARC MFU/MRU pressure
avg [Fri, 7 Jun 2019 06:35:42 +0000 (06:35 +0000)]
Restore ARC MFU/MRU pressure

Before r305323 (MFV r302991: 6950 ARC should cache compressed data)
arc_read() code did this for access to a ghost buffer:
 arc_adapt() (from arc_get_data_buf())
 arc_access(hdr, hash_lock)
I.e., we first checked access to the MFU ghost/MRU ghost buffer and
adapt MFU/MRU sizes (in arc_adapt()) and next move buffer from the ghost
state to regular.

After r305323 the sequence is different:
 arc_access(hdr, hash_lock);
 arc_hdr_alloc_pabd(hdr);
I.e., we first move the buffer from the ghost state in arc_access() and
then we check access to buffer in ghost state (in arc_hdr_alloc_pabd()
-> arc_get_data_abd() -> arc_get_data_impl() -> arc_adapt()).  This is
incorrect: arc_adapt() never see access to the ghost buffer because
arc_access() already migrated the buffer from the ghost state to
regular.

So, the fix is to restore a call to arc_adapt() before arc_access() and
to suppress the call to arc_adapt() after arc_access().

Submitted by: Slawa Olhovchenkov <slw@zxy.spb.ru>
MFC after: 2 weeks
Sponsored by: Integros [integros.com]
Differential Revision: https://reviews.freebsd.org/D19094

4 years agocxgbe(4): Rename the DDP sysctl to rx_zcopy to match the tx_zcopy sysctl
np [Fri, 7 Jun 2019 05:03:03 +0000 (05:03 +0000)]
cxgbe(4): Rename the DDP sysctl to rx_zcopy to match the tx_zcopy sysctl
and update its description.  The old name continues to work for now.

Sponsored by: Chelsio Communications

4 years agoAllow fail points to have separate declarations, definitions, and evals
rlibby [Fri, 7 Jun 2019 04:09:12 +0000 (04:09 +0000)]
Allow fail points to have separate declarations, definitions, and evals

Submitted by: Matthew Bryan <matthew.bryan@isilon.com>
Reviewed by: cem
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20546

4 years agoRework the reporting of the priority.
imp [Fri, 7 Jun 2019 02:05:22 +0000 (02:05 +0000)]
Rework the reporting of the priority.

Simplify the code a bit and rework how we report the results
of the probing.

Reviewed by: tsoome@
Differential Revision: https://reviews.freebsd.org/D20537

4 years agopreen should work independently with alwaysyes and alwaysno.
delphij [Fri, 7 Jun 2019 01:38:51 +0000 (01:38 +0000)]
preen should work independently with alwaysyes and alwaysno.

PR: 238375
MFC after: 2 weeks

4 years agoRemove left-over status variables
imp [Fri, 7 Jun 2019 00:02:02 +0000 (00:02 +0000)]
Remove left-over status variables

4 years agoAllow UMA hash tables to expand faster then 2x in 20 seconds.
mav [Thu, 6 Jun 2019 23:57:28 +0000 (23:57 +0000)]
Allow UMA hash tables to expand faster then 2x in 20 seconds.

ZFS ABD allocates tons of 4KB chunks via UMA, requiring huge hash tables.
With initial hash table size of only 32 elements it takes ~20 expansions
or ~400 seconds to adapt to handling 220GB ZFS ARC.  During that time not
only the hash table is highly inefficient, but also each of those expan-
sions takes significant time with the lock held, blocking operation.

On my test system with 256GB of RAM and ZFS pool of 28 HDDs this change
reduces time needed to first time read 240GB from ~300-400s, during which
system is quite busy and unresponsive, to only ~150s with light CPU load
and just 5 sub-second CPU spikes to expand the hash table.

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

4 years agoFix when NOFAT is defined
imp [Thu, 6 Jun 2019 22:56:55 +0000 (22:56 +0000)]
Fix when NOFAT is defined

We need to add the *efi file to the list of things that get built,
even if we're not creating the efifat stuff.

4 years agoDo not overwrite the RGMII bits in the CPU port register of Switch.
loos [Thu, 6 Jun 2019 21:25:46 +0000 (21:25 +0000)]
Do not overwrite the RGMII bits in the CPU port register of Switch.

Fixes the network on Espressobin.

The GENERIC kernel now boots over NFS.

Sponsored by: Rubicon Communications, LLC (Netgate)

4 years agoMove llvm-ranlib to appropriate location in OptionalObsoleteFiles.inc.
jkim [Thu, 6 Jun 2019 21:24:40 +0000 (21:24 +0000)]
Move llvm-ranlib to appropriate location in OptionalObsoleteFiles.inc.

Note llvm-ar is linked to llvm-ranlib since r311565.  r348677 fixed
"make delete-old" issue with llvm-ar but missed it somehow.

Discussed with: emaste, jhb

4 years agoUse simple malloc/free instead of dropping down to the UEFI
imp [Thu, 6 Jun 2019 21:04:37 +0000 (21:04 +0000)]
Use simple malloc/free instead of dropping down to the UEFI
BootServices AllocatePool/FreePool calls. They are simpler to use and
result in the same thing happening.

Reviewed by: tsoome@
Differential Revision: https://reviews.freebsd.org/D20540

4 years agoZero the GPIO regulator pins memory.
loos [Thu, 6 Jun 2019 20:54:09 +0000 (20:54 +0000)]
Zero the GPIO regulator pins memory.

This fixes a panic in Espressobin when gpioregulator fails to allocate the
GPIO pin (the GPIO controller is not there).

Sponsored by: Rubicon Communications, LLC (Netgate)