Commit Graph

280784 Commits

Author SHA1 Message Date
Mitchell Horne
52f9a2823c rtalloc.9: remove obsolete man page
This KPI was removed in d223372545. Note that there are a handful of
references remaining in the src tree to these rtalloc functions that
could be cleaned up by someone with more domain knowledge.

Reviewed by:	pauamma (manpages), glebius, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38188
2023-01-27 18:01:47 -04:00
Mitchell Horne
d1c7405ef6 PCBGROUP.9: remove obsolete man page
The PCBGROUP option and KPI were removed entirely in 93c67567e0.

Reviewed by:	pauamma (manpages), glebius, melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38187
2023-01-27 18:01:47 -04:00
John Baldwin
370110fd57 universe: Switch GCC toolchains to GCC 12.
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D38230
2023-01-27 13:35:13 -08:00
Jean-Sébastien Pédron
3d751b7a71
linuxkpi: Add pin_user_pages*() functions
They were defined in the i915 DRM driver. I move the code in linuxkpi so
it can benefit other drivers.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38078
2023-01-27 21:54:39 +01:00
Jean-Sébastien Pédron
3e0856b63f
linuxkpi: Fix sg_alloc_table_from_pages() to have the same API as Linux
It now returns a `struct scatterlist *` pointer instead of an error
code only.

The implementation is incomplete because it doesn't use the `prv`
argument.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38077
2023-01-27 21:53:59 +01:00
Jean-Sébastien Pédron
8c46bd9f86
linuxkpi: Include linux/sched/mm.h from linux/sched.h
At least one file in the DRM drivers benefits from some namespace
pollution to use `fs_reclaim_acquire()`/`fs_reclaim_release()`. They are
defined in `linux/sched/mm.h` and this header must be included
indirectly into the DRM drivers' source file.

I couldn't find how it was included. Therefore this commit includes
`linux/sched/mm.h` from `linux/sched.h`. This is not the case in Linux
but fixes the issue with the DRM drivers.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D37912
2023-01-27 21:53:44 +01:00
Ed Maste
e7f9bdb4a6 Cirrus-CI: switch GCC job to GCC 12
We need a C++20 or later compiler.

Sponsored by:	The FreeBSD Foundation
2023-01-27 15:02:34 -05:00
Mark Johnston
96bc40f4df release.7: Correct a variable name
MFC after:	1 week
2023-01-27 14:01:12 -05:00
Emmanuel Vadot
04afa8cc37 loader: md: Use default func for fmtdev and parsedev
The default function are enough for md so use them instead of the
disks ones that doesn't work for it anymore.

Reviewed by:	imp
Sponsored by:	Beckhoff Automation GmbH & Co. KG
MFC after:	now
Differential Revision:	https://reviews.freebsd.org/D38218
2023-01-27 19:06:25 +01:00
Alexander V. Chernikov
79111aa26f netstat: fix format string on 32-bit archs 2023-01-27 17:45:49 +00:00
Konstantin Belousov
153643a5bc amd64: do not enable PKRU if user disabled saving PKRU register in xsave mask
This is done by reverting CR4_PKE bit, because we perform %CR4
initialization in initializecpu(), and the function is called before
xsave_mask is read.  To not redo the whole early initialization
sequence for the corner case, this should be good enough.

Reported by:	jhb
Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38219
2023-01-27 19:44:49 +02:00
Konstantin Belousov
11989314dc x86: add more definitions for XCR0 bits
This covers all currently defined bits, adding PKRU and TILE.

Reviewed by:	jhb, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D38219
2023-01-27 19:44:49 +02:00
John Baldwin
9501683925 Revert "Don't omit bsd.compiler.mk for the nested delete-old in buildworld."
The original motivation (src.opts.mk needing bsd.comppiler.mk to
determine if CXX is supported) is no longer relevant now that CXX is
non-optional.

This reverts commit b9cb80883b.
2023-01-27 09:41:47 -08:00
Allan Jude
5ff13fbc19 MFV: zstd 1.5.2
Merge commit 'b3392d84da5bf2162baf937c77e0557f3fd8a52b' into zstd_1.5.2

full changelog: https://github.com/facebook/zstd/compare/v1.4.8...v1.5.2

Updated sys/kern/subr_compressor.c to new API

MFC after:	3 days
Relnotes:	yes
Sponsored by:	Klara, Inc.
2023-01-27 17:22:31 +00:00
Alexander V. Chernikov
68636dcb6f netstat: make netstat -rn use netlink instead of rtsock
This change switches route listing in netstat to netlink, with fallback to rtsock.
The outputs are mostly identical, with an exception of not showing kernel
 nexthop indexes for multipath routes.

