Commit graph

280757 commits

Author SHA1 Message Date
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
Jean-Sébastien Pédron b99bc86232
linuxkpi: Add io_mapping_map_user() and remap_pfn_range()
The code comes from the i915 DRM driver.

In Linux commits b739f125e4ebd73d10ed30a856574e13649119ed and
b12d691ea5e01db42ccf3b4207e57cb3ce7cfe91 (Linux 5.13), the i915 DRM
driver dropped specific implementations to use Linux generic functions.
Therefore I moved the FreeBSD code from that i915 driver to linuxkpi.

However, these commits were later reverted (also in Linux 5.13) so the
i915 driver doesn't use these functions. But perhaps it will help in the
future.

To sum up, the code comes from the i915 DRM driver but it doesn't use it
(i.e. it continues to use its internal implementation).

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38088
2023-01-25 22:26:54 +01:00
Jean-Sébastien Pédron 4fee6659c4
linuxkpi: Add sysfs_emit()
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38086
2023-01-25 22:26:54 +01:00
Jean-Sébastien Pédron 0d4d9ee6f0
linuxkpi: Add complete field to struct dev_pm_ops
This change breaks the KBI.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38085
2023-01-25 22:26:54 +01:00
Jean-Sébastien Pédron 270a133480
linuxkpi: Add pm_suspend_via_firmware()
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38084
2023-01-25 22:26:53 +01:00
Jean-Sébastien Pédron 710c6084d1
linuxkpi: Add pm_runtime_suspended()
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38083
2023-01-25 22:26:53 +01:00
Jean-Sébastien Pédron 2272ccaa68
linuxkpi: Define tasklet_unlock_spin_wait() as tasklet_unlock_wait()
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38080
2023-01-25 22:26:53 +01:00
Jean-Sébastien Pédron a609ed7959
linuxkpi: Define synchronize_hardirq()
It currently does the same as `synchronize_irq()`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38079
2023-01-25 22:26:53 +01:00
Jean-Sébastien Pédron 976aa07a88
lindebugfs: Add missing debugfs_create_u*() and debugfs_create_x*()
The `debugfs_create_x*()` variants are the same as their
`debugfs_create_u*()` equivalent, but they work with lowercase
hexadecimal.

While here, fix a few style(9) issues.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D38087
2023-01-25 22:26:52 +01:00
Jean-Sébastien Pédron f2044a3030
lindebugfs: Add debugfs_create_atomic_t()
Reviewed by:	jfree
Approved by:	jfree
Differential Revision:	https://reviews.freebsd.org/D37915
2023-01-25 22:26:32 +01:00
Martin Matuska 15f0b8c309 zfs: merge openzfs/zfs@9cd71c860 (master)
Notable upstream pull request merges:
  #13805 Configure zed's diagnosis engine with vdev properties
  #14110 zfs list: Allow more fields in ZFS_ITER_SIMPLE mode
  #14121 Batch enqueue/dequeue for bqueue
  #14123 arc_read()/arc_access() refactoring and cleanup
  #14159 Bypass metaslab throttle for removal allocations
  #14243 Implement uncached prefetch
  #14251 Cache dbuf_hash() calculation
  #14253 Allow reciever to override encryption property in case of replication
  #14254 Restrict visibility of per-dataset kstats inside FreeBSD jails
  #14255 Zero end of embedded block buffer in dump_write_embedded()
  #14263 Cleanups identified by CodeQL and Coverity
  #14264 Miscellaneous fixes
  #14272 Change ZEVENT_POOL_GUID to ZEVENT_POOL to display pool names
  #14287 FreeBSD: Remove stray debug printf
  #14288 Colorize zfs diff output
  #14289 deadlock between spa_errlog_lock and dp_config_rwlock
  #14291 FreeBSD: Fix potential boot panic with bad label
  #14292 Add tunable to allow changing micro ZAP's max size
  #14293 Turn default_bs and default_ibs into ZFS_MODULE_PARAMs
  #14295 zed: add hotplug support for spare vdevs
  #14304 Activate filesystem features only in syncing context
  #14311 zpool: do guid-based comparison in is_vdev_cb()
  #14317 Pack zrlock_t by 8 bytes
  #14320 Update arc_summary and arcstat outputs
  #14328 FreeBSD: catch up to 1400077
  #14376 Use setproctitle to report progress of zfs send
  #14340 Remove some dead ARC code
  #14358 Wait for txg sync if the last DRR_FREEOBJECTS might result in a hole
  #14360 libzpool: fix ddi_strtoull to update nptr
  #14364 Fix unprotected zfs_znode_dmu_fini
  #14379 zfs_receive_one: Check for the more likely error first
  #14380 Cleanup of dead code suggested by Clang Static Analyzer
  #14397 Avoid passing an uninitialized index to dsl_prop_known_index
  #14404 Fix reading uninitialized variable in receive_read
  #14407 free_blocks(): Fix reports from 2016 PVS Studio FreeBSD report
  #14418 Introduce minimal ZIL block commit delay
  #14422 x86 assembly: fix .size placement and replace .align with .balign

