Commit Graph

255997 Commits

Author SHA1 Message Date
Kyle Evans
de661c9f86 bectl: tests: use -R <mount> instead of specifying altroot
-R is currently shorthand for cachefile=none, altroot=<mount>.  This is
functionally the same, but perhaps more resilient to future changes that
could be necessary that may be added when -R is specified.

MFC after:	 1 week
2021-01-16 00:07:50 -06:00
Kirk McKusick
79a5c790bd Eliminate a locking panic when cleaning up UFS snapshots after a
disk failure.

Each vnode has an embedded lock that controls access to its contents.
However vnodes describing a UFS snapshot all share a single snapshot
lock to coordinate their access and update. As part of mounting a
UFS filesystem with snapshots, each of the vnodes describing a
snapshot has its individual lock replaced with the snapshot lock.
When the filesystem is unmounted the vnode's original lock is
returned replacing the snapshot lock.

When a disk fails while the UFS filesystem it contains is still
mounted (for example when a thumb drive is removed) UFS forcibly
unmounts the filesystem. The loss of the drive causes the GEOM
subsystem to orphan the provider, but the consumer remains until
the filesystem has finished with the unmount. Information describing
the snapshot locks was being prematurely cleared during the orphaning
causing the return of the snapshot vnode's original locks to fail.
The fix is to not clear the needed information prematurely.

Sponsored by: Netflix
2021-01-15 16:36:42 -08:00
Kirk McKusick
173779b98f Eliminate lock order reversal in UFS when unmounting filesystems
with snapshots.

Each vnode has an embedded lock that controls access to its contents.
However vnodes describing a UFS snapshot all share a single snapshot
lock to coordinate their access and update.  As part of mounting a
UFS filesystem with snapshots, each of the vnodes describing a
snapshot has its individual lock replaced with the snapshot lock.
When the filesystem is unmounted the vnode's original lock is
returned replacing the snapshot lock.

The lock order reversal happens because vnode locks must be acquired
before snapshot locks. When unmounting we must lock both the snapshot
lock and the vnode lock before swapping them so that the vnode will
be continuously locked during the swap. For each vnode representing
a snapshot, we must first acquire the snapshot lock to ensure
exclusive access to it and its original lock.  We then face a lock
order reversal when we try to acquire the original vnode lock. The
problem is eliminated by doing a non-blocking exclusive lock on the
original lock which will always succeed since there are no users
of that lock.

Sponsored by: Netflix
2021-01-15 16:03:01 -08:00
Kyle Evans
994e1f40f6 lualoader: use floor division to get correct type
This fixes the positioning of the "Welcome to FreeBSD" heading, which was
misplaced after the recent update to Lua 5.4. The issue was previously
masked by a compatibility knob in Lua 5.3 that would cause float-tagged
numbers to render faithfully without the decimal component. Lua 5.4 dropped
that and ensures that it always prints a decimal component, even if it has
to append a ".0" to the value.

