Commit Graph

135733 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Konstantin Belousov
420d4be3e4 vm_map_protect(): remove not needed recalculations of new_prot, new_maxprot
Requested by:	alc
Sponsored by:	The FreeBSD Foundation
2021-01-14 10:02:43 +02:00
David E. O'Brien
9a01a25516 unifdef -D__FreeBSD__ to remove the OpenBSD support
OpenBSD never accepted this driver, and instead wrote their
own minimal one (sys/dev/acpi/tpm.c for suspending the device).

Reviewed by:    stevek, emaste
Differential Revision:  D10321
2021-01-13 22:35:22 -08:00
Glen Barber
7ae27c2d6c newvers.sh: set to ALPHA1 as part of the 13.0 cycle
Sponsored by:	Rubicon Communications, LLC (netgate.com)
2021-01-13 19:01:30 -05:00
Mitchell Horne
818390ce0c arm64: fix early devmap assertion
The purpose of this KASSERT is to ensure that we do not run out of space
in the early devmap. However, the devmap grew beyond its initial size of
2MB in r336519, and this assertion did not grow with it.

A devmap mapping of a 1080p framebuffer requires 1920x1080 bytes, or
1.977 MB, so it is just barely able to fit without triggering the
assertion, provided no other devices are mapped before it. With the
addition of `options GDB` in GENERIC by bbfa199cbc, the uart is now
mapped for the purposes of a debug port, before mapping the framebuffer.
The presence of both these conditions pushes the selected virtual
address just below the threshold, triggering the assertion.

To fix this, use the correct size of the devmap, defined by
PMAP_MAPDEV_EARLY_SIZE. Since this code is shared with RISC-V, define
it for that platform as well (although it is a different size).

PR:		25241
Reported by:	gbe
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2021-01-13 17:27:44 -04:00
John Baldwin
074a91f746 Enable accelerated AES-XTS software crypto in GENERIC.
In particular, using GELI on a root filesystem will only use
accelerated software crypto drivers if they are available before the
root filesystem is mounted.  While these modules can be loaded from
the loader, including them in GENERIC provides a better out-of-the-box
experience for users.

Both aesni(4) and armv8crypto(4) provide accelerated implementations
of the default cipher used by GELI (AES-XTS) in addition to other
ciphers.

Reviewed by:	mhorne, allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D28100
2021-01-13 13:13:01 -08:00
Kristof Provost
ea36212bf5 pf: Don't hold PF_RULES_WLOCK during copyin() on DIOCRCLRTSTATS
We cannot hold a non-sleepable lock during copyin(). This means we can't
safely count the table, so instead we fall back to the pf_ioctl_maxcount
used in other ioctls to protect against overly large requests.

Reported by:	syzbot+81e380344d4a6c37d78a@syzkaller.appspotmail.com
MFC after:	1 week
2021-01-13 19:49:42 +01:00
Emmanuel Vadot
6003bf9290 dwwdt: Add PNP info for the driver 2021-01-13 18:43:51 +01:00
Emmanuel Vadot
0a05676b44 Add driver for Synopsys Designware Watchdog timer.
This driver supports some arm and arm64 boards equipped with
"snps,dw-wdt"-compatible watchdog device.
Tested on RK3399-based board (RockPro64).
Once started watchdog device cannot be stopped.
Interrupt handler has mode to kick watchdog even when software does not do it
properly.
This can be controlled via sysctl: dev.dwwdt.prevent_restart.
Also - driver handles system shutdown and prevents from restart when system
is asked to reboot.

Submitted by:	kjopek@gmail.com
Differential Revision:	https://reviews.freebsd.org/D26761
2021-01-13 18:43:47 +01:00
Andrew Turner
63c858a04d Switch the arm64 pcpu to a global register variable
This removes an unneeded instruction to move the pointer from x18 to a
temporary register.

Reviewed by:	emaste
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D26971
2021-01-13 16:36:52 +00:00
Andrew Turner
594389d1de Create a stack frame when needed in the arm64 kernel
When building the arm64 kernel for use with dtrace or hwpmc we need
to include a stack frame so they can extract a stack trace.