Obtained from:	OpenZFS
OpenZFS commit:	9cd71c8604
2023-01-25 19:50:29 +01:00
Ceri Davies da52fc464a ipfw.8: there never was a "skip-action" action
It was renamed during review of D1776 but this entry slipped through.

PR:		243284
Reported by:	pprocacci@gmail.com
Obtained from:	Chad Jacob Milios <milios@ccsys.com>
2023-01-25 18:15:18 +00:00
Dag-Erling Smørgrav 7a4a520064 Fix cross-build from STABLE or older CURRENT.
Previously, zic and tzsetup were both listed as install tools and basic
bootstrap tools.  Actually, tzsetup is an install tool while zic is a
non-basic bootstrap tool.

Fixes:		783c318fd1
Sponsored by:	Klara, Inc.
Reviewed by:	jrtc27, emaste
Differential Revision:	https://reviews.freebsd.org/D38195
2023-01-25 18:03:10 +01:00
Dag-Erling Smørgrav f1021d27f7 zoneinfo: Always produce fat zoneinfo files.
These aren't just needed for compatibility with i386 binaries (which need
the 32-bit section), but potentially also for compatibility with older
binaries on all platforms.

Sponsored by:	Klara, Inc.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D38194
2023-01-25 18:03:05 +01:00
Dag-Erling Smørgrav 6fc1bbbf62 w: Unlike err(3), xo_err(3) won't accept a null format string.
MFC after:	1 week
X-MFC-with:	d90ff31ae5
Sponsored by:	Klara, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D38192
2023-01-25 18:03:00 +01:00
Dag-Erling Smørgrav a7b1b73935 tzcode: Document zic's -D option.
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D38141
2023-01-25 18:02:55 +01:00
Alexander V. Chernikov 20ea7f26e4 pytest: delete interfaces from inside the jail.
This change follows the approach used in 80fc25025f, to
 minimise the impact of the delayed interface migration.

MFC after:	2 weeks
2023-01-25 16:34:17 +00:00
Dag-Erling Smørgrav 783c318fd1 zoneinfo: On amd64, include 32-bit data.
While there, drop the unnecessary posixrules option.

Sponsored by:	Klara, Inc.
Reviewed by:	imp, allanjude
Differential Revision:	https://reviews.freebsd.org/D38142
2023-01-25 16:54:52 +01:00
Warner Losh 4410e85796 stand/uboot: Remove -fPIC here
When needed, -fPIC is added in defs.mk. While not in main, mips on
stable/13 can't tolerate it. Remove it here.

MFC After:		now (it's a build issue)
Sponsored by:		Netflix
2023-01-25 08:04:59 -07:00
Warner Losh eaf5ec88c2 stand: Add testing for i386 as well to full-test.sh
Sponsored by:		Netflix
2023-01-25 08:04:59 -07:00
Alexander V. Chernikov 864ea9abfb pytest: add an example test fetching test directory and ATF vars.
MFC after:	2 weeks
2023-01-25 13:55:33 +00:00
Jose Luis Duran f5924ad8fd strfmon(3): Match the return type
Reviewed by:	kib
MFC after:	1 week
2023-01-25 11:02:55 +02:00
Jose Luis Duran 59cc636d94 strfmon(3): Wording improvements
Use the same terminology as the other `_l` xlocale(3) functions.

Reviewed by:	kib
MFC after:	1 week
2023-01-25 11:02:55 +02:00
Jose Luis Duran cdd9d92dad strfmon(3): Add an EXAMPLES section
Reviewed by:	kib
MFC after:	1 week
2023-01-25 11:02:55 +02:00
Baptiste Daroussin bc4346e0ae pci_vendors: update to 2023-01-18 2023-01-25 09:58:39 +01:00
Emmanuel Vadot 5a00612149 arm64: Move device scmi to std.arm
The scmi driver in its current form requires the arm_doorbell
driver to communicate with the firmware.
The arm_doorbell is only found in ARM Juno reference board (and
apparently on Morello too).
If we want to use scmi on other platform (like some rockchip or imx
soc), the driver needs to be updated to support svc/shmem communication
with the firmware.
For now since it can be only used with arm_doorbell move the device to
std.arm otherwise kernel configs like ALLWINNER or ROCKCHIP fails to build.

Reviewed by:	br, imp
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37953
2023-01-25 08:28:22 +01:00
Dag-Erling Smørgrav d8c9f80891 libc: Update mktime(3) / timegm(3) tests.
Sponsored by:	Klara, Inc.
Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D38177
2023-01-25 07:22:46 +01:00