Standard division produces a "float", floor division (//) can be used to
guarantee an integer. Floating point operations have been completely ripped
out of the liblua compiled for the bootloader, so this is a nop. This is
decidedly better than trying to hack out the float tag entirely.

Reported-by:	mjg, probably others
MFC-after:	3 days
2021-01-15 15:02:38 -06:00
Mariusz Zaborski
c664d8dfc3 cat: Fix potential memory leak
This was introduced in aefe30c543.
2021-01-15 21:49:52 +01:00
Gleb Smirnoff
4f48fd7c56 Add 'tmp' to the list of FILESYSTEMS dependencies. Some scripts that
depend on FILESYSTEMS run mktemp(1).  For systems that have read-only
root this is broken until memory disk based /tmp is instantiated.  At
least 'os-release' and 'motd' are subject to this problem.

Reviewed by:		ngie
Differential Revision:	https://reviews.freebsd.org/D28097
2021-01-15 12:44:06 -08:00
Gleb Smirnoff
7e4eca7136 Revert 97ec6eba65. There shouldn't be a dependency of 'tmp' on
remote filesystems.  Discussed this with Brooks and he can't find
evidence that provoked the change in 2005.  If anything gets broken
I will fix it in a different way, not via rc sequence change.

Discussed with:		brooks
Reviewed by:		ngie
Differential Revision:	https://reviews.freebsd.org/D28097
2021-01-15 12:44:06 -08:00
Mariusz Zaborski
aefe30c543 cat: capsicumize it
Reviewed by:	markj, arichardson
Differential Revision:	https://reviews.freebsd.org/D28083
2021-01-15 21:23:42 +01:00
Andrew Turner
f64329bcdc Extract the logic from pmap_kextract
This allows us to use it when we only need to check if the virtual address
is valid. For example when checking if an address in the DMAP region is
mapped.

Reviewed by:	kib, markj
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D27621
2021-01-15 19:08:01 +00:00
Emmanuel Vadot
7c84a7405b Remove the old dts imported tree.
The new one is in sys/contrib/device-tree
2021-01-15 20:09:55 +01:00
Emmanuel Vadot
efdf807990 Switch to the new device-tree vendor tree
The old vendor tree was never fully merged and doing partial merge isn't
supported with git subtree merge so a new one was created.
Switch the build to use the new DTS from sys/contrib/device-tree
This also bump the DTS used to be in sync with Linux 5.9
While here change the way to get the linux version, simply hardcode
the value in sys/dts/freebsd-compatible.dts and use awk to get that
to put it in the CFLAGS.
As a bonus we now have the bindings docs available
in sys/contrib/device-tree/Bindings/ so no need to link to the Linux repo
or to the vendor tree.
2021-01-15 20:08:39 +01:00
Emmanuel Vadot
955b980bdf gpiokeys: Use the new device-tree vendor include 2021-01-15 20:07:24 +01:00
Emmanuel Vadot
c38fe8789a arm64: Directly use #include <dt-binding/...>
We have it in the includes path and this will help the transition to the
new device-tree import in sys/contrib
2021-01-15 20:07:19 +01:00
Emmanuel Vadot
19775aa7bc Re-apply f81b2b9a8a to the new device-tree import 2021-01-15 20:07:13 +01:00
Emmanuel Vadot
78abc9e2e6 Revert upstream commit 27c90e5e48d0
It changed the #pinctrl-cells value to be equal to 2 and the macro
that generates the values.
Based on the bindings docs a value of 2 is only acceptable if the node
used pinctrl-single,bits and not pinctrl-single,pins

This allow booting further on the beaglebone black with 5.9 DTS
2021-01-15 20:07:08 +01:00
Mitchell Horne
0b92d1dd18 riscv: fix kernel build
A more complete fix for this function is being worked on in D28054. Fix
the uninitialized variable error so that builds can at least proceed.

Reported by:	several
2021-01-15 11:57:04 -04:00
Alexander Motin
510cc42126 Unify Intel CODEC naming.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2021-01-15 09:56:15 -05:00
Alexander Motin
006e2b2b82 Add Intel Gemini Lake AHCI ID.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2021-01-15 09:53:35 -05:00
Emmanuel Vadot
8a7a4683b0 arm: arm64: Directly use #include <dt-binding/...>
We have it in the includes path and this will help the transition to the
new device-tree import in sys/contrib
2021-01-15 14:17:03 +01:00
Emmanuel Vadot
58e169ab14 arm64: Add the dts include directory to the includes dir
We do that for arm so we can directly #include <dt-bindings/...>
2021-01-15 14:15:31 +01:00
Toomas Soome
0974bfa3a8 loader: do not update palette in text mode (real fix)
Apparently palette update while in text mode, will cause
some adapters to end up with blank display. Previous update had
condition reversed.
2021-01-15 15:43:14 +02:00
Emmanuel Vadot
c66ec88fed Add 'sys/contrib/device-tree/' from commit '5ee353c36d3c9c7f63df7c7671875e73fba70958'
git-subtree-dir: sys/contrib/device-tree
git-subtree-mainline: 94611a8388
git-subtree-split: 5ee353c36d
2021-01-15 12:28:57 +01:00
Andrew Turner
94611a8388 Add missing no-ctfconvert to C generation rules
Stop running ctfconvert over generated C files in the kernel by marking
them with no-ctfconvert.

This fixes warnings from ctfconvert trying to parse C files:

ctfconvert: file.c: Couldn't read ehdr: Invalid argument

Reviewed by:	emaste, mmel
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D28156
2021-01-15 09:41:41 +00:00
Simon J. Gerraty
b14cfecbf0 pkgfs_open: follow symlinks
Caller is not interested in symlinks follow them.
Throw an error if too many links encountered.

Reviewed by:	stevek
Sponsored by:	Juniper Networks
--This line, and those below, will be ignored--
> Description of fields to fill in above:                     76 columns --|
> PR:                       If a GNATS PR is affected by the change.
> Differential Revision:    https://reviews.freebsd.org/D### (*full* phabric URL needed).
> Submitted by:             If someone else sent in the change.
> Reviewed by:              If someone else reviewed your modification.
> Approved by:              If you needed approval for this commit.
> Obtained from:            If the change is from a third party.
> MFC after:                N [day[s]|week[s]|month[s]].  Request a reminder email.
> MFH:                      Ports tree branch name.  Request approval for merge.
> Relnotes:                 Set to 'yes' for mention in release notes.
> Security:                 Vulnerability reference (one per line) or description.
> Sponsored by:             If the change was sponsored by an organization.
> Empty fields above will be automatically removed.

Change-Id: I4ef92ff256f503c620dc5bba79ed93b32cb2330d
2021-01-14 17:33:05 -08:00
Warner Losh
d1949353e5 uart: Improve console specification parsing
Print warning when we can't parse a console specification (this may
not appear on the console, but will appear in dmesg).