Differential Revision: https://reviews.freebsd.org/D36529
2023-01-27 15:36:10 +00:00
Bjoern A. Zeeb
68b1d16250 LinuxKPI: linux_pci.c: fix whitespace
Properly indent a line.  No functional change.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-01-27 15:27:42 +00:00
Gleb Smirnoff
f394d9c0a4 sysctl: use correct types and names in sysctl_*sec_to_sbintime
The functions are intended to report kernel variables that are
stored as sbintime_t (pointed to by arg1) as human readable
nanoseconds or milliseconds (reported via sysctl_handle_64).
The variable types and names were reversed.  I guess there is
no functional change here, as all types flipped around were
signed 64.  Note that these function aren't used yet anywhere
in the kernel.

Reviewed by:		mav
Differential revision:	https://reviews.freebsd.org/D38217
2023-01-27 07:09:22 -08:00
Emmanuel Vadot
cc9b2b58e2 Revert "rc.d: Put growfs script in FreeBSD-ufs"
The growfs script also support zfs.

This reverts commit 36a7fa1e16.

Reported by:	emaste, Mina Galić
2023-01-27 11:30:24 +01:00
Emmanuel Vadot
a6a21bbedc rc.d: Put resolv script in FreeBSD-resolvconf
Differential Revision:	https://reviews.freebsd.org/D37190
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
36a7fa1e16 rc.d: Put growfs script in FreeBSD-ufs
Differential Revision:	https://reviews.freebsd.org/D37189
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
91314ca2ff rc.d: Put ggated script in FreeBSD-ggate
Differential Revision:	https://reviews.freebsd.org/D37188
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
81b18bea09 rc.d: Put dhclient script in FreeBSD-dhclient
Differential Revision:	https://reviews.freebsd.org/D37187
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
d8799160c2 rc.d: Put devmatch script in FreeBSD-devmatch
Differential Revision:	https://reviews.freebsd.org/D37192
2023-01-27 10:35:32 +01:00
Emmanuel Vadot
f043569692 rc.d: Put devd script in FreeBSD-devd package
Differential Revision:	https://reviews.freebsd.org/D37186
2023-01-27 10:35:32 +01:00
Ed Maste
ac4c695ad6 Retire WITHOUT_CXX option
Several important base system components are written in C++, and the
WITHOUT_CXX option produced a system that was not fully functional.
Just accept this, and remove the option to build without C++ support.

This reverts commit adc3c128c6.

Reviewed by:	brooks, kevans, jhb (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33108
2023-01-26 21:13:16 -05:00
John Baldwin
9d2f979817 <sys/cdefs.h>: Decay expression passed to fallback version of __generic()
This ensures that __generic() more closely matches _Generic() when
using the fallback version when _Generic() is not available (such as
GCC).

Co-authored by:	jrtc27
Reviewed by:	jrtc27
Differential Revision:	https://reviews.freebsd.org/D38215
2023-01-26 16:28:22 -08:00
John Baldwin
e5dc40935f Revert "stdlib.h: Fix qsort_r compatibility with GCC 12."
This reverts commit 43703bc489.

Reviewed by:	jrtc27
Differential Revision:	https://reviews.freebsd.org/D38216
2023-01-26 16:28:03 -08:00
Michael Tuexen
e2d14a04c5 tcp: improve error handling of net.inet.tcp.udp_tunneling_port
In case the new port can't be set, set the port to 0.

MFC after:	3 days
Sponsored by:	Netflix, Inc.
2023-01-26 22:55:22 +01:00
Gleb Smirnoff
d3acb974b4 tcp: protect TCP over UDP configuration with a lock
The sysctl modifies global sockets without any locks.  The removed
comment suggests that previously it relied on a lock that doesn't
exist today.
2023-01-26 10:16:32 -08:00
Gleb Smirnoff
5c67f7c43e udp: don't forget to initialize udpcb for UDPv6
Reported by:	tuexen
Fixes:		483fe96511
2023-01-26 10:16:32 -08:00
Ed Maste
ec96506307 lua: reduce diffs between luaconf.h copies
Upstream luaconf.h is contrib/lua/src/luaconf.h.dist, while userland lua
and loader lua have copies in lib/liblua/luaconf.h and
stand/liblua/luaconf.h.

Adjust whitespace, VCS tags, etc. to match upstream's version, for ease
of comparison.

Reviewed By:	imp
Sponsored By:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38206
2023-01-26 12:38:19 -05:00
Richard Scheffenegger
18b83b626a tcp: reduce the size of t_rttupdated in tcpcb
During tcp session start, various mechanisms need to
track a few initial RTTs before becoming active.
Prevent overflows of the corresponding tracking counter
and reduce the size of tcpcb simultaneously.

Reviewed By:		#transport, tuexen, guest-ccui
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D21117
2023-01-26 18:08:00 +01:00
Mark Johnston
7a78ae8865 netlink: Zero-initialize writer structures allocated on the stack
The prevailing pattern seems to be to simply initialize all fields to
zero.  Without this, it's possible to trigger a branch on uninitialized
memory, specifically, when testing nw->ignore_limit in
nlmsg_refill_buffer().

Initialize the writer structure in a couple of functions where this is
necessary.

Reported by:	KMSAN
Reviewed by:	melifaro
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38213
2023-01-26 10:46:19 -05:00
Bjoern A. Zeeb
0d0ca120a7 LinuxKPI: pci.h move function declaration to top of file.
No functional changes.

X-MFC-with:	49b6d5ed14
Sponsored by:	The FreeBSD Foundation
2023-01-26 14:33:31 +00:00
Kirk McKusick
0bd4c448ec Rewrite to avoid Coverity false positive.
MFC after:    1 week
Reported by:  Coverity (CID 1502669)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37907
2023-01-25 16:57:26 -08:00
Jean-Sébastien Pédron
a04aa80e77
lindebugfs: Add debugfs_create_file_size()
This is the same as `debugfs_create_file()` but takes the initial size
of the file. In FreeBSD, the given size is ignored and
`debugfs_create_file()` is called.

Reviewed by:	emaste, manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D37914
2023-01-25 23:23:16 +01:00
Jean-Sébastien Pédron
66cc55a041
linuxkpi: Define PCI_STD_NUM_BARS in <linux/pci.h>
Reviewed by:	emaste, manu
Approved by:	emaste, manu
Differential Revision:	https://reviews.freebsd.org/D38162
2023-01-25 22:57:32 +01:00
Jean-Sébastien Pédron
ccd31b4645
linuxkpi: Define pm_suspend_target_state in <linux/suspend.h>
It is set to `PM_SUSPEND_ON`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38161
2023-01-25 22:57:21 +01:00
Jean-Sébastien Pédron
4152ce2139
linuxkpi: Add msix_cap to struct pci_dev
At the same time, define `PCI_MSIX_FLAGS`and `PCI_MSIX_FLAGS_ENABLE`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38160
2023-01-25 22:57:08 +01:00
Jean-Sébastien Pédron
e64afbc215
linuxkpi: Add sysfs_emit_at() in <linux/sysfs.h>
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38159
2023-01-25 22:56:56 +01:00
Jean-Sébastien Pédron
47877d61af
linuxkpi: Define is_cow_mapping(flags) as false
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38158
2023-01-25 22:56:40 +01:00
Jean-Sébastien Pédron
3d47e3bf7b
linuxkpi: Include <linux/vmalloc.h> from <linux/pagemap.h>
I'm not sure this is correct, but it gives access to the definition of
`PAGE_KERNEL` in `ttm_tt.c` in the DRM drivers.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38154
2023-01-25 22:50:52 +01:00
Jean-Sébastien Pédron
b34cd67243
linuxkpi: Add seqcount_ww_mutex_t in <linux/seqlock.h>
It is defined as a synonymous to `seqcount_mutex_t`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38152
2023-01-25 22:50:38 +01:00
Jean-Sébastien Pédron
d9f1cb6774
linuxkpi: Define DEFINE_WD_CLASS(name) in <linux/ww_mutex.h>
It is defined as a synonymous to `DEFINE_WW_CLASS(name)`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38151
2023-01-25 22:50:27 +01:00
Jean-Sébastien Pédron
04cbeeb597
linuxkpi: Adds more SZ_* macros
`SZ_2K` and `SZ_1G` were defined in irdma. They are removed from this
driver.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38150
2023-01-25 22:50:07 +01:00
Jean-Sébastien Pédron
f27b1399d6
linuxkpi: Define ENOKEY to 126.
This is the same error code as Linux. This value is unused on FreeBSD.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38149
2023-01-25 22:49:53 +01:00
Jean-Sébastien Pédron
49b6d5ed14
linuxkpi: Add pci_device_is_present()
This calls bus_child_present(9) internally.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38148
2023-01-25 22:49:38 +01:00
Jean-Sébastien Pédron
bbff0400c1
linuxkpi: Define dev_dbg_ratelimited()
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38145
2023-01-25 22:48:32 +01:00
Jean-Sébastien Pédron
29ab194554
vt(4): Return errors from vt_{,de}allocate()
This is useful to the DRM drivers to let them know if a device is
effectively used by the console.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38089
2023-01-25 22:26:57 +01:00
Jean-Sébastien Pédron
9491ea7c68
linuxkpi: Fix atomic_long_sub() overflow
By (ab)using `atomic_long_add_return()`, `atomic_long_sub()` was making
the atomic long overflow. Indeed the underlying FreeBSD atomic is based
on an unsigned long.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38090
2023-01-25 22:26:54 +01:00