Stefan Eßer [Thu, 26 Nov 2020 17:39:51 +0000 (17:39 +0000)]
Update to version 3.2.0
Alex Richardson [Thu, 26 Nov 2020 17:37:27 +0000 (17:37 +0000)]
bsd.lib.mk: Work around build system raciness
We are seeing regular build failures due to libc.so being installed again and
another parallel make job tries to read the partially written libc.so at the
same time. When building with -j32 or higher this almost always happens on
the first clean build (subsequent incremental builds always work fine).
Using -S should "fix" the "section header table goes past the end of the
file: e_shoff = 0x..." errors that have started to plague our builds.
We originally thought this only affected CheriBSD, but I just got the same
error while building the latest upstream FreeBSD.
The real fix should be to not install libraries twice, but until then this
workaround is needed.
Original patch by jrtc27@, I only made some minor changes to the comment.
Obtained from: CheriBSD (https://github.com/CTSRD-CHERI/cheribsd/commit/
49837edd3efd5d02a1b120c47f00cfc2d59a9a8e)
Reviewed By: markj, bdrewery
Differential Revision: https://reviews.freebsd.org/D27102
Alex Richardson [Thu, 26 Nov 2020 17:37:22 +0000 (17:37 +0000)]
Add .cfi_{start,end}proc for RISC-V assembly functions
This allows GDB to print more useful backtraces when setting a breakpoint
on an assembly function.
Reviewed By: jhb
Differential Revision: https://reviews.freebsd.org/D27177
Stefan Eßer [Thu, 26 Nov 2020 17:27:07 +0000 (17:27 +0000)]
Import version 3.2.0
Emmanuel Vadot [Thu, 26 Nov 2020 17:19:47 +0000 (17:19 +0000)]
arm: allwinner: a23 timer functions are only used for arm64
Emmanuel Vadot [Thu, 26 Nov 2020 17:19:30 +0000 (17:19 +0000)]
arm: tegra: Remove unused variable
Emmanuel Vadot [Thu, 26 Nov 2020 17:19:13 +0000 (17:19 +0000)]
arm: mv: Remove unused code
Emmanuel Vadot [Thu, 26 Nov 2020 17:18:54 +0000 (17:18 +0000)]
arm: ti: Remove unused function ti_first_gpio_bank
Stefan Eßer [Thu, 26 Nov 2020 17:18:18 +0000 (17:18 +0000)]
Revert incomplete import of version 3.2.0
Stefan Eßer [Thu, 26 Nov 2020 16:52:17 +0000 (16:52 +0000)]
Update to version 3.2.0
Emmanuel Vadot [Thu, 26 Nov 2020 16:40:39 +0000 (16:40 +0000)]
sdhci: mmccam: Update vccq in the driver ios
Otherwise we always report that the card is running at 1.2V.
Emmanuel Vadot [Thu, 26 Nov 2020 16:40:20 +0000 (16:40 +0000)]
sdhci: Only print mmccam debug code if hw.sdhci.debug is > 1
Emmanuel Vadot [Thu, 26 Nov 2020 16:39:56 +0000 (16:39 +0000)]
mmccam: We can't sleep during sdda_add_part so use M_NOWAIT
Reviewed by: kibab
Differential Revision: https://reviews.freebsd.org/D25947
Hans Petter Selasky [Thu, 26 Nov 2020 16:36:50 +0000 (16:36 +0000)]
Ensure consistent error messages from ifconfig(8).
If multiple threads are invoking "ifconfig XXX create" a race may occur
which can lead to two different error messages for the same error.
a) ifconfig: SIOCIFCREATE2: File exists
b) ifconfig: interface XXX already exists
This patch ensures ifconfig prints the same error code
for the same case.
Reviewed by: imp@ and kib@
Differential Revision: https://reviews.freebsd.org/D27380
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
Ulrich Spörlein [Thu, 26 Nov 2020 14:42:16 +0000 (14:42 +0000)]
GH Actions: Use pre-installed clang packages
Also fix the run by setting up the environment in non-deprecated way.
Always run with --debug to understand better what sort of stuff is happening in
the background. Also split out the bmake bootstrap stage (takes about 31s on
ubuntu, but 1m14 on macOS?)
Drops the dependency on coreutils (realpath, nproc) and thus (?) fixes macOS to
be just as fast (4 logical cores vs 2 physical cores before, go figure.)
Reviewed by: arichardson
Alex Richardson [Thu, 26 Nov 2020 13:31:57 +0000 (13:31 +0000)]
Significantly speed up libthr/mutex_test and make more reliable
Instead of using a simple global++ as the data race, with this change we
perform the increment by loading the global, delaying for a bit and then
storing back the incremented value. If I move the increment outside of the
mutex protected range, I can now see the data race with only 100 iterations
on amd64 in almost all cases. Before this change such a racy test almost
always passed with < 100,000 iterations and only reliably failed with the
current limit of 10 million.
I noticed this poorly written test because the mutex:mutex{2,3} and
timedmutex:mutex{2,3} tests were always timing out on our CheriBSD Jenkins.
Writing good concurrency tests is hard so I won't attempt to do so, but this
change should make the test more likely to fail if pthread_mutex_lock is not
implemented correctly while also significantly reducing the time it takes to
run these four tests. It will also reduce the time it takes for QEMU RISC-V
testsuite runs by almost 40 minutes (out of currently 7 hours).
Reviewed By: brooks, ngie
Differential Revision: https://reviews.freebsd.org/D26473
Pawel Biernacki [Thu, 26 Nov 2020 09:07:45 +0000 (09:07 +0000)]
libsysdecode: account for invalid protection flags
Reported by: jhb
MFC with: r368022
Poul-Henning Kamp [Thu, 26 Nov 2020 07:34:20 +0000 (07:34 +0000)]
Add support for Fintek F81803 SuperIO chip
Reviewed by: avg
Mateusz Guzik [Thu, 26 Nov 2020 06:59:27 +0000 (06:59 +0000)]
thread: staticize thread_reap and move td_allocdomain
thread_init is a much better fit as the the value is constant after
initialization.
Peter Grehan [Thu, 26 Nov 2020 05:58:55 +0000 (05:58 +0000)]
Remove manual instruction encodings for VMLOAD, VMRUN, and VMSAVE.
This is a relic from when these instructions weren't supported by the toolchain.
No functional change.
Submitted by: adam_fenn.io
Reviewed by: grehan
Approved by: grehan (bhyve)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D27130
Alan Somers [Thu, 26 Nov 2020 04:55:02 +0000 (04:55 +0000)]
ping: fix some man pages and tests after r368045
MFC-with: r368045
Alan Somers [Thu, 26 Nov 2020 04:29:30 +0000 (04:29 +0000)]
Merge ping6 to ping
There is now a single ping binary, which chooses to use ICMP or ICMPv4
based on the -4 and -6 options, and the format of the address.
Submitted by: Ján Sučan <sucanjan@gmail.com>
Sponsored by: Google LLC (Google Summer of Code 2019)
MFC after: Never
Differential Revision: https://reviews.freebsd.org/D21377
Alexander Motin [Thu, 26 Nov 2020 02:14:52 +0000 (02:14 +0000)]
Some minor FCoE bits I had lying around.
Alexander Motin [Thu, 26 Nov 2020 01:59:44 +0000 (01:59 +0000)]
Remove some more dead code from pre-24xx.
Ian Lepore [Thu, 26 Nov 2020 01:40:04 +0000 (01:40 +0000)]
Add the firmware blob required to use the sdma hardware in the imx6
processor, and its associated license text (which is similar to a
bsd-3-clause, but with a prohibition against decompiling). Install a copy
of the license in /usr/share/doc/legal/imx, to comply with the license terms
that requires a copy of the license to be delivered along with the firmware.
Obtained from: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/imx/sdma/sdma-imx6q.bin https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/LICENSE.sdma_firmware
Maxim Sobolev [Wed, 25 Nov 2020 23:19:01 +0000 (23:19 +0000)]
Unobfuscate "KERNLOAD" parameter on amd64. This change lines-up amd64 with the
i386 and the rest of supported architectures by defining KERNLOAD in the
vmparam.h and getting rid of magic constant in the linker script, which albeit
documented via comment but isn't programmatically accessible at a compile time.
Use KERNLOAD to eliminate another (matching) magic constant 100 lines down
inside unremarkable TU "copy.c" 3 levels deep in the EFI loader tree.
Reviewed by: markj
Approved by: markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D27355
John Baldwin [Wed, 25 Nov 2020 23:17:23 +0000 (23:17 +0000)]
Add a manpage for kernel TLS.
This subsumes some of the content from tcp(4) describing the socket
options but also adds additional notes.
Reviewed by: gallatin, hselasky
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27272
Mateusz Guzik [Wed, 25 Nov 2020 22:53:21 +0000 (22:53 +0000)]
pipe: follow up cleanup to previous
The commited patch was incomplete.
- add back missing goto retry, noted by jhb
- 'if (error)' -> 'if (error != 0)'
- consistently do:
if (error != 0)
break;
continue;
instead of:
if (error != 0)
break;
else
continue;
This adds some 'continue' uses which are not needed, but line up with the
rest of pipe_write.
Mateusz Guzik [Wed, 25 Nov 2020 21:41:23 +0000 (21:41 +0000)]
pipe: drop spurious pipeunlock/pipelock cycle on write
Bjoern A. Zeeb [Wed, 25 Nov 2020 20:58:01 +0000 (20:58 +0000)]
IPv6: set ifdisabled in the kernel rather than in rc
Enable ND6_IFF_IFDISABLED when the interface is created in the
kernel before return to user space.
This avoids a race when an interface is create by a program which
also calls ifconfig IF inet6 -ifdisabled and races with the
devd -> /etc/pccard_ether -> .. netif start IF -> ifdisabled
calls (the devd/rc framework disabling IPv6 again after the program
had enabled it already).
In case the global net.inet6.ip6.accept_rtadv was turned on,
we also default to enabling IPv6 on the interfaces, rather than
disabling them.
PR: 248172
Reported by: Gert Doering (gert greenie.muc.de)
Reviewed by: glebius (, phk)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27324
Ian Lepore [Wed, 25 Nov 2020 20:05:05 +0000 (20:05 +0000)]
Extend the imx6 gpc->gic interrupt controller fixup of fdt data at runtime
to work with the pmu and tempmon nodes as well as the soc node. This allows
interrupts to work on the pmu and tempmon devices even though we don't have
a driver for the low-power gpc interrupt controller (which is not a problem
because we also don't have support for entering deep power-down modes where
it gets used).
Ian Lepore [Wed, 25 Nov 2020 19:10:20 +0000 (19:10 +0000)]
Convert the imx6_snvs RTC driver to access registers via the syscon device.
This is required for it to work correctly in the GENERIC kernel.
Ian Lepore [Wed, 25 Nov 2020 19:08:22 +0000 (19:08 +0000)]
Add the standard extres pseudo devices to the IMX6 kernel config.
Some imx6 drivers are being converted to use features that weren't available
when they were first written (such as accessing shared device registers via
the syscon pseudo-device), so imx6 custom kernels that reference those
devices will now need this infrastructure in place.
Ian Lepore [Wed, 25 Nov 2020 18:09:01 +0000 (18:09 +0000)]
A couple small fixes for the imx6_sdma driver...
Attach after interrupt controllers, since the attach function tries to
set up an interrupt handler.
Check for the availability of the required firmware early in the attach
code (before allocating resources). If the firmware is not available, set
a static var to remember that, so that if the device is re-probed on later
passes it won't repeatedly try to attach and then complain again about
missing firmware.
Kristof Provost [Wed, 25 Nov 2020 17:15:24 +0000 (17:15 +0000)]
if: Fix non-VIMAGE build
if_link_ifnet() and if_unlink_ifnet() are needed even when VIMAGE is not
enabled.
MFC after: 2 weeks
Sponsored by: Modirum MDPay
Konstantin Belousov [Wed, 25 Nov 2020 17:12:21 +0000 (17:12 +0000)]
ffs_softdep.c: get_parent_vp(): Fix bp lock leak when inum inode was already freed.
Reported by: markj, pho
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Konstantin Belousov [Wed, 25 Nov 2020 17:04:26 +0000 (17:04 +0000)]
Use designated initializers for libc pthread stubs' jump table.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Pawel Biernacki [Wed, 25 Nov 2020 16:30:57 +0000 (16:30 +0000)]
libsysdecode: correctly decode mmap flags
r352913 added decoding of mmap PROT_MAX()'d flags but didn’t account for the
case where different values were specified for PROT_MAX and regular flags.
Fix it.
Submitted by: sigsys_gmail.com
Reported by: sigsys_gmail.com
MFC after: 7 days
Differential Revision: https://reviews.freebsd.org/D27312
Ian Lepore [Wed, 25 Nov 2020 15:45:20 +0000 (15:45 +0000)]
Only attach the ti_scm_syscon driver when running on a compatible TI chip.
This prevents attaching on non-TI systems in the GENERIC kernel.
Reviewed by: manu@, mmel@
Kristof Provost [Wed, 25 Nov 2020 15:07:22 +0000 (15:07 +0000)]
if: Protect V_ifnet in vnet_if_return()
When we terminate a vnet (i.e. jail) we move interfaces back to their home
vnet. We need to protect our access to the V_ifnet CK_LIST.
We could enter NET_EPOCH, but if_detach_internal() (called from if_vmove())
waits for net epoch callback completion. That's not possible from NET_EPOCH.
Instead, we take the IFNET_WLOCK, build a list of the interfaces that need to
move and, once we've released the lock, move them back to their home vnet.
We cannot hold the IFNET_WLOCK() during if_vmove(), because that results in a
LOR between ifnet_sx, in_multi_sx and iflib ctx lock.
Separate out moving the ifp into or out of V_ifnet, so we can hold the lock as
we do the list manipulation, but do not hold it as we if_vmove().
Reviewed by: melifaro
MFC after: 2 weeks
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D27279
Ed Maste [Wed, 25 Nov 2020 14:26:13 +0000 (14:26 +0000)]
clang: allow -fstack-clash-protection on FreeBSD
-fstack-clash-protection was added in Clang commit
e67cbac81211 but was
enabled only on Linux. It should work fine on FreeBSD as well, so
enable it.
To be discussed and upstreamed with a test. The OS test should probably
just be removed.
Reviewed by: dim
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27366
Emmanuel Vadot [Wed, 25 Nov 2020 11:21:03 +0000 (11:21 +0000)]
dtb: allwinner: Add pineh64 to the build
Emmanuel Vadot [Wed, 25 Nov 2020 11:20:04 +0000 (11:20 +0000)]
arm: allwinner: aw_rtc: Add H6 compatible
Emmanuel Vadot [Wed, 25 Nov 2020 11:19:42 +0000 (11:19 +0000)]
arm64: allwinner: H6: Fix pll 4x clocks
The clock configured by the registers are the 4x version not the 1x.
Kristof Provost [Wed, 25 Nov 2020 10:56:38 +0000 (10:56 +0000)]
if: Remove ifnet_rwlock
It no longer serves any purpose, as evidenced by the fact that we never take it
without ifnet_sxlock.
Sponsored by: Modirum MDPay
Differential Revision: https://reviews.freebsd.org/D27278
Benedict Reuschling [Wed, 25 Nov 2020 10:21:29 +0000 (10:21 +0000)]
Drop superfluous "of" from the systat example.
Kyle Evans [Wed, 25 Nov 2020 03:14:25 +0000 (03:14 +0000)]
kern: cpuset: properly rebase when attaching to a jail
The current logic is a fine choice for a system administrator modifying
process cpusets or a process creating a new cpuset(2), but not ideal for
processes attaching to a jail.
Currently, when a process attaches to a jail, it does exactly what any other
process does and loses any mask it might have applied in the process of
doing so because cpuset_setproc() is entirely based around the assumption
that non-anonymous cpusets in the process can be replaced with the new
parent set.
This approach slightly improves the jail attach integration by modifying
cpuset_setproc() callers to indicate if they should rebase their cpuset to
the indicated set or not (i.e. cpuset_setproc_update_set).
If we're rebasing and the process currently has a cpuset assigned that is
not the containing jail's root set, then we will now create a new base set
for it hanging off the jail's root with the existing mask applied instead of
using the jail's root set as the new base set.
Note that the common case will be that the process doesn't have a cpuset
within the jail root, but the system root can freely assign a cpuset from
a jail to a process outside of the jail with no restriction. We assume that
that may have happened or that it could happen due to a race when we drop
the proc lock, so we must recheck both within the loop to gather up
sufficient freed cpusets and after the loop.
To recap, here's how it worked before in all cases:
0 4 <-- jail 0 4 <-- jail / process
| |
1 -> 1
|
3 <-- process
Here's how it works now:
0 4 <-- jail 0 4 <-- jail
| | |
1 -> 1 5 <-- process
|
3 <-- process
or
0 4 <-- jail 0 4 <-- jail / process
| |
1 <-- process -> 1
More importantly, in both cases, the attaching process still retains the
mask it had prior to attaching or the attach fails with EDEADLK if it's
left with no CPUs to run on or the domain policy is incompatible. The
author of this patch considers this almost a security feature, because a MAC
policy could grant PRIV_JAIL_ATTACH to an unprivileged user that's
restricted to some subset of available CPUs the ability to attach to a jail,
which might lift the user's restrictions if they attach to a jail with a
wider mask.
In most cases, it's anticipated that admins will use this to be able to,
for example, `cpuset -c -l 1 jail -c path=/ command=/long/running/cmd`,
and avoid the need for contortions to spawn a command inside a jail with a
more limited cpuset than the jail.
Reviewed by: jamie
MFC after: 1 month (maybe)
Differential Revision: https://reviews.freebsd.org/D27298
Kyle Evans [Wed, 25 Nov 2020 02:12:24 +0000 (02:12 +0000)]
kern: cpuset: rename _cpuset_create() to cpuset_init()
cpuset_init() is better descriptor for what the function actually does. The
name was previously taken by a sysinit that setup cpuset_zero's mask
from all_cpus, it was removed in r331698 before stable/12 branched.
A comment referencing the removed sysinit has now also been removed, since
the setup previously done was moved into cpuset_thread0().
Suggested by: markj
MFC after: 1 week
Kyle Evans [Wed, 25 Nov 2020 01:42:32 +0000 (01:42 +0000)]
kern: cpuset: allow cpuset_create() to take an allocated *setp
Currently, it must always allocate a new set to be used for passing to
_cpuset_create, but it doesn't have to. This is purely kern_cpuset.c
internal and it's sparsely used, so just change it to use *setp if it's
not-NULL and modify the two consumers to pass in the address of a NULL
cpuset.
This paves the way for consumers that want the unr allocation without the
possibility of sleeping as long as they've done their due diligence to
ensure that the mask will properly apply atop the supplied parent
(i.e. avoiding the free_unr() in the last failure path).
Reviewed by: jamie, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27297
John Baldwin [Wed, 25 Nov 2020 01:31:00 +0000 (01:31 +0000)]
Remove uses of CRIOGET in OCF tests after r368005.
Pointy hat to: jhb
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27367
John Baldwin [Wed, 25 Nov 2020 01:09:58 +0000 (01:09 +0000)]
Remove a reference to CRIOGET missed in r368005.
Kyle Evans [Wed, 25 Nov 2020 01:08:57 +0000 (01:08 +0000)]
kern: never restart syscalls calling closefp(), e.g. close(2)
All paths leading into closefp() will either replace or remove the fd from
the filedesc table, and closefp() will call fo_close methods that can and do
currently sleep without regard for the possibility of an ERESTART. This can
be dangerous in multithreaded applications as another thread could have
opened another file in its place that is subsequently operated on upon
restart.
The following are seemingly the only ones that will pass back ERESTART
in-tree:
- sockets (SO_LINGER)
- fusefs
- nfsclient
Reviewed by: jilles, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27310
John Baldwin [Wed, 25 Nov 2020 00:10:54 +0000 (00:10 +0000)]
Remove the cloned file descriptors for /dev/crypto.
Crypto file descriptors were added in the original OCF import as a way
to provide per-open data (specifically the list of symmetric
sessions). However, this gives a bit of a confusing API where one has
to open /dev/crypto and then invoke an ioctl to obtain a second file
descriptor. This also does not match the API used with /dev/crypto on
other BSDs or with Linux's /dev/crypto driver.
Character devices have gained support for per-open data via cdevpriv
since OCF was imported, so use cdevpriv to simplify the userland API
by permitting ioctls directly on /dev/crypto descriptors.
To provide backwards compatibility, CRIOGET now opens another
/dev/crypto descriptor via kern_openat() rather than dup'ing the
existing file descriptor. This preserves prior semantics in case
CRIOGET is invoked multiple times on a single file descriptor.
Reviewed by: markj
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27302
John Baldwin [Tue, 24 Nov 2020 23:56:33 +0000 (23:56 +0000)]
Pull the check for VM ownership into ppt_find().
This reduces some code duplication. One behavior change is that
ppt_assign_device() will now only succeed if the device is unowned.
Previously, a device could be assigned to the same VM multiple times,
but each time it was assigned, the device's state was reset.
Reviewed by: markj, grehan
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27301
John Baldwin [Tue, 24 Nov 2020 23:18:52 +0000 (23:18 +0000)]
Honor the disabled setting for MSI-X interrupts for passthrough devices.
Add a new ioctl to disable all MSI-X interrupts for a PCI passthrough
device and invoke it if a write to the MSI-X capability registers
disables MSI-X. This avoids leaving MSI-X interrupts enabled on the
host if a guest device driver has disabled them (e.g. as part of
detaching a guest device driver).
This was found by Chelsio QA when testing that a Linux guest could
switch from MSI-X to MSI interrupts when using the cxgb4vf driver.
While here, explicitly fail requests to enable MSI on a passthrough
device if MSI-X is enabled and vice versa.
Reported by: Sony Arpita Das @ Chelsio
Reviewed by: grehan, markj
MFC after: 2 weeks
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27212
John Baldwin [Tue, 24 Nov 2020 22:52:12 +0000 (22:52 +0000)]
Correct entries for manpages removed in r359374.
Reported by: Yuri Pankov <yuripv@yuripv.dev>
Sponsored by: Chelsio Communications
Alexander Motin [Tue, 24 Nov 2020 22:43:27 +0000 (22:43 +0000)]
Remove more legacy of parallel SCSI.
Jung-uk Kim [Tue, 24 Nov 2020 22:10:33 +0000 (22:10 +0000)]
Remove support for SSLv3 from fetch(3).
Support for SSLv3 was already removed from OpenSSL (r361392).
Differential Revision: https://reviews.freebsd.org/D24947
Simon J. Gerraty [Tue, 24 Nov 2020 21:45:38 +0000 (21:45 +0000)]
Update dirdeps.mk et al to latest
Move some local tweaks to local.*.mk
Reviewed by: bdrewery
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27300
Jung-uk Kim [Tue, 24 Nov 2020 21:28:44 +0000 (21:28 +0000)]
Port rtsx(4) driver for Realtek SD card reader from OpenBSD.
This driver provides support for Realtek PCI SD card readers. It attaches
mmc(4) bus on card insertion and detaches it on card removal. It has been
tested with RTS5209, RTS5227, RTS5229, RTS522A, RTS525A and RTL8411B. It
should also work with RTS5249, RTL8402 and RTL8411.
PR: 204521
Submitted by: Henri Hennebert (hlh at restart dot be)
Reviewed by: imp, jkim
Differential Revision: https://reviews.freebsd.org/D26435
Jung-uk Kim [Tue, 24 Nov 2020 21:14:36 +0000 (21:14 +0000)]
Do not truncate the last character from serial number.
strlcpy() requires one more byte for the NULL character.
Submitted by: Henri Hennebert (hlh at restart dot be)
MFC after: 3 days
Emmanuel Vadot [Tue, 24 Nov 2020 17:53:13 +0000 (17:53 +0000)]
release: Merge the RPI2 and BEAGLEBONE image with the GENERICSD one
Both RPI2 and BEAGLEBONE are still popular and used arm boards.
Both u-boots can coexist as they are named differently and live in the
fat partition.
This leave us with only one image that can be used for both of those
boards and all the other ones supported by FreeBSD provided that you
install the correct u-boot on it.
Reviewed by: imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27283
Emmanuel Vadot [Tue, 24 Nov 2020 17:52:01 +0000 (17:52 +0000)]
Release: arm: Remove config for old boards
All those board are impossible to buy nowadays and could boot using the
GENERICSD image after putting the correct u-boot on them.
Reviewed by: imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27282
Emmanuel Vadot [Tue, 24 Nov 2020 17:51:10 +0000 (17:51 +0000)]
arm: Remove old amlogic support
Remove the port for aml8726.
Kernel config was removed in r346096 and this port was never migrated
to GENERIC.
It is also impossible to obtain such hardware nowadays.
Reviewed by: imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27281
Emmanuel Vadot [Tue, 24 Nov 2020 17:50:22 +0000 (17:50 +0000)]
arm: Remove old rockchip support
Remove the port for rk30xx.
Kernel config was removed in r346096 and this port was never migrated
to GENERIC.
It is also impossible to obtain such hardware nowadays and this code
don't provide anything beside booting.
Reviewed by: imp
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D27280
Alexander Motin [Tue, 24 Nov 2020 17:37:12 +0000 (17:37 +0000)]
Update RQSFLAG_* definitions.
Kristof Provost [Tue, 24 Nov 2020 17:32:49 +0000 (17:32 +0000)]
pf tests: provoke tag hashing panic
Attempt to provoke the panic fixed in r367987.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27350
Mark Johnston [Tue, 24 Nov 2020 17:13:08 +0000 (17:13 +0000)]
ata(4): Release the ioport resource if device initialization fails
PR: 251346
Submitted by: janm@transactionware.com
MFC after: 1 week
Mark Johnston [Tue, 24 Nov 2020 17:12:40 +0000 (17:12 +0000)]
ping(8): Improve parameter validation
- Use strtonum(3) to simplify bounds checking of numeric parameters.
- Fix bounds checking when filling out packet data in "sweep" mode.
PR: 239974, 239977, 239978
Reported by: Neeraj <neerajpal09@gmail.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25622
Mark Johnston [Tue, 24 Nov 2020 16:18:47 +0000 (16:18 +0000)]
pf: Make tag hashing more robust
tagname2tag() hashes the tag name before truncating it to 63 characters.
tag_unref() removes the tag from the name hash by computing the hash
over the truncated name. Ensure that both operations compute the same
hash for a given tag.
The larger issue is a lack of string validation in pf(4) ioctl handlers.
This is intended to be fixed with some future work, but an extra safety
belt in tagname2hashindex() is worthwhile regardless.
Reported by: syzbot+
a0988828aafb00de7d68@syzkaller.appspotmail.com
Reviewed by: kp
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27346
Alexander Motin [Tue, 24 Nov 2020 15:32:25 +0000 (15:32 +0000)]
Remove concept of mbox_sleep_ok.
It was broken by design and unused for years due to conflicts between
different threads, fighting for the same set of mailbox registers, not
designed for multiple requests at a time. So either request has to be
synchronous and spin under the lock, or it should be sent asynchronously
through the queues as Mailbox Command IOCB or some other way.
This removes any OS specifics from the wait code, so it can be inlined.
Alexander Motin [Tue, 24 Nov 2020 14:05:52 +0000 (14:05 +0000)]
Remove unneeded locking around xpt_bus_[de]register().
MFC after: 2 weeks
Emmanuel Vadot [Tue, 24 Nov 2020 14:05:35 +0000 (14:05 +0000)]
arm64: Check if we have a map before checking the flags
This fixes amdgpu on arm64 where linuxkpi is calling id_mapped
and we call might_bounce without a map.
Hans Petter Selasky [Tue, 24 Nov 2020 13:07:59 +0000 (13:07 +0000)]
Remove erradic assert after SVN r367149 in mlx5en(4).
The ratelimit tags may be shared, especially for unlimited TLS
traffic, and then the refcount is allowed to be greater than one
when freeing the send tag.
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
Cy Schubert [Tue, 24 Nov 2020 06:42:32 +0000 (06:42 +0000)]
Fix a typo in a comment.
MFC after: 3 days
Alexander Motin [Tue, 24 Nov 2020 04:16:49 +0000 (04:16 +0000)]
Implement request queue overflow protection.
Before this change in case of request queue overflow driver just froze the
device queue for 100ms to retry after. It was pretty bad for performance.
This change introduces SIM queue freezing when free space on the request
queue drops below 255 entries (worst case of maximum I/O size S/G list),
checking for a chance to release it on I/O completion. If the queue still
get overflowed somehow, the old mechanism is still in place, just with
delay reduced to 10ms.
With the earlier queue length increase overflows should not happen often,
but it is still easily reachable on synthetic tests.
Mateusz Guzik [Tue, 24 Nov 2020 03:49:37 +0000 (03:49 +0000)]
locks: push lock_delay_arg_init calls down
Minor cleanup to skip doing them when recursing on locks and so that
they can act on found lock value if need be.
Mateusz Guzik [Tue, 24 Nov 2020 03:48:44 +0000 (03:48 +0000)]
sx: drop spurious volatile keyword
Alan Somers [Tue, 24 Nov 2020 02:51:45 +0000 (02:51 +0000)]
ping6: update usage text after r365547
MFC after: 2 weeks
Warner Losh [Mon, 23 Nov 2020 18:37:19 +0000 (18:37 +0000)]
Prefer Em to Ar for emphasis
Em is better than Ar if all we want to do is underline the text.
Submitted by: yuripv@
Mateusz Guzik [Mon, 23 Nov 2020 18:27:21 +0000 (18:27 +0000)]
dtrace: stop using eventhandlers for the part compiled into the kernel
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D27311
Mateusz Guzik [Mon, 23 Nov 2020 18:26:47 +0000 (18:26 +0000)]
thread: stash domain id to work around vtophys problems on ppc64
Adding to zombie list can be perfomed by idle threads, which on ppc64 leads to
panics as it requires a sleepable lock.
Reported by: alfredo
Reviewed by: kib, markj
Fixes: r367842 ("thread: numa-aware zombie reaping")
Differential Revision: https://reviews.freebsd.org/D27288
Konstantin Belousov [Mon, 23 Nov 2020 18:18:16 +0000 (18:18 +0000)]
Linuxolator: Replace use of eventhandlers by sysent hooks.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D27309
Konstantin Belousov [Mon, 23 Nov 2020 17:29:25 +0000 (17:29 +0000)]
Provide ABI modules hooks for process exec/exit and thread exit.
Exec and exit are same as corresponding eventhandler hooks.
Thread exit hook is called somewhat earlier, while thread is still
owned by the process and enough context is available. Note that the
process lock is owned when the hook is called.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D27309
Gleb Popov [Mon, 23 Nov 2020 17:00:06 +0000 (17:00 +0000)]
bin/setfacl: Little refactoring, no functional change.
The acl_from_stat function accepts a stat_t * argument, but only uses its
st_mode field. There is no reason to pass the whole struct, so make it accept
a mode_t and rename the function to acl_from_mode.
Linux has non-standard acl_from_mode function in its libacl, so naming the
function this way may help discovering it during porting efforts.
Reviewed by: tsoome, markj
Approved by: markj
Differential Revision: https://reviews.freebsd.org/D27292
Edward Tomasz Napierala [Mon, 23 Nov 2020 14:30:27 +0000 (14:30 +0000)]
Replace paths in ctladm(8) examples with something sensible.
PR: 251181
Reviewed by: 0mp, rm, ygy
MFC after: 2 weeks
Sponsored by: EPSRC
Differential Revision: https://reviews.freebsd.org/D27249
Michal Meloun [Mon, 23 Nov 2020 14:30:22 +0000 (14:30 +0000)]
Ensure that the buffer is in nvme_single_map() mapped to single segment.
Not a functional change.
MFC after: 1 week
Edward Tomasz Napierala [Mon, 23 Nov 2020 14:26:59 +0000 (14:26 +0000)]
Assorted tweaks to hier(7): punctuation, some .Xr's, clarify wording.
Reviewed by: 0mp, bcr, imp
MFC after: 2 weeks
Sponsored by: EPSRC
Differential Revision: https://reviews.freebsd.org/D27248
Edward Tomasz Napierala [Mon, 23 Nov 2020 13:05:11 +0000 (13:05 +0000)]
Make sbp(4) use xpt_alloc_ccb/xpt_free_ccb instead of malloc/free.
Reviewed by: imp, mav
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26843
Edward Tomasz Napierala [Mon, 23 Nov 2020 13:02:23 +0000 (13:02 +0000)]
Make tws(4) use xpt_alloc_ccb()/xpt_free_ccb() instead of malloc/free.
Reviewed by: imp
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26841
Edward Tomasz Napierala [Mon, 23 Nov 2020 12:59:56 +0000 (12:59 +0000)]
Don't check return from xpt_alloc_ccb() for being NULL; since it's not
the _nowait wariant, it cannot fail.
Suggested by: mav
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Edward Tomasz Napierala [Mon, 23 Nov 2020 12:57:24 +0000 (12:57 +0000)]
Make hptmv(4) use xpt_alloc_ccb/xpt_free_ccb instead of malloc/free.
Reviewed by: imp, mav
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26842
Edward Tomasz Napierala [Mon, 23 Nov 2020 12:54:19 +0000 (12:54 +0000)]
smartpqi: don't bzero the new ccb; xpt_alloc_ccb_nowait() already does that.
Reviewed by: imp
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26838
Edward Tomasz Napierala [Mon, 23 Nov 2020 12:50:38 +0000 (12:50 +0000)]
arcmsr(4): don't bzero newly allocated ccb; xpt_alloc_ccb() already does that.
Reviewed by: delphij, imp, ching2048@areca.com.tw
Tested by: ching2048@areca.com.tw
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26840
Edward Tomasz Napierala [Mon, 23 Nov 2020 12:47:23 +0000 (12:47 +0000)]
Remove the 'wantparent' variable, unused since r145004.
Reviewed by: kib
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D27193
Michael Tuexen [Mon, 23 Nov 2020 10:13:56 +0000 (10:13 +0000)]
Fix two occurences of a typo in a comment introduced in r367530.
Reported by: lstewart@
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27148
Eitan Adler [Mon, 23 Nov 2020 04:39:29 +0000 (04:39 +0000)]
arcconfig: add callsign again
Problem
When using git-svn or other non-pure-svn tooling the original subversion
URL is not present. This causes arcanist/phabricator to be unable to
determine which repository is being modified.
Solution
Restore callsign to .arcconfig to enable exact repository matching even
with git-svn.
Reported By: jhb
Kyle Evans [Mon, 23 Nov 2020 02:49:53 +0000 (02:49 +0000)]
cpuset_setproc: use the appropriate parent for new anonymous sets
As far as I can tell, this has been the case since initially committed in
2008. cpuset_setproc is the executor of cpuset reassignment; note this
excerpt from the description:
* 1) Set is non-null. This reparents all anonymous sets to the provided
* set and replaces all non-anonymous td_cpusets with the provided set.
However, reviewing cpuset_setproc_setthread() for some jail related work
unearthed the error: if tdset was not anonymous, we were replacing it with
`set`. If it was anonymous, then we'd rebase it onto `set` (i.e. copy the
thread's mask over and AND it with `set`) but give the new anonymous set
the original tdset as the parent (i.e. the base of the set we're supposed to
be leaving behind).
The primary visible consequences were that:
1.) cpuset_getid() following such assignment returns the wrong result, the
setid that we left behind rather than the one we joined.
2.) When a process attached to the jail, the base set of any anonymous
threads was a set outside of the jail.
This was initially bundled in D27298, but it's a minor fix that's fairly
easy to verify the correctness of.
A test is included in D27307 ("badparent"), which demonstrates the issue
with, effectively:
osetid = cpuset_getid()
newsetid = cpuset()
cpuset_setaffinity(thread)
cpuset_setid(osetid)
cpuset_getid(thread) -> observe that it matches newsetid instead of osetid.
MFC after: 1 week
Kyle Evans [Mon, 23 Nov 2020 00:58:14 +0000 (00:58 +0000)]
freebsd32: take the _umtx_op struct definitions back
Providing these in freebsd32.h facilitates local testing/measuring of the
structs rather than forcing one to locally recreate them. Sanity checking
offsets/sizes remains in kern_umtx.c where these are typically used.
Kyle Evans [Mon, 23 Nov 2020 00:33:06 +0000 (00:33 +0000)]
kern: dup: do not assume oldfde is valid
oldfde may be invalidated if the table has grown due to the operation that
we're performing, either via fdalloc() or a direct fdgrowtable_exp().
This was technically OK before rS367927 because the old table remained valid
until the filedesc became unused, but now it may be freed immediately if
it's an unshared table in a single-threaded process, so it is no longer a
good assumption to make.
This fixes dup/dup2 invocations that grow the file table; in the initial
report, it manifested as a kernel panic in devel/gmake's configure script.
Reported by: Guy Yur <guyyur gmail com>
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D27319