As with amd64 also build a stack frame in modules.

Sponsored by:	Innovate UK
2021-01-13 16:36:52 +00:00
Konstantin Belousov
f9d85a0821 Revert "x86 busdma_bounce: do not make assumptions about alignment of malloc(9) results."
This reverts commit 8f54940f01.
The free needs to be called on the address returned by malloc,
not the realigned address.

Noted by:	andrew
Sponsored by:	The FreeBSD Foundation
2021-01-13 17:44:00 +02:00
Mateusz Guzik
ef23df1354 vfs: set NC_KEEPPOSENTRY alongside NOCACHE when creating a file
Arguably the entire NOCACHE logic should get retired, in the meantime
at least prevent the code from evicting existing entries.
2021-01-13 15:29:34 +00:00
Mateusz Guzik
5753be8e43 fd: add refcount argument to falloc_noinstall
This lets callers avoid atomic ops by initializing the count to required
value from the get go.

While here add falloc_abort to backpedal from this without having to
fdrop.
2021-01-13 15:29:34 +00:00
Konstantin Belousov
8f54940f01 x86 busdma_bounce: do not make assumptions about alignment of malloc(9) results.
Reported by:	dim
Reviewed by:	dim, jah
Tested by:	dim, pho
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28108
2021-01-13 17:00:49 +02:00
Konstantin Belousov
895ad33784 x86 budma_bounce: style.
Reviewed by:	dim, jah
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D28108
2021-01-13 17:00:46 +02:00
Hans Petter Selasky
f2a7b434b3 Variable declarations are since C99 and r363250 allowed inside for-loops.
Partial revert of bafb682656.

Suggested by:	mmel@
2021-01-13 12:30:41 +01:00
Edward Tomasz Napierala
ec2700e015 linux: mute the "unsupported prctl option 23" warnings
Make the PR_CAPBSET_READ prctl(2) return EINVAL without logging
any warnings; this is way too noisy with Focal.

Sponsored by:	The FreeBSD Foundation
2021-01-13 10:31:56 +00:00
Alexander V. Chernikov
a6b7689718 Remove redundant rtinit() calls from tuntap.
Removed code iterates over if_addrhead and tries to remove
 routes for each ifa.
This is exactly the thing that if_purgeaddrs() do, and
 if_purgeaddr() is already called in the end.

Reviewed by:		glebius
MFC after:		2 weeks
Differential revision:	https://reviews.freebsd.org/D28106
2021-01-13 10:03:15 +00:00
Alexander V. Chernikov
e58c8da068 Map IPv6 link-local prefix to the link-local ifa.
Currently we create link-local route by creating an always-on IPv6 prefix
 in the prefix list. This prefix is not tied to the link-local ifa.

This leads to the following problems:

First, when flushing interface addresses we skip on-link route, leaving
 fe80::/64 prefix on the interface without any IPv6 addresses.
Second, when creating and removing link-local alias we lose fe80::/64 prefix
 from the routing table.

Fix this by attaching link-local prefix to the ifa at the initial creation.

Reviewed by:	hrs
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D28129
2021-01-13 10:03:15 +00:00
Edward Tomasz Napierala
a339b4223a linux: bump the default version from 3.10.0 to 3.17.0
This is required for Qt5, as found in Ubuntu Focal.  The library contains
the minimum kernel version encoded in an ELF note; this makes rtld ignore
it altogether, with a confusing error message.  Without it, things fail
like this:

$ konsole: error while loading shared libraries: libQt5Core.so.5: cannot
open shared object file: No such file or directory

For reference, the Qt kernel version requirements can be found at:
https://github.com/qt/qtbase/blob/dev/src/corelib/global/minimum-linux_p.h

Sponsored by:	The FreeBSD Foundation
Reviewed By:	emaste
Differential Revision:	https://reviews.freebsd.org/D28105
2021-01-13 10:02:16 +00:00
Hans Petter Selasky
bafb682656 Fix for off-by-one in GPIO driver after r368585.
While at it declare the iteration variable outside the for-loop
to appease older compilers.

Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-01-13 10:06:30 +01:00