Commit Graph

279302 Commits

Author SHA1 Message Date
Justin Hibbits
ec9388ddba dtrace: Make pid provider work on trivial tests
'newpc' needs set in the "common" case.  With this, the trivial test

 $ dtrace -n 'pid$target:libc:strlen:entry { trace(timestamp); }' -p
 <pid>

now works.

MFC after:	3 weeks
2022-10-30 16:00:44 -04:00
Piotr Kubaj
35c87c070a ofed: allow using IPv6 address in rc_pingpong server
Summary:
The current OFED code allows binding server to IPv6 address. It was added back in 91fc39561d

Sponsored by:	Intel Corporation
MFC after:	3 days

Reviewers: hselasky

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D37196
2022-10-30 20:11:41 +01:00
Gordon Bergling
c72854c06a wg.4: Update the SPDX License Identifier
The following License Identifier
'BSD-2-Clause-FreeBSD' is not allowed
for new code so use the correct on.

Reported by:	imp
2022-10-30 19:05:30 +01:00
Bjoern A. Zeeb
cca40d7cc7 LinuxKPI: add timekeeping.h, another dummy (empty) header file
The file is included by a driver but it seems we don't need to implement
anything here.

MFC after:	3 days
2022-10-30 17:35:24 +00:00
Mitchell Horne
334fc46f05 intr_event(9): document intr_event_handle()
Reviewed by:	pauamma
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36934
2022-10-30 11:07:04 -03:00
Gordon Bergling
19c03f4ab0 wg.4: Add some enhancements
- add a SPDX-License-Identifier
- rename the title of the man page
- use better grammar in some places
- reword 'IPs' to 'IP addresses'
- add a missing word in the AUTHORS section
- use '.An -nosplit' in the AUTHORS section
- Xr ipsec and ovpn

Reviewed by:	pauamma, mhorne
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37205
2022-10-30 13:59:37 +01:00
Gordon Bergling
514df63539 tee.1: Add a HISTORY section
The most accurate information I have found is that
tee(1) first appeared in Version 7 AT&T UNIX.

Reviewed by:	pauamma
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37206
2022-10-30 11:29:59 +01:00
Jose Luis Duran
f0a15aafcb strfmon: Remove XXX marks
phantom@'s HDD crashed with the final version of strfmon.c, as explained
in 9d430a5991.

Now there are tests in place that cover these code paths.

Reviewed by:	kib
PR:	267410
Github PR:	#620
MFC after:	1 week
2022-10-30 00:09:32 +03:00
Jose Luis Duran
621bf91893 strfmon_l: Use specified locale for number formatting
strfmon_l does not take fully into consideration the explicitly passed
locale to perform the formatting.

Parallel universe bug report:	https://sourceware.org/bugzilla/show_bug.cgi?id=19633

Obtained from:	Darwin
Reviewed by:	kib
PR:	267410
Github PR:	#620
MFC after:	1 week
2022-10-30 00:09:11 +03:00
Jose Luis Duran
29972f06f9 strfmon_test: Add a test for strfmon_l
Attempt to test the correctness of strfmon_l(3).

Items marked with XXX represent an invalid output.

Obtained from:	e7eba0044f

Reviewed by:	kib
PR:	267410
Github PR:	#620
MFC after:	1 week
2022-10-30 00:08:54 +03:00
Jose Luis Duran
edcee003e5 strfmon_test: Reserve space for the null terminator
Otherwise strfmon(3) could overflow the buffer.

Here is mostly done for correctness and illustrative purposes, as there
is no chance it could actually happen.

Reviewed by:	kib
PR:	267410
Github PR:	#620
MFC after:	1 week
2022-10-30 00:08:33 +03:00
Jose Luis Duran
d96088b3ab strfmon_l(3): Add name to the man page
Reviewed by:	kib
PR:	267410
Github PR:	#620
MFC after:	1 week
2022-10-30 00:08:19 +03:00
Doug Moore
a2c57c60d9 iommu_gas: drop fini cleanup loop
Assertions suggest that the loop in iommu_gas_fini_domain is executed
zero times, so remove it.

Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D37204
2022-10-29 12:56:06 -05:00
Warner Losh
010175a76d modules: Add missing opt_*.h files for stand-alone compile
Standalone compile that we at least create these opt_*.h files.

Sponsored by:		Netflix
2022-10-29 10:18:06 -06:00
Warner Losh
50a3621836 modules: Remove duplicate opt_global.h target
The default one does the right thing these days.

Sponsored by:		Netflix
2022-10-29 10:18:06 -06:00
Warner Losh
f7026fbbb2 sys/modules: MODULES_OVERRIDE takes precedence over EXTRA_MODULES and WITHOUT_MODULES
MODULES_OVERRIDE has traditionally taken precedence over EXTRA_MODULES
and WITHOUT_MODULES as the exact list of modules to build. Over time,
things have been added that has broken this. Move the .endif that makes
this the case to the right place. The so called 'ALL_MODULES' option is
the only thing with higher precedence, but it's not quite all the
options anymore (though it is much more of them, and doesn't quite
work on !x86).

Sponsored by:		Netflix
2022-10-29 10:17:40 -06:00
Warner Losh
25b1b63dba dtb: Be much less verbose in the building of dtb
Make the dtb/dtbo files with less noise. Remove echo statements, but add
back the call for the non-meta builds to replace the removed noise.

Suggetions by:		jrtc27
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D37073
2022-10-29 10:13:54 -06:00
Warner Losh
c07be2c53e make: Don't print as many ==> and -- xxx -- lines in meta mode
Since metamode just announces what it's doing, the extra -- xxx -- lines
aren't needed for recursive descent, nor are the ==> lines needed. This
speeds up rebuilding kernels a lot...

Sponsored by:		Netflix
Reviewed by:		sjg, bdrewery
Differential Revision:	https://reviews.freebsd.org/D37071
2022-10-29 10:13:54 -06:00
Mitchell Horne
f396f9b6c9 linux, linux64: fix module load
The previous commit added references to to the syscallnames arrays, but
failed to add the relevant source files to the module build. Thus, the
modules failed to load due to missing symbols.

Reported by:	cy
Fixes:	1da65dcb1c ("linux: populate sv_syscallnames in each sysentvec")
Sponsored by:	The FreeBSD Foundation
2022-10-29 13:11:24 -03:00
Mitchell Horne
3317848808 linux, linux64: improve SRCS formatting
Sort the entries alphabetically, and list them with one entry per line.
This makes the diffs much cleaner when adding or removing a new entry,
as I will do in the next commit.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-10-29 13:11:24 -03:00
Mark Johnston
1f6b6cf177 atomic: Intercept atomic_(load|store)_bool for kernel sanitizers
Fixes:		2bed73739a ("atomic: Add plain atomic_load/store_bool()")
2022-10-29 11:10:58 -04:00
Mike Karels
234c1463a7 genet: add another case where headers need pullup
Wake On LAN packets sent by wake(8) via BPF are lost if txcsum is
enabled.  These fall into the "other protocol" case where gen_parse_tx
did nothing.  Add code to shift up to gen_tx_hdr_min bytes of the
packet along with the Ethernet header in this case.
2022-10-29 07:52:57 -05:00
Konstantin Belousov
6b69465efb vfs_domount(): ensure that v_mountedhere and VIRF_MOUNTPOINT are set under the vnode lock
Fixes:	f7833196bd
Reported and tested by:	pho
Reviewed by:	jah, markj (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D37198
2022-10-29 14:29:55 +03:00
Doug Moore
8b221ca631 iommu_gas: start space search from 1st free space
Maintain a pointer to an element in the domain map that is left of any
sufficiently large free gap in the tree and start the search for free
space there, rather than at the root of the tree. On find_space, move
that pointer to the leftmost leaf in the subtree of nodes with
free_down greater than or equal to the minimum allocation size before
starting the search for space from that pointer. On removal of a node
with address less than that pointer, update that pointer to point to
the predecessor or successor of the removed node.

In experiments with netperf streaming, this reduces by about 40% the
number of map entries examined in first-fit allocation.

Reviewed by:	alc, kib
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D36624
2022-10-29 00:50:44 -05:00
Kyle Evans
0283826706 usr.bin: hook wg(8) up to the build
wg(8) is used to manage WireGuard interfaces; see wg(4) and wg(8) both
for more details and usage examples.
2022-10-28 22:05:39 -05:00
Kyle Evans
adf3764857 Add 'contrib/wireguard-tools/' from commit '7e00bf8773b93a2a3ee28dba2710d2ae443989f1'
git-subtree-dir: contrib/wireguard-tools
git-subtree-mainline: 9142a2a37b
git-subtree-split: 7e00bf8773
2022-10-28 22:05:14 -05:00
Kyle Evans
7e00bf8773 Import wireguard-tools for wg(8)
744bfb2131 ("Import the WireGuard driver from zx2c4.com") re-imported
the WireGuard driver with the intention that wg(8) will be used to
manage WireGuard interfaces, as on other platforms, now that wg(8) has
been dual-licensed MIT specifically to allow our use in base (thanks!).

This is a copy of wireguard-tools/src, with files that we don't need
.gitignore'd out to make it more clear that we're only building files
that are either MIT or dual-licensed MIT.  We may go with a different
structure later (e.g., if we end up needing to include outside of src/),
but an upstream restructure seems unlikely in the foreseeable future.
2022-10-28 21:42:39 -05:00
Philip Paeps
9142a2a37b contrib/tzdata: import tzdata 2022f
Changes: https://github.com/eggert/tz/blob/2022f/NEWS

MFC after:	3 days
2022-10-29 10:38:01 +08:00
Philip Paeps
46649025f4 Import tzdata 2022f 2022-10-29 10:33:53 +08:00
Mitchell Horne
aba921bd9e ddb: print the actual syscall name
Some architectures will pretty-print a system call trap in the
backtrace. Rather than printing the symbol, use the syscallname()
function to pull the string from the sv_syscallnames array corresponding
to the process. This simplifies the function somewhat.

Mostly, this will result in dropping the "sys" prefix, e.g. "sys_exit"
will now be printed simply as "exit".

Make two minor tweaks to the function signature: use a u_int for the
syscall number since this is a more correct type (see the 'code' member
of struct syscall_args), and make the thread pointer the first argument.
The latter is more natural and conventional.

Suggested by:   jrtc27
Reviewed by:	jrtc27, markj, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37200
2022-10-28 18:21:08 -03:00
Mitchell Horne
1da65dcb1c linux: populate sv_syscallnames in each sysentvec
This allows the syscallname() function to give a usable result for Linux
ABIs.

Reported by:	jrtc27
Reviewed by:	jrtc27, markj, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37199
2022-10-28 18:21:08 -03:00
Andrew Turner
fe36346a89 Disable Hyper-V on arm64
It unconditionally calls into the Hyper-V firmware. As most arm64
boards don't have said firmware disable it for now.
2022-10-28 22:17:00 +01:00
Andrew Turner
16c10e99b8 Remove the hyperv option from std.dev
It's already in std.hyperv and we don't need to repeat it here.
2022-10-28 22:17:00 +01:00
Mark Johnston
89585511cc release: Add support for creating ZFS-based VM images
The change extends vmimage.subr to handle a new parameter, VMFS, which
should be equal to either "ufs" or "zfs".  When it is set to ZFS, we use
makefs to create a bootable pool populated using the same dataset layout
as bsdinstall and "poudriere image" use.  The pool can be grown using
the growfs rc.d script, just as in UFS images.

This will make it easy to provide VM and cloud images with ZFS as the
root filesystem.  So far I did not do extensive testing of cloud images;
I merely verified that creation of ZFS-based AWS AMIs works and allows
me to create amd64 and arm64 EC2 instances with ZFS as the root
filesystem.

Reviewed by:	emaste, gjb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34426
2022-10-28 17:00:24 -04:00
Mark Johnston
752ba1004a makefs: Fix handling of inherited mountpoints
Commit d7eec79b70 overlooked the fact that
nvlist_find(DATA_TYPE_STRING) does not provide a nul-terminated string.
Fix the leak a different way.

Fixes:	d7eec79b70 ("makefs: Plug a memory leak")
2022-10-28 17:00:22 -04:00
John Baldwin
854d066251 wg: Trim compat shims for versions older than current stable/13.
Reviewed by:	kevans, markj, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36913
2022-10-28 13:36:13 -07:00
John Baldwin
c640d1af2c wg: Retire now unused support.h.
Reviewed by:	kevans, markj, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36912
2022-10-28 13:36:13 -07:00
John Baldwin
dcf581bb49 wg: Use zfree.
Reviewed by:	kevans, markj, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36911
2022-10-28 13:36:13 -07:00
John Baldwin
e32e1a160e wg: Use atomic(9) instead of concurrency-kit atomics.
Kernel sanitizers only support atomic(9) operations.

Reviewed by:	kevans, markj, emaste
Reported by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36910
2022-10-28 13:36:13 -07:00
John Baldwin
744bfb2131 Import the WireGuard driver from zx2c4.com.
This commit brings back the driver from FreeBSD commit
f187d6dfbf plus subsequent fixes from
upstream.

Relative to upstream this commit includes a few other small fixes such
as additional INET and INET6 #ifdef's, #include cleanups, and updates
for recent API changes in main.

Reviewed by:	pauamma, gbe, kevans, emaste
Obtained from:	git@git.zx2c4.com:wireguard-freebsd @ 3cc22b2
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36909
2022-10-28 13:36:12 -07:00
John Baldwin
9e0aaedd70 Split netinet shell tests into one per line.
This makes diffs when adding or removing tests easier to read.

While here, sort the list of tests.

Reviewed by:	kevans, melifaro, asomers, markj, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36908
2022-10-28 13:36:12 -07:00
Warner Losh
31bfa27894 sys/modules: Catchup to armv[45] being removed
Now that armv[45] are removed, simplify some tests for armv[67] that are
now either always true, or always true when we're on arm.

Sponsored by:		Netflix
2022-10-28 14:11:04 -06:00
Warner Losh
c8a63d71fe sys/modules: Delete now empty if
Ah, the joys of pushing a commit with a dirty editor buffer that all the
checks in git didn't catch... Also, my eyeballs missed it too :(.

Fixes:		ba9f71ddec
Noticed by:	jrtc27
Sponsored by:	Netflix
2022-10-28 14:10:09 -06:00
Colin Percival
5ad8c32c72 ns8250: Fix sense of LSR_TEMT FCR check
When flushing the UART, we need to drain manually if LSR_TEMT is
*not* asserted, aka. if the transmit FIFO is not empty.

Reported by:	void <void@f-m.fm>
Fixes:		c4b68e7e53 "ns8250: Check if flush via FCR succeeded"
Differential Revision:	https://reviews.freebsd.org/D37185
2022-10-28 12:20:28 -07:00
Warner Losh
ba9f71ddec sys/modules: simplify a little by moving syscons to x86 only
syscons is x86 only now that sparc has been retired. No need for the
extra if. Also alphabetize p2sb.

Sponsored by:		Netflix
2022-10-28 11:52:40 -06:00
Warner Losh
445875aefd sys/modules: tidy up a bit by moving _hyperv to aarch64 section
Suggested by:	jhb
Sponsored by:	Netflix
2022-10-28 11:46:48 -06:00
Andrew Turner
227046a4d2 Enable more extres options when FDT is missing
These now build when FDT is not included in the kernel config.

Sponsored by:	Innovate UK
2022-10-28 18:31:56 +01:00
Andrew Turner
5566f84822 Only include regdev_if.h when it's needed
We don't need to include regdev_if.h when not building for FDT.

Sponsored by:	Innovate UK
2022-10-28 18:31:55 +01:00
Andrew Turner
01aaff6d1c Fix the includes in regulator_fixed.c
Include sys/bus.h directly rather than depend on header pollution.
While here fix the order of sys/systm.h.

Sponsored by:	Innovate UK
2022-10-28 18:31:55 +01:00
Andrew Turner
78e60ba04a Only include phydev_if.h when needed
We only need to include phydev_if.h in phy.c when FDT is enabled and
don't need it at all in phy_usb.c.

Sponsored by:	Innovate UK
2022-10-28 18:31:55 +01:00