Also, accept key:value and key=value. There's no reason not to
and it makes this more forgiving of mistakes.

Reviewed by: rpokala@
Differential Revision: https://reviews.freebsd.org/D28168
2021-01-14 17:47:04 -07:00
Ed Maste
8818758a6e RELNOTES: correct elfctl(1) man page section 2021-01-14 16:45:58 -05:00
John Baldwin
4b27f60435 Note aesni/armv8crypto in GENERIC, W^X, and AES-XTS for armv8crypto. 2021-01-14 12:59:37 -08:00
Dimitry Andric
39b7445e15 Merge llvm-project llvmorg-11.0.1-0-g43ff75f2c3f (aka 11.0.1 release)
There were no functional changes after 11.0.1 rc2, so only the version
strings changed.

MFC after:      4 weeks
X-MFC-With:     r364284
2021-01-14 21:46:44 +01:00
Ed Maste
c763f99d11 elfctl: prefix disable flags with "no"
Some ELF feature flags indicate a request to opt-out of some feature,
for example NT_FREEBSD_FCTL_ASLR_DISABLE indicates that ASLR should be
disabled for the tagged binary.  Using "aslr" as the short name for the
flag is confusing as it seems to indicate a request for ASLR to be
enabled.  Rename "noaslr", and make a similar change for other opt-out
flags.

Reviewed by:	bapt, manu, markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28139
2021-01-14 15:09:13 -05:00
Ed Maste
3dfcb70b6a elfctl: add backwards compatibility for "no" prefixes
I am going to prefix opt-out ELF feature flag names with "no" to make
their meaning more clear (review D28139), but there are some uses of the
existing names already (e.g., the PR referenced below).

For now accept the older, unprefixed name as well, and emit a warning.
We can revert this after FreeBSD 13 branches.

% elfctl -e +aslr foo
elfctl: interpreting aslr as noaslr; please specify noaslr

PR:		239873 (related)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28140
2021-01-14 15:09:08 -05:00
Vladimir Kondratyev
b360682ac9 hid: Add missing input enter/exit epoch pairs.
This was affecting unloading keyboard driver and kdb-related code.
2021-01-14 23:04:47 +03:00
Vladimir Kondratyev
b62f6dfaed hid: Replace USBHID_ENABLED kernel config option with loader tunable
usbhid(4) is disabled by default to avoid conflicts with existing USB HID
drivers. To enable it place following lines to /boot/loader.conf:

hw.usb.usbhid.enable=1
usbhid_load="YES"

Suggested by:	jhb
Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D28124
2021-01-14 23:04:47 +03:00
Michael Tuexen
d2b3ceddcc tcp: add sysctl to tolerate TCP segments missing timestamps
When timestamp support has been negotiated, TCP segements received
without a timestamp should be discarded. However, there are broken
TCP implementations (for example, stacks used by Omniswitch 63xx and
64xx models), which send TCP segments without timestamps although
they negotiated timestamp support.
This patch adds a sysctl variable which tolerates such TCP segments
and allows to interoperate with broken stacks.

Reviewed by:		jtl@, rscheff@
Differential Revision:	https://reviews.freebsd.org/D28142
Sponsored by:		Netflix, Inc.
PR:			252449
MFC after:		1 week
2021-01-14 19:28:25 +01:00
Mateusz Piotrowski
54c743e5b2 Fix a typo
"and" is not a flag.

MFC after:	3 days
2021-01-14 19:12:55 +01:00
Andrew Turner
6eebda3bba Split out the NODEBUG options to a common file
This is the superset of the nooptions found in the -DEBUG kernels.

Reviewed by:	emaste, manu
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D28152
2021-01-14 16:57:53 +00:00
Mark Johnston
6483fc224b qat: Free counters during detach
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-14 11:41:28 -05:00
Mark Johnston
a33b29a044 qat: Count request allocation failures
This can be useful for troubleshooting performance problems.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-14 11:41:28 -05:00
Mark Johnston
95ee7d9b87 qat: Fix DH895XCC firmware module autoloading
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC (Netgate)
2021-01-14 11:41:28 -05:00
Mark Johnston
e3d06599bc libifconfig: Add a symbol map
This is a no-op for now since libifconfig is only built as a static lib.

Reviewed by:	freqlabs, kp, adrian
Differential Revision:	https://reviews.freebsd.org/D28119
2021-01-14 11:41:28 -05:00
Mark Johnston
90cc8706cc iwm(4): Add support for Intel Killer(R) Wireless-AC 1550i
PR:		252578
Submitted by:	shu <ankohuu@outlook.com>
MFC after:	1 week
2021-01-14 11:41:28 -05:00
Roger Pau Monné
a67522b22d gitignore: expand list of ignored files
Add the *.swp and *~ pattern for vim temporary files. Expand the
cscope ones to include all files possibly generated by cscope and also
add some known object formats.

Also remove the leading '?' from cscope.out, or else it doesn't match
the cscope.out file generated by default (as it expects an extra
character in front).

Reviewed by:		gjb, uqs, lwhsu
Sponsored by:		Citrix Systems R&D
Differential Revision:	https://reviews.freebsd.org/D28095
2021-01-14 17:03:57 +01:00
Emmanuel Vadot
5ee353c36d Import device tree files from Linux 5.9 2021-01-14 16:25:07 +01:00
Mateusz Guzik
37bd3aa6fa amd64: use builtins for all ffs* variants
While here even up whitespace.
2021-01-14 14:37:22 +00:00
Michael Tuexen
cc3c34859e tcp: fix handling of TCP RST segments missing timestamps
A TCP RST segment should be processed even it is missing TCP
timestamps.

Reported by:		dmgk@, kevans@
Reviewed by:		rscheff@, dmgk@
Sponsored by:		Netflix, Inc.
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D28143
2021-01-14 14:39:35 +01:00
Emmanuel Vadot
03cab14ea3 Revert "pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases"
This reverts commit aef769614f.

While the package names are a bit prettier this confuse pkg about upgrading :
$ pkg version -t 13.0.s2021011313063 13.0.a1
>
$ pkg version -t 13.0.s2021011313063 13.0_ALPHA1
<

Note that the current scheme isn't good when bumping from ALPHA to BETA or
even BETA to RC:
$ pkg version -t 13.0_ALPHA1 13.0_BETA1
=
$ pkg version -t 13.0_BETA1 13.0_RC1
=

But more thoughts have to be put into this renaming.
2021-01-14 14:15:05 +01:00
Emmanuel Vadot
aef769614f pkgbase: differentiate package versions for ALPHA/BETA/PRERELEASE/RC phases
The current postfix conversions are:

    CURRENT / STABLE -> .sYYYYMMDDhhmmss
    ALPHAx -> .ax, so 11.3-ALPHA1 becomes 11.3.a1
    BETAx -> .bx, so 12.1-BETA2 becomes 12.1.b2
    RCx -> .rcx, so 13.0-RC3 becomes 13.0.rc3
    PRERELEASE -> .p, so 11.3-PRERELEASE becomes 11.3.p
    RELEASE -> (nothing), so 12.1-RELEASE becomes 12.1

Submitted by: rene (original version)
Differential Revision: https://reviews.freebsd.org/D20734
2021-01-14 14:00:04 +01:00
Konstantin Belousov
2d1e4220eb tmpfs_reclaim: detach unlinked node on dereferencing.
Otherwise it is dereferenced one extra time at unmount, if it survives
long enough.  One way to hold the reference on such node is to keep it
open.

tmpfs_vptocnp() now needs to account for the possibility that unlocked
node was removed from the list.

Reported by:	danfe
Tested by:	danfe, pho
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-01-14 14:51:37 +02:00
Konstantin Belousov
685265ecfb tmpfs_reclaim: style
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2021-01-14 14:43:13 +02:00
Hans Petter Selasky
e47a6525e7 Add missing init of new fields after new UAR API was introduced
by f8f5b459d2 in mlx5ib.

MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
2021-01-14 11:44:54 +01:00
Edward Tomasz Napierala
feb96ee9c8 linux: mute "unsupported socket(AF_NETLINK, 3, NETLINK_AUDIT)" warnings
They are way too noisy with Focal.

Sponsored by:	The FreeBSD Foundation
2021-01-14 09:16:28 +00:00