]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoAvoid printing extraneous function names when searching man page
Cy Schubert [Wed, 29 Aug 2018 06:04:54 +0000 (06:04 +0000)]
Avoid printing extraneous function names when searching man page
database (apropos, man -k). This commit Replaces .SS with .SH,
similar to the man page provided by original heimdal (as in port).

PR: 230573
Submitted by: yuripv@yuripv.net
Approved by: re (rgrimes@)
MFC after: 3 days

5 years agocxgbe/iw_cxgbe: Fix iWARP RDMA + VIMAGE operation by setting the VNET
Navdeep Parhar [Wed, 29 Aug 2018 04:37:53 +0000 (04:37 +0000)]
cxgbe/iw_cxgbe: Fix iWARP RDMA + VIMAGE operation by setting the VNET
properly in a couple of places in the driver.

Submitted by: Krishnamraju Eraparaju @ Chelsio
Approved by: re@ (rgrimes@)
Sponsored by: Chelsio Communications

5 years agoAdd a sysctl for the ZFS abd_scatter_enabled setting.
Mark Johnston [Wed, 29 Aug 2018 02:49:18 +0000 (02:49 +0000)]
Add a sysctl for the ZFS abd_scatter_enabled setting.

Submitted by: Yamagi Burmeister <lists@yamagi.org> (original version)
Approved by: re (rgrimes)
MFC after: 3 days

5 years agoFix 'install: symlink usr/src/sys -> /sys: File exists' in distributeworld
Li-Wen Hsu [Tue, 28 Aug 2018 23:56:52 +0000 (23:56 +0000)]
Fix 'install: symlink usr/src/sys -> /sys: File exists' in distributeworld

Follow r334617, specify ${DISTDIR} (by ${INSTALL_DDIR}), '/base' and add
${INSTALLFLAGS} while installing the '/sys' symbolic link.

Reviewed by: bapt (earlier version), markj
Approved by: re (gjb), markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16877

5 years agoFix the install of /root/.login missed as part of r337849.
Brad Davis [Tue, 28 Aug 2018 22:51:45 +0000 (22:51 +0000)]
Fix the install of /root/.login missed as part of r337849.

Approved by: re (rgrimes)

5 years agoAdd beforeinstallconfig to bsd.confs.mk to enable running commands prior to
Brad Davis [Tue, 28 Aug 2018 22:22:06 +0000 (22:22 +0000)]
Add beforeinstallconfig to bsd.confs.mk to enable running commands prior to
the installconfig target.

Approved by: re (rgrimes), bapt (mentor)
Differential Revision: https://reviews.freebsd.org/D16874

5 years agoDynamically allocate IRQ ranges on x86.
John Baldwin [Tue, 28 Aug 2018 21:09:19 +0000 (21:09 +0000)]
Dynamically allocate IRQ ranges on x86.

Previously, x86 used static ranges of IRQ values for different types
of I/O interrupts.  Interrupt pins on I/O APICs and 8259A PICs used
IRQ values from 0 to 254.  MSI interrupts used a compile-time-defined
range starting at 256, and Xen event channels used a
compile-time-defined range after MSI.  Some recent systems have more
than 255 I/O APIC interrupt pins which resulted in those IRQ values
overflowing into the MSI range triggering an assertion failure.

Replace statically assigned ranges with dynamic ranges.  Do a single
pass computing the sizes of the IRQ ranges (PICs, MSI, Xen) to
determine the total number of IRQs required.  Allocate the interrupt
source and interrupt count arrays dynamically once this pass has
completed.  To minimize runtime complexity these arrays are only sized
once during bootup.  The PIC range is determined by the PICs present
in the system.  The MSI and Xen ranges continue to use a fixed size,
though this does make it possible to turn the MSI range size into a
tunable in the future.

As a result, various places are updated to use dynamic limits instead
of constants.  In addition, the vmstat(8) utility has been taught to
understand that some kernels may treat 'intrcnt' and 'intrnames' as
pointers rather than arrays when extracting interrupt stats from a
crashdump.  This is determined by the presence (vs absence) of a
global 'nintrcnt' symbol.

This change reverts r189404 which worked around a buggy BIOS which
enumerated an I/O APIC twice (using the same memory mapped address for
both entries but using an IRQ base of 256 for one entry and a valid
IRQ base for the second entry).  Making the "base" of MSI IRQ values
dynamic avoids the panic that r189404 worked around, and there may now
be valid I/O APICs with an IRQ base above 256 which this workaround
would incorrectly skip.

If in the future the issue reported in PR 130483 reoccurs, we will
have to add a pass over the I/O APIC entries in the MADT to detect
duplicates using the memory mapped address and use some strategy to
choose the "correct" one.

While here, reserve room in intrcnts for the Hyper-V counters.

PR: 229429, 130483
Reviewed by: kib, royger, cem
Tested by: royger (Xen), kib (DMAR)
Approved by: re (gjb)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16861

5 years agoAllow multiple FBT probes to share a tracepoint.
Mark Johnston [Tue, 28 Aug 2018 20:21:36 +0000 (20:21 +0000)]
Allow multiple FBT probes to share a tracepoint.

With GNU ifuncs, multiple FBT probes may correspond to the same
instruction.  fbt_invop() assumed that this could not happen and
would return after the first probe found in the global FBT hash
table, which might not be the one that's enabled.  Fix the problem
on x86 by linking probes that share a tracepoint and having each
linked probe fire when the tracepoint is hit.

PR: 230846
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16921

5 years agoRegen after r338357.
Konstantin Belousov [Tue, 28 Aug 2018 18:50:34 +0000 (18:50 +0000)]
Regen after r338357.

Approved by: re (gjb)

5 years agoFix compat32 ftruncate cap mode after ino64.
Konstantin Belousov [Tue, 28 Aug 2018 18:49:39 +0000 (18:49 +0000)]
Fix compat32 ftruncate cap mode after ino64.

Reported by:    asomers
PR:     230120
Sponsored by:   The FreeBSD Foundation
Approved by: re (gjb)

5 years agoSeveral bug fixes and robustness improvements for the AP boot page
Konstantin Belousov [Tue, 28 Aug 2018 18:47:02 +0000 (18:47 +0000)]
Several bug fixes and robustness improvements for the AP boot page
table allocation.

At the time that mp_bootaddress() is called, phys_avail[] array does
not reflect some memory reservations already done, like kernel
placement.  Recent changes to DMAP protection which make kernel text
read-only in DMAP revealed this, where on some machines AP boot page
tables selection appears to intersect with the kernel itself.

Fix this by checking the addresses selected using the same algorithm
as bootaddr_rwx().  Also, try to chomp pages for the page table not
only at the start of the contiguous range, but also at the end.  This
should improve robustness when the only suitable range is already
consumed by the kernel.

Reported and tested by: Michael Gmelin <freebsd@grem.de>
Reviewed by:    jhb
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
Approved by:    re (gjb)
Differential revision:  https://reviews.freebsd.org/D16907

5 years agocxgbe/tom: Unregister shared CPL handlers on module unload. This fixes
Navdeep Parhar [Tue, 28 Aug 2018 18:16:02 +0000 (18:16 +0000)]
cxgbe/tom: Unregister shared CPL handlers on module unload.  This fixes
a panic with INVARIANTS that occurs when t4_tom is unloaded and reloaded.

Approved by: re@ (kib@)

5 years agoDocument the cpu_microcode_* tunables.
Mark Johnston [Tue, 28 Aug 2018 17:14:46 +0000 (17:14 +0000)]
Document the cpu_microcode_* tunables.

Reviewed by: bcr (previous version), kib
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16923

5 years agoAdd libxo(3) support to lastlogin(8).
Philip Paeps [Tue, 28 Aug 2018 17:12:37 +0000 (17:12 +0000)]
Add libxo(3) support to lastlogin(8).

Reviewed by: kp
Approved by: re (gjb)
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16919

5 years agoAdd libxo(3) support to last(1).
Philip Paeps [Tue, 28 Aug 2018 17:10:19 +0000 (17:10 +0000)]
Add libxo(3) support to last(1).

Reviewed by: kp
Approved by: re (gjb)
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16922

5 years agoUse ip/ipv6 structures in al_eth only if they are supported
Marcin Wojtas [Tue, 28 Aug 2018 17:09:41 +0000 (17:09 +0000)]
Use ip/ipv6 structures in al_eth only if they are supported

The ip/ipv6 header files are included only if the appropriate definition
exists, but the driver was missing similar checks when using the
ip and ip6_hdr structures.

If the kernel was not built with the INET or INET6 option, the driver
was preventing kernel from being built.

To fix that, the missing ifdef checks were added to the driver.

PR: Bug 230886
Submitted by: Michal Krawczyk <mk@semihalf.com>
Reported by: O. Hartmann
Approved by: re (gjb)
Obtained from: Semihalf
MFC after: 1 week
Sponsored by: Amazon, Inc.

5 years agoAdd missing endpwent() and endgrent() calls to nfsuserd(8).
Mark Johnston [Tue, 28 Aug 2018 15:18:14 +0000 (15:18 +0000)]
Add missing endpwent() and endgrent() calls to nfsuserd(8).

PR: 230937
Submitted by: Peter Eriksson <peter@ifm.liu.se>
Reviewed by: rmacklem
Approved by: re (gjb)
MFC after: 1 week

5 years agoRegen src.conf.5 after r338347.
Warner Losh [Tue, 28 Aug 2018 14:53:03 +0000 (14:53 +0000)]
Regen src.conf.5 after r338347.

Approved by: re@ (gjb)

5 years agoAdd big, nasty abandonware tags to this code.
Warner Losh [Tue, 28 Aug 2018 14:46:55 +0000 (14:46 +0000)]
Add big, nasty abandonware tags to this code.

This code works for some people, but hasn't been updated in a long
time. Still allow people to use this code for the moment, but put a
big, nasty obsolete message to inform and encourage people to move to
the port.

Approved by: re@ (gjb)
Differential Review: https://reviews.freebsd.org/D16894

5 years agoPut building of drm and drm2 modules behind options.
Warner Losh [Tue, 28 Aug 2018 14:46:49 +0000 (14:46 +0000)]
Put building of drm and drm2 modules behind options.

Make the building of drm dependent on MK_MODULE_DRM and the building
of module drm2 on MK_MODULE_DRM2. The defaults are unchanged.

Approved by: re@ (gjb)
Differential Review: https://reviews.freebsd.org/D16894

5 years agoFix bsdbox build WITH_OFED
Kyle Evans [Mon, 27 Aug 2018 19:34:50 +0000 (19:34 +0000)]
Fix bsdbox build WITH_OFED

hostapd requires libpcap, which links against libmlx5 and libibverbs when
building WITH_OFED. These were not pulled in to bsdbox and most bsdbox
builds were WITHOUT_OFED up until recently, so it was not noticed.

Approved by: re (gjb)

5 years agoReject IPv4 SO_REUSEPORT_LB groups when looking up an IPv6 listening socket
Andrew Gallatin [Mon, 27 Aug 2018 18:13:20 +0000 (18:13 +0000)]
Reject IPv4 SO_REUSEPORT_LB groups when looking up an IPv6 listening socket

Similar to how the IPv4 code will reject an IPv6 LB group,
we must ignore IPv4 LB groups when looking up an IPv6
listening socket.   If this is not done, a port only match
may return an IPv4 socket, which causes problems (like
sending IPv6 packets with a hopcount of 0, making them unrouteable).

Thanks to rrs for all the work to diagnose this.

Approved by: re (rgrimes)
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D16899

5 years agoWhen doing a -S "safe copy", the install command should do an
Kirk McKusick [Mon, 27 Aug 2018 15:20:42 +0000 (15:20 +0000)]
When doing a -S "safe copy", the install command should do an
fsync(2) system call after copying the installed file to ensure
that it is on stable storage.

PR:          230851
Reviewed by: kib
Approved by: re (marius)

5 years agoEnsure we have a large enough stack for the lua loader
Andrew Turner [Mon, 27 Aug 2018 11:14:49 +0000 (11:14 +0000)]
Ensure we have a large enough stack for the lua loader

Lua has a few places where it allocates a large buffer on the stack. This
is normally fine, except there are a few places where there can be multiple
frames with this buffer. This can cause a stack overflow on some arm64 SoCs.

Fix this by allocating our own stack in loader.efi large enough for these
objects. The required size has been found by tracing how the stack pointer
changes in a virtual machine and found to be no larger than 50kB. A
larger stack is allocated to reduce the likelihood of overflow from future
changes.

Reviewed by: kevans
Approved by: re (kib)
Differential Revision: https://reviews.freebsd.org/D16886

5 years agoUse the correct register when storing the arm VFP state.
Andrew Turner [Mon, 27 Aug 2018 10:08:27 +0000 (10:08 +0000)]
Use the correct register when storing the arm VFP state.

Previously we have been lucky where the state was already in r0, however
this is not guaranteed. Use the passed in register as the location to
store the upper half of the arm VFP registers rather than relying on it
being r0.

Approved by: re (kib)

5 years agoRemove arc4random_stir and arc4random_addrandom from stdlib.h.
Xin LI [Sun, 26 Aug 2018 18:04:54 +0000 (18:04 +0000)]
Remove arc4random_stir and arc4random_addrandom from stdlib.h.
Users of arc4random(3) should never call them directly.

All ports tree usage was fixed as part of bug 230756.

Relnotes:       yes
Approved by:    re (marius), exp-run (bug 230756 by portmgr antoine)

5 years agor338270 had the side effect of no longer installing libmd.so into /lib.
Sean Bruno [Sun, 26 Aug 2018 17:05:43 +0000 (17:05 +0000)]
r338270 had the side effect of no longer installing libmd.so into /lib.
For users who have a seperate zfs mount of /usr or /usr/lib, this will
cause dynamic loading failures when attempting to execute zfs mount on
bootup. E.g. the system won't boot.

Including <src.opts.mk> sets SHLIBDIR, so SHLIBDIR?= has no
effect.  The other lib/ Makefiles solve this problem by moving the
SHLIBDIR  assignment to before .include <src.opts.mk>.

Submitted by: jilles
Reviewed by: allanjude
Approved by: re (rgrimes)
Differential Revision: https://reviews.freebsd.org/D16910

5 years agoRemove the Yarrow PRNG algorithm option in accordance with due notice
Mark Murray [Sun, 26 Aug 2018 12:51:46 +0000 (12:51 +0000)]
Remove the Yarrow PRNG algorithm option in accordance with due notice
given in random(4).

This includes updating of the relevant man pages, and no-longer-used
harvesting parameters.

Ensure that the pseudo-unit-test still does something useful, now also
with the "other" algorithm instead of Yarrow.

PR: 230870
Reviewed by: cem
Approved by: so(delphij,gtetlow)
Approved by: re(marius)
Differential Revision: https://reviews.freebsd.org/D16898

5 years agoDisable atkbd0 and atkdbc0 in EC2 AMIs. This has the effect of skipping
Colin Percival [Sun, 26 Aug 2018 03:56:54 +0000 (03:56 +0000)]
Disable atkbd0 and atkdbc0 in EC2 AMIs.  This has the effect of skipping
the probing and attaching of the PS/2 mouse (not present on EC2) and
keyboard (emulated, but not accessible via EC2).

Note that we disable atkbd0 separately even though during device probing
it shows up as a child of atkbdc0; this is necessary because the device
is also initialized during the early console setup from hammer_time.

This change cuts the kernel boot time on an EC2 c5.4xlarge instance from
7259ms down to 4727 ms.

Approved by: re (marius)

5 years agoFix the install location of hcsecd.conf
Brad Davis [Sun, 26 Aug 2018 02:09:20 +0000 (02:09 +0000)]
Fix the install location of hcsecd.conf

Submitted by: vangyzen
Approved by: re (marius)

5 years agoRemove trailing slash in pathname so that valid METALOG is created in the
Brad Davis [Sat, 25 Aug 2018 20:19:16 +0000 (20:19 +0000)]
Remove trailing slash in pathname so that valid METALOG is created in the
NO_ROOT case of make packages.

Submitted by: Dan McGregor <dan.mcgregor@usask.ca>
Approved by: re (rgrimes)

5 years agoEliminate the arena parameter to kmem_free(). Implicitly this corrects an
Alan Cox [Sat, 25 Aug 2018 19:38:08 +0000 (19:38 +0000)]
Eliminate the arena parameter to kmem_free().  Implicitly this corrects an
error in the function hypercall_memfree(), where the wrong arena was being
passed to kmem_free().

Introduce a per-page flag, VPO_KMEM_EXEC, to mark physical pages that are
mapped in kmem with execute permissions.  Use this flag to determine which
arena the kmem virtual addresses are returned to.

Eliminate UMA_SLAB_KRWX.  The introduction of VPO_KMEM_EXEC makes it
redundant.

Update the nearby comment for UMA_SLAB_KERNEL.

Reviewed by: kib, markj
Discussed with: jeff
Approved by: re (marius)
Differential Revision: https://reviews.freebsd.org/D16845

5 years agoFix wrong offset calculation for R_ARM_TLS_TPOFF32 relocations.
Michal Meloun [Sat, 25 Aug 2018 16:54:37 +0000 (16:54 +0000)]
Fix wrong offset calculation for R_ARM_TLS_TPOFF32 relocations.
TLS_TCB_SIZE is already accounted in defobj-> tlsoffset so all these symbols
were incorrectly relocated by +8.

Note:
The only consumer (for all binaries on my ARM board) of R_ARM_TLS_TPOFF32
relocation is _ThreadRuneLocale variable. And the incorrectly relocated
ThreadRuneLocale accidentally pointed to zeroed memory before memory layout
change from D16510 had changed status quo.

MFC after: 3 weeks
Reviewed by: imp, jhb
Approved by: re (marius)

5 years agoSpeed up vt(4) by keeping a record of the most recently drawn character and
Colin Percival [Sat, 25 Aug 2018 16:14:56 +0000 (16:14 +0000)]
Speed up vt(4) by keeping a record of the most recently drawn character and
the foreground and background colours.  In bitblt_text functions, compare
values to this cache and don't re-draw the characters if they haven't changed.
When invalidating the display, clear this cache in order to force characters
to be redrawn; also force full redraws between suspend/resume pairs since odd
artifacts can otherwise result.

When scrolling the display (which is where most time is spent within the vt
driver) this yields a significant performance improvement if most lines are
less than the width of the terminal, since this avoids re-drawing blanks on
top of blanks.

(Note that "re-drawing" here includes writing to the VGA text mode buffer; on
virtualized systems this can be extremely slow since it triggers a glyph
being rendered onto a 640x480 screen).

On a c5.4xlarge EC2 instance (with emulated text mode VGA) this cuts the time
spent in vt(4) during the kernel boot from 1200 ms to 700ms; on my laptop
(with a 3200x1800 display) the corresponding time is reduced from 970 ms down
to 155 ms.

Reviewed by: imp, cem
Approved by: re (gjb)
Relnotes: Significant speedup in vt(4) and the system boot generally.
Differential Revision: https://reviews.freebsd.org/D16723

5 years agoFix column alignment in per-thread mode.
Mark Johnston [Sat, 25 Aug 2018 15:59:51 +0000 (15:59 +0000)]
Fix column alignment in per-thread mode.

PR: 230872
Approved by: re (marius)
MFC after: 1 week

5 years agoAdd in a missing newline
Warner Losh [Sat, 25 Aug 2018 15:47:52 +0000 (15:47 +0000)]
Add in a missing newline

In the conversion, the newline got stripped. It worked fine when there
was only one module, but not when there are many. Add back the missing
newline.

Approved by: re@ (kib)
PR: 230868
Differential Revision: https://reviews.freebsd.org/D16895

5 years agoRemove dead code in i386 cpu_throw().
Konstantin Belousov [Sat, 25 Aug 2018 15:31:23 +0000 (15:31 +0000)]
Remove dead code in i386 cpu_throw().

Curpmap must be already valid when cpu_throw() is called, even for early
AP startup.

Suggested by: alc
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (marius)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16893

5 years agoUnify amd64 and i386 vmspace0 pmap activation.
Konstantin Belousov [Sat, 25 Aug 2018 15:21:28 +0000 (15:21 +0000)]
Unify amd64 and i386 vmspace0 pmap activation.

Add pmap_activate_boot() for i386, move the invocation on APs from MD
init_secondary() to x86 init_secondary_tail().

Suggested by: alc
Reviewed by: alc, markj
Sponsored by: The FreeBSD Foundation
Approved by: re (marius)
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D16893

5 years agolualoader: Fix override of module_path on loader prompt
Kyle Evans [Sat, 25 Aug 2018 04:28:02 +0000 (04:28 +0000)]
lualoader: Fix override of module_path on loader prompt

Earlier changes setup a config.module_path variable that was populated upon
reading of loader.conf(5) and used for restoring module_path to pristine
condition if multiple kernels are attempted. This broke the ability to
override module_path at the loader prompt in case of emergency.

Approved by: re (rgrimes)

5 years agoUnbreak RSS builds after r338257. Folding both RSS blocks together
Bjoern A. Zeeb [Fri, 24 Aug 2018 21:49:21 +0000 (21:49 +0000)]
Unbreak RSS builds after r338257.  Folding both RSS blocks together
I missed the closing } of the new combined block.

Pointyhat to: bz
Reported by: np
Approved by: re (kib)

5 years agoUnbreak VLANs after r337943.
Navdeep Parhar [Fri, 24 Aug 2018 21:48:13 +0000 (21:48 +0000)]
Unbreak VLANs after r337943.

ether_set_pcp should not be called from ether_output_frame for VLAN
interfaces -- the vid + pcp will be inserted during vlan_transmit in
that case. r337943 sets the VLAN's ifnet's if_pcp to a proper PCP value
and this led to double encapsulation (once with vid 0 and second time
with vid+pcp).

PR: 230794
Reviewed by: kib@
Approved by: re@ (gjb@)
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D16887

5 years agoThe read accessors generated by __BUS_ACCESSOR() have the problem that
Marius Strobl [Fri, 24 Aug 2018 21:08:05 +0000 (21:08 +0000)]
The read accessors generated by __BUS_ACCESSOR() have the problem that
they don't check the result of BUS_READ_IVAR(9) and silently return stack
garbage on failure in case a bus doesn't implement a particular instance
variable for example. With MMC bridges not providing MMCBR_IVAR_RETUNE_REQ,
yet, this in turn can cause mmc(4) to get into a state in which re-tuning
seems to be necessary but is inappropriate, causing mmc_wait_for_request()
to fail. Thus, don't use __BUS_ACCESSOR() for mmcbr_get_retune_req() and
instead provide a version of the latter which returns retune_req_none if
reading MMCBR_IVAR_RETUNE_REQ fails.
One more straight-forward solution would have been to change mmc(4) to not
call mmcbr_get_retune_req() if the current transfer mode doesn't require
re-tuning to begin with. However, for modes such as SDR50, it depends on
the controller whether periodic re-tuning is need. Therefore, knowledge of
whether a particular transfer mode does require re-tuning should be kept
to the bridge drivers.
This change is the generic version of r338271, as intended not requiring
bridge drivers to be touched (unless transfer modes beyond high speed are
to be supported that is).

Approved by: re (gjb)

5 years agolibbe(3)/bectl(8): Make consistent with beadm
Kyle Evans [Fri, 24 Aug 2018 20:44:58 +0000 (20:44 +0000)]
libbe(3)/bectl(8): Make consistent with beadm

vermaden (maintainer of beadm) points out the following inconsistencies:
- "missing command" is not printed prior to usage if the error is simply a
   missing command; this should be obvious from the context
- "bectl rename" isn't using the "don't unmount" flag (zfs rename -u), so
   the active BE can't be renamed. It doesn't make sense in our context to
   *not* use -u, so use it.

Documentation updates reflect the above and note an inconsistency with the
'destroy' command that is consistent with other parts of the base system.

A fix for libbe(3) not properly being installed to /lib is included.
SHLIBDIR should have been added when it was moved in r337995.

Approved by: re (kib)

5 years agoEither "free" or "allocated" is misleading here, since an item
Gleb Smirnoff [Fri, 24 Aug 2018 18:47:50 +0000 (18:47 +0000)]
Either "free" or "allocated" is misleading here, since an item
in a bucket is free from perspective of UMA consumer, and it is
allocated from perspective of keg.

Discussed with: markj
Approved by: re (kib)

5 years agorelease: arm64: Enable overlays for PINE64 and PINE64-LTS
Emmanuel Vadot [Fri, 24 Aug 2018 15:01:58 +0000 (15:01 +0000)]
release: arm64: Enable overlays for PINE64 and PINE64-LTS

Approved by: re (gjb)

5 years agorelease: arm: Setup overlays if board config defines some
Emmanuel Vadot [Fri, 24 Aug 2018 15:01:22 +0000 (15:01 +0000)]
release: arm: Setup overlays if board config defines some

Approved by: re (gjb)

5 years agoarm64: Add DTS overlays for A64
Emmanuel Vadot [Fri, 24 Aug 2018 15:00:36 +0000 (15:00 +0000)]
arm64: Add DTS overlays for A64

 - sun50i-a64-sid.dtso registers the Security ID node, needed for thermal
 - sun50i-a64-ths.dtso registers the thermal node, for which we already have a
driver
 - sun50i-a64-timer.dtso registers the timer node, needed as the generic timer
 glitch on A64 SoC.

Approved by:    re (gjb)

5 years agoLimit the amount of "fast" entropy. We don't need nearly as much
Mark Murray [Fri, 24 Aug 2018 14:53:46 +0000 (14:53 +0000)]
Limit the amount of "fast" entropy. We don't need nearly as much
for security, and the excess just slows things down badly.

PR:             230808
Submitted by:   rwmaillists@googlemail.com, but tweeked by me
Reported by:    Danilo Egea Gondolfo <danilo@FreeBSD.org>
Reviewed by: cem,delphij
Approved by: re(rgrimes)
Approved by: so(delphij)
MFC after:      1 Month
Differential Revision: https://reviews.freebsd.org/D16873

5 years agoFix braino of mine where the reseeds would happen far too often,
Mark Murray [Fri, 24 Aug 2018 14:53:42 +0000 (14:53 +0000)]
Fix braino of mine where the reseeds would happen far too often,
making the kernel process way too busy.

PR:             230808
Submitted by:   Conrad Meyer <cem@FreeBSD.org>
Reported by:    Danilo Egea Gondolfo <danilo@FreeBSD.org>
Reviewed by: cem,delphij
Approved by: re(rgrimes)
Approved by: so(delphij)
MFC after:      1 Month
Security: Yes
Differential Revision: https://reviews.freebsd.org/D16872

5 years agoFix a shadowed variable warning.
Michael Tuexen [Fri, 24 Aug 2018 10:50:19 +0000 (10:50 +0000)]
Fix a shadowed variable warning.
Thanks to Peter Lei for reporting the issue.

Approved by: re(kib@)
MFH: 1 month
Sponsored by: Netflix, Inc.

5 years agoUnblock speculative prefetcher also on pool creation.
Alexander Motin [Fri, 24 Aug 2018 01:59:25 +0000 (01:59 +0000)]
Unblock speculative prefetcher also on pool creation.

Fix at r331950 appeared to be incomplete, fixing only case of pool
import, but not pool creation, leaving prefetcher still blocked for
newly created pools.

Approved by: re (gjb)
MFC after: 1 week

5 years agoUpdate head from ALPHA2 to ALPHA3 as part of the 12.0-RELEASE
Glen Barber [Fri, 24 Aug 2018 00:25:25 +0000 (00:25 +0000)]
Update head from ALPHA2 to ALPHA3 as part of the 12.0-RELEASE
cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

5 years agoRevert drm2 removal.
Warner Losh [Fri, 24 Aug 2018 00:02:00 +0000 (00:02 +0000)]
Revert drm2 removal.

Revert r338177, r338176, r338175, r338174, r338172

After long consultations with re@, core members and mmacy, revert
these changes. Followup changes will be made to mark them as
deprecated and prent a message about where to find the up-to-date
driver.  Followup commits will be made to make this clear in the
installer. Followup commits to reduce POLA in ways we're still
exploring.

It's anticipated that after the freeze, this will be removed in
13-current (with the residual of the drm2 code copied to
sys/arm/dev/drm2 for the TEGRA port's use w/o the intel or
radeon drivers).

Due to the impending freeze, there was no formal core vote for
this. I've been talking to different core members all day, as well as
Matt Macey and Glen Barber. Nobody is completely happy, all are
grudgingly going along with this. Work is in progress to mitigate
the negative effects as much as possible.

Requested by: re@ (gjb, rgrimes)

5 years agoFix comment. The actual meaning of ub_cnt is the opposite.
Gleb Smirnoff [Thu, 23 Aug 2018 23:24:28 +0000 (23:24 +0000)]
Fix comment. The actual meaning of ub_cnt is the opposite.

5 years agoFollowing r335259, don't copy boot1 from the running system for sparc64
Marius Strobl [Thu, 23 Aug 2018 22:57:42 +0000 (22:57 +0000)]
Following r335259, don't copy boot1 from the running system for sparc64
either.

5 years agobsdinstall/zfsboot: Enable new UEFI+GELI support
Allan Jude [Thu, 23 Aug 2018 22:50:11 +0000 (22:50 +0000)]
bsdinstall/zfsboot: Enable new UEFI+GELI support

After r336252 it is no longer necessary to have a separate bootpool when
booting from an encrypted disk with UEFI.

This change also switches the EFI System Partition contents from
the 800 KB boot1.efifat to a new 200 MB filesystem created with newfs_msdos
and uses loader.efi directly, instead of boot1.efi.

PR: 228916
Reviewed by: dteske
MFC after: 1 month
Relnotes: yes
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D12315

5 years agoProper spelling of consolidation.
Kirk McKusick [Thu, 23 Aug 2018 22:35:14 +0000 (22:35 +0000)]
Proper spelling of consolidation.

Submitted by: Dimitry Andric

5 years ago- Use le32dec(9) for decoding EXT_CSD values where it makes sense. [1]
Marius Strobl [Thu, 23 Aug 2018 21:26:58 +0000 (21:26 +0000)]
- Use le32dec(9) for decoding EXT_CSD values where it makes sense. [1]
- Locally cache some instance variable values in mmc_discover_cards()
  in order to improve the code readability a bit.

Obtained from: NetBSD [1]

5 years agoAdd a per-pagequeue pdpages counter.
Mark Johnston [Thu, 23 Aug 2018 21:03:45 +0000 (21:03 +0000)]
Add a per-pagequeue pdpages counter.

Expose these counters under the vm.domain sysctl node.  The existing
vm.stats.vm.v_pdpages sysctl is preserved.

Reviewed by: alc (previous version)
Differential Revision: https://reviews.freebsd.org/D14666

5 years agoReduce the log level of tcpd_warn calls from ERR to WARNING.
Bjoern A. Zeeb [Thu, 23 Aug 2018 20:44:26 +0000 (20:44 +0000)]
Reduce the log level of tcpd_warn calls from ERR to WARNING.
This matches the name and avoids logging of warnings to console with
default syslog.conf, esp. getting rid of:
  warning: /etc/hosts.allow, line ..: can't verify hostname: \
     getaddrinfo(.., AF_INET) failed

5 years agoEnsure that queue state is cleared when vm_page_dequeue() returns.
Mark Johnston [Thu, 23 Aug 2018 20:34:22 +0000 (20:34 +0000)]
Ensure that queue state is cleared when vm_page_dequeue() returns.

Per-page queue state is updated non-atomically, with either the page
lock or the page queue lock held.  When vm_page_dequeue() is called
without the page lock, in rare cases a different thread may be
concurrently dequeuing the page with the pagequeue lock held.  Because
of the non-atomic update, vm_page_dequeue() might return before queue
state is completely updated, which can lead to race conditions.

Restrict the vm_page_dequeue() interface so that it must be called
either with the page lock held or on a free page, and busy wait when
a different thread is concurrently updating queue state, which must
happen in a critical section.

While here, do some related cleanup: inline vm_page_dequeue_locked()
into its only caller and delete a prototype for the unimplemented
vm_page_requeue_locked().  Replace the volatile qualifier for "queue"
added in r333703 with explicit uses of atomic_load_8() where required.

Reported and tested by: pho
Reviewed by: alc
Differential Revision: https://reviews.freebsd.org/D15980

5 years agoObtain the bus mode (MMC or SD) from the directly superordinated
Marius Strobl [Thu, 23 Aug 2018 20:25:27 +0000 (20:25 +0000)]
Obtain the bus mode (MMC or SD) from the directly superordinated
bus rather than reaching up to the bridge and use the cached mode
in mmcsd_delete(), too.

5 years agoConfigure -zifunc-noplt for amd64 kernels.
Mark Johnston [Thu, 23 Aug 2018 19:58:24 +0000 (19:58 +0000)]
Configure -zifunc-noplt for amd64 kernels.

Per r338251, this ensures that ifunc calls have the same ordinary
function calls.

Reviewed by: emaste (previous version)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16750

5 years agoUse arc4rand() instead of read_random() in the SCTP and TCP code.
Michael Tuexen [Thu, 23 Aug 2018 19:10:45 +0000 (19:10 +0000)]
Use arc4rand() instead of read_random() in the SCTP and TCP code.

This was suggested by jmg@.

Reviewed by: delphij@, jmg@, jtl@
MFC after: 1 month
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16860

5 years agoa10_timer: Update the driver so we can use it on other SoC
Emmanuel Vadot [Thu, 23 Aug 2018 18:46:05 +0000 (18:46 +0000)]
a10_timer: Update the driver so we can use it on other SoC

a10_timer is currently use in UP allwinner SoC (A10 and A13).
Those don't have the generic arm timer.
The arm generic timecounter is broken in the A64 SoC, some attempts have
been made to fix the glitch but users still reported some minor ones.
Since the A64 (and all Allwinner SoC) still have this timer controller, rework
the driver so we can use it in any SoC.
Since it doesn't have the 64 bits counter on all SoC, use one of the
generic 32 bits counter as the timecounter source.

PR: 229644

5 years agoaw_mmc: Handle MMCBR_IVAR_RETUNE_REQ
Emmanuel Vadot [Thu, 23 Aug 2018 18:33:42 +0000 (18:33 +0000)]
aw_mmc: Handle MMCBR_IVAR_RETUNE_REQ

Without this the mmc stack sometimes think that we are in in a retune
operation and some command like switch the bus width to 4 bits failed.
We now switch correctly to 4 bits mode for sd card.

Reported by: jmg, others in pine64 irc channel

5 years agoDon't build skein_block_asm.s if we don't have an as binary
Alex Richardson [Thu, 23 Aug 2018 18:19:33 +0000 (18:19 +0000)]
Don't build skein_block_asm.s if we don't have an as binary

This fixes building libmd on MacOS/Linux. The real fix is probably to
build it as a .S file with $CC instead. It might also be better to just
compile the C file in userspace since the compiler can the use SSE/AVX.

Reviewed By: emaste, brooks
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16844

5 years agoOnly bootstrap localedef if ${MK_LOCALES} != "no"
Alex Richardson [Thu, 23 Aug 2018 18:19:21 +0000 (18:19 +0000)]
Only bootstrap localedef if ${MK_LOCALES} != "no"

During the build it is only used by share/ctypedef and share/colldef
which will not be built if ${MK_LOCALE} == "no". This saves a tiny bit
of time when building without locales.

Approved By: jhb (mentor)

5 years agoFix non-FreeBSD host lib32 build for TARGET=amd64
Alex Richardson [Thu, 23 Aug 2018 18:19:10 +0000 (18:19 +0000)]
Fix non-FreeBSD host lib32 build for TARGET=amd64

When building on non-FreeBSD systems we need to pass an explicit target
triple to clang otherwise it will attempt to build with the host triple.
This also has advantages when building on a FreeBSD host: we now tell
clang that we are targeting at least FreeBSD 12.0 instead of an older
version so it can enable newer features.

Reviewed By: brooks (mentor)
Approved By: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16842

5 years agoAllow bootstrapping md5 on Linux, MacOS and FreeBSD < 12
Alex Richardson [Thu, 23 Aug 2018 18:19:01 +0000 (18:19 +0000)]
Allow bootstrapping md5 on Linux, MacOS and FreeBSD < 12

In order to build on a Linux host we need to bootstrap md5 since the Linux
md5sum command produces output in a different format.

Reviewed By: emaste
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16846

5 years agoHandle -DNO_ROOT for `make compat` in include/
Alex Richardson [Thu, 23 Aug 2018 18:18:52 +0000 (18:18 +0000)]
Handle -DNO_ROOT for `make compat` in include/

Otherwise this step will fail on a Linux host due to missing "wheel" group

Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16841

5 years agoDon't use absolute path to sed when building usr.bin/join
Alex Richardson [Thu, 23 Aug 2018 18:18:43 +0000 (18:18 +0000)]
Don't use absolute path to sed when building usr.bin/join

This is required to build sort on Linux hosts since sed is in /bin there.

Approved By: jhb (mentor)

5 years agoRemove a duplicated interface capability bit missed in r336313.
Marius Strobl [Thu, 23 Aug 2018 18:11:55 +0000 (18:11 +0000)]
Remove a duplicated interface capability bit missed in r336313.

5 years agoRemove hyper-v leftovers when WITHOUT_HYPERV is set
Kyle Evans [Thu, 23 Aug 2018 18:06:31 +0000 (18:06 +0000)]
Remove hyper-v leftovers when WITHOUT_HYPERV is set

hv_vss_daemon was missed.

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

5 years agostand: fdt: Drop some write-only assignments/variables and leaked bits
Kyle Evans [Thu, 23 Aug 2018 18:01:34 +0000 (18:01 +0000)]
stand: fdt: Drop some write-only assignments/variables and leaked bits

Generally straightforward enough; a copy of argv[1] was being made in
command_fdt_internal, solely used for a comparison within the
handler-search, then promptly leaked.

Reported by: ports gcc and clang's static analyzer

5 years ago- According to section 2.2.5 of the SDHCI specification version 4.20,
Marius Strobl [Thu, 23 Aug 2018 17:50:41 +0000 (17:50 +0000)]
- According to section 2.2.5 of the SDHCI specification version 4.20,
  SDHCI_TRNS_ACMD12 is to be set only for multiple-block read/write
  commands without data length information, so don't unconditionally
  set this bit. The result matches what e. g. Linux does.
- Section 2.2.19 of the SDHCI specification version 4.20 states that
  SDHCI_ACMD12_ERR should be only valid if SDHCI_INT_ACMD12ERR is set
  and hardware may clear SDHCI_ACMD12_ERR when SDHCI_INT_ACMD12ERR is
  cleared (differing silicon behavior is specifically allowed, though).
  Thus, read SDHCI_ACMD12_ERR before clearing SDHCI_INT_ACMD12ERR.
  While at it, use the 16-bit accessor rather than the 32-bit one for
  reading the 16-bit SDHCI_ACMD12_ERR.
- SDHCI_INT_TUNEERR isn't one of the ROC bits in SDHCI_INT_STATUS so
  clear it explicitly.
- Add missing prototypes and sort them.

5 years agoFix warning about crossing INT32_MAX boundary in computation of constant value.
Patrick Kelsey [Thu, 23 Aug 2018 17:41:39 +0000 (17:41 +0000)]
Fix warning about crossing INT32_MAX boundary in computation of constant value.

5 years agolualoader: Accept that people use unquoted values in loader.conf
Kyle Evans [Thu, 23 Aug 2018 17:27:02 +0000 (17:27 +0000)]
lualoader: Accept that people use unquoted values in loader.conf

While loader.conf(5) suggests that all values should be quoted, reality is
that this was never strictly enforced and it is used. We already make some
concession to this in number values, which aren't strictly quoted either.

The compromise here is that multi-word values must be quoted. This lets
things like `foo_load=YES` work, while denying more complex expressions on
the right hand side. This likely catches the vast majority of current usage.

A bit of a kludge is needed to accomplish this since Lua regex doesn't
support branching. I had considered splitting up expressions and generating
the right-hand side of the expressions completely in config.parse, but
deemed this too large of an overhaul to take given the current timing. This
should be re-worked shortly after the thaw.

Reported by: royger

5 years agotftp(1): switch default transfer mode to binary
Alan Somers [Thu, 23 Aug 2018 17:00:07 +0000 (17:00 +0000)]
tftp(1): switch default transfer mode to binary

netascii is obsolete and inefficient. It isn't even supported by many
clients. Better to use binary mode by default.

Reviewed by: cem
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16869

5 years agoMFp4 bz_ipv6_fast:
Bjoern A. Zeeb [Thu, 23 Aug 2018 16:54:22 +0000 (16:54 +0000)]
MFp4 bz_ipv6_fast:

Migrate udp6_send() v4mapped code to udp6_output() saving us a re-lock and
further simplifying the address-family handling code by eliminating
AF_INET checks and almost all v4mapped handling right after the start
as cases could actually not happen anymore.

Rework output path locking similar to UDP4 allowing for better
parallelism (see r222488, and later versions).

Sponsored by: The FreeBSD Foundation (2012)
Sponsored by: iXsystems (2012)
Differential Revision: https://reviews.freebsd.org/D3721

5 years agoxen/netfront: Ensure curvnet is set
Kristof Provost [Thu, 23 Aug 2018 16:52:52 +0000 (16:52 +0000)]
xen/netfront: Ensure curvnet is set

netfront_backend_changed() is called from the xenwatch_thread(), which means
that the curvnet is not set. We have to set it before we can call things like
arp_ifinit().

PR: 230845

5 years agolualoader: Fix (add) Xen support
Kyle Evans [Thu, 23 Aug 2018 16:26:03 +0000 (16:26 +0000)]
lualoader: Fix (add) Xen support

lualoader was not respecting the 'xen_kernel' environment variable, which
hints to the interpreter that it should load a Xen kernel prior to loading
any other kernel that might be specified. If a Xen kernel is specified and
we fail to load it, we should not proceed to boot.

Reported by: royger
Tested by: royger

5 years agocxgbe(4): Use fcmpset instead of cmpset when appropriate.
Navdeep Parhar [Thu, 23 Aug 2018 16:24:27 +0000 (16:24 +0000)]
cxgbe(4): Use fcmpset instead of cmpset when appropriate.

Suggested by: mjg@
MFC after: 1 month
Sponsored by: Chelsio Communications

5 years agoExtend tbrsize heuristic in pfctl(8) to provide a sensible value for
Patrick Kelsey [Thu, 23 Aug 2018 16:10:28 +0000 (16:10 +0000)]
Extend tbrsize heuristic in pfctl(8) to provide a sensible value for
higher bandwidth interfaces.  The new value is used above 2.5 Gbps,
which is the highest standard rate that could be used prior to
r338209, so the default behavior for all existing systems should
remain the same.

The value of 128 chosen is a balance between being big enough to
reduce potential precision/quantization effects stemming from frequent
bucket refills over small time intervals and being small enough to
prevent a greedy driver from burst dequeuing more packets than it has
available hardware ring slots for whenever altq transitions from idle
to backlogged.

Reviewed by: jmallett, kp
MFC after: 2 weeks
Sponsored by: RG Nets
Differential Revision: https://reviews.freebsd.org/D16852

5 years agoRemove a redundant #ifdef _KERNEL.
Mark Johnston [Thu, 23 Aug 2018 15:01:27 +0000 (15:01 +0000)]
Remove a redundant #ifdef _KERNEL.

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 3 days

5 years agoAdd an lld option to emit PC-relative relocations for ifunc calls.
Mark Johnston [Thu, 23 Aug 2018 14:58:19 +0000 (14:58 +0000)]
Add an lld option to emit PC-relative relocations for ifunc calls.

The current kernel ifunc implementation creates a PLT entry for each
ifunc definition.  ifunc calls therefore consist of a call to the
PLT entry followed by an indirect jump.  The jump target is written
during boot when the kernel linker resolves R_[*]_IRELATIVE relocations.
This implementation is defined by requirements for userland code, where
text relocations are avoided.  This requirement is not present for the
kernel, so the implementation has avoidable overhead (namely, an extra
indirect jump per call).

Address this for now by adding a special option to the static linker
to inhibit PLT creation for ifuncs.  Instead, relocations to ifunc call
sites are passed through to the output file, so the kernel linker can
enumerate such call sites and apply PC-relative relocations directly
to the text section.  Thus the overhead of an ifunc call becomes exactly
the same as that of an ordinary function call.  This option is only for
use by the kernel and will not work for regular programs.

The final form of this optimization is up for debate; for now, this
change is simple and static enough to be acceptable as an interim
solution.

Reviewed by: emaste
Discussed with: arichardson, dim
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16748

5 years agoefiloader: Setup FDT in autoload to fix overlays clobbering kenv
Kyle Evans [Thu, 23 Aug 2018 13:38:38 +0000 (13:38 +0000)]
efiloader: Setup FDT in autoload to fix overlays clobbering kenv

manu found in the noted PR that overlays seemed to be clobbering the kenv
and killing the boot. Further inspection revealed that one can `fdt ls` at
the loader prompt for a successful boot, but autoboot breaks it.

In the autoboot case, first setup of FDT is happening in the middle of
bi_load, which triggers loading of the DTBO from /boot.

This is bad, bad, bad. Files in the loader are loaded somewhere in the
middle of the address space one after another. bi_load starts building the
needed kernel bootinfo immediately after the highest-addr loaded file. File
loads in the middle of bi_load suddenly clobber bootinfo and everything goes
off the rails.

The solution to this is to use take advantage of arch_autoload to setup FDT
in efiloader compiled with LOADER_FDT_SUPPORT. This matches how it works in
ubldr land, and is how it should have worked when overlay support was added
to efiloader since fdt_setup_fdtp now has the potential to load files
(courtesy of fdt_platform_load_dtb).

PR: 230804
Discussed with: imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16858

5 years agoarm64: GENERIC: Compile allwinner dtbs
Emmanuel Vadot [Thu, 23 Aug 2018 13:25:32 +0000 (13:25 +0000)]
arm64: GENERIC: Compile allwinner dtbs

5 years agodtb: Allwinner: Add aarch64 dts files
Emmanuel Vadot [Thu, 23 Aug 2018 13:24:28 +0000 (13:24 +0000)]
dtb: Allwinner: Add aarch64 dts files

5 years agodtb: aarch64 uses vendor subdirectories, handle that
Emmanuel Vadot [Thu, 23 Aug 2018 13:23:54 +0000 (13:23 +0000)]
dtb: aarch64 uses vendor subdirectories, handle that

5 years agomake_dtb: Always add root directory in the include path
Emmanuel Vadot [Thu, 23 Aug 2018 13:23:21 +0000 (13:23 +0000)]
make_dtb: Always add root directory in the include path

Some arch like arm and arm64 share DTS files, add the root dts directory
to the include paths.

5 years agodts: Import DTS for arm64
Emmanuel Vadot [Thu, 23 Aug 2018 13:21:01 +0000 (13:21 +0000)]
dts: Import DTS for arm64

 - Most of the boards are using U-Boot, u-boot embed a DTB that isn't
compiled with -@ (overlay ready) so we cannot use overlays. We want
overlays, overlays are nice.
 - The DTS life is going to linux, then sometimes it's imported in
U-Boot but it depend on the SoC family, U-Boot doesn't batch import
every DTS like we do. So sometimes to U-Boot DTS are very old. Or when
an interesting patch in commited upstream it is in Linux X+2 (roughly 4
months from now), we then have to wait for U-Boot to catch up, that
give us between 4 and 6 months to have an update.
 - Some boards like the Marvell ones have 3 DTS, the one in the
vendor U-Boot made by Marvell themselves, the one in u-boot mainline
and the one in Linux. I found that the DTS in the Marvell U-Boot have
some problem with FreeBSD (especially the macchiatobin that declare
node with the same address but not the same size, that is not something
that the rman code can handle, it could be modified, I don't know the
code well enough). Also some compatible are used when they shouldn't,
for example they declare the gpio being orion-gpio while this binding
requires interrupts supports, which the node doesn't have.
 - The above situation is mostly the same with RockChip SoCs (possibly
others, those are the only SoCs I work on that have this problem).

 Note that importing the DTS doesn't mean that every board will use
them, I don't intend to copy the DTB to the GENERIC memstick image for
the Overdrive 1000/3000 for example, the ones provided by the firmware
works fine.
 RPI3 will still stay an exception as we use the DTB provided by the
rpi-firmware package, so they come from the rpi foundation linux fork.

5 years agousr.sbin/ndp: Cleanup in preparation to add libxo support
Renato Botelho [Thu, 23 Aug 2018 10:38:59 +0000 (10:38 +0000)]
usr.sbin/ndp: Cleanup in preparation to add libxo support

* Constify rtpref_str declaration
* Remove unused h_errno declaration
* Use time_t type for expire
* Use strlcpy to set static "?" value to ifname
* Rename local variable 's' to stop shadowing global definition
* Close socket used in pfx_flush()
* Use local variables for sock() in setdefif() and getdefif()
* Increase WARNS to 3

Reviewed by: allanjude, kevans
Approved by: allanjude
Sponsored by: Rubicon Communications, LLC (Netgate)
Differential Revision: https://reviews.freebsd.org/D11118

5 years agoAdd manpage entry for the new bhyve options -s "help" and -l "help".
Marcelo Araujo [Thu, 23 Aug 2018 07:34:51 +0000 (07:34 +0000)]
Add manpage entry for the new bhyve options -s "help" and -l "help".

Reported by: 0mp
Sponsored by: iXsystems Inc.

5 years agoDon't use the explicit number 32 for the length of the secrets,
Michael Tuexen [Thu, 23 Aug 2018 06:03:59 +0000 (06:03 +0000)]
Don't use the explicit number 32 for the length of the secrets,
use sizeof() or explicit #definesi instead. No functional change.
This was suggested by jmg@.

MFC after: 1 month
XMFC with: r338053
Sponsored by: Netflix, Inc.

5 years agoForgot to bump .Dd in r338233 like I promised in the review. Doh!
Warner Losh [Thu, 23 Aug 2018 05:08:38 +0000 (05:08 +0000)]
Forgot to bump .Dd in r338233 like I promised in the review. Doh!

5 years agoAdd a special note to UPDATING for the devmatch stuff. While tested,
Warner Losh [Thu, 23 Aug 2018 05:06:31 +0000 (05:06 +0000)]
Add a special note to UPDATING for the devmatch stuff. While tested,
there's an elevated risk of trouble, and you must update kernel,
userland and rc scripts for the best experience.

5 years agoImplement blacklisting for devmatch
Warner Losh [Thu, 23 Aug 2018 05:06:27 +0000 (05:06 +0000)]
Implement blacklisting for devmatch

devmatch_blacklist is a space separated list of modules (w/o the .ko
or full path) to exclude from devmatch's processing.

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

5 years agoWhen trying to match the nomatch event passed to us, attempt to look
Warner Losh [Thu, 23 Aug 2018 05:06:22 +0000 (05:06 +0000)]
When trying to match the nomatch event passed to us, attempt to look
up the device described by the nomatch event in the device tree. If we
find it, then if the device is marked as have already attached to a
device once, then ignore the device.

This keeps us from reloading the device driver when it has just been
manually unloaded. All devies that have had a driver attach to them at
least once no longer participate in pnp-based autoloading.

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

5 years agoAdd a new device flag: DF_ATTACHED_ONCE
Warner Losh [Thu, 23 Aug 2018 05:06:16 +0000 (05:06 +0000)]
Add a new device flag: DF_ATTACHED_ONCE

This flag is set once the device has been successfully attached. When
set, it inhibits devmatch from trying to match the device. This in
turn allows kldunload to work as expected. Prior to the change, the
driver would immediately reload because devmatch had no notion that
the driver had once been attached, and therefore shouldn't participate
in further matching.

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