1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00
Commit Graph

293590 Commits

Author SHA1 Message Date
Jessica Clarke
33658afd4e rtld-elf: Pass parsed aux_info to ifunc_init
Currently we pass the raw pointer to the on-stack auxargs. This can
legitimately have fewer than AT_COUNT entries, so the use of
__min_size(AT_COUNT), i.e. static AT_COUNT, is inaccurate, and also
needlessly forces the callee to iterate over the elements to find the
entry for a given type. Instead we can just pass aux_info like we use
for everything else.

Note that the argument has been left unused by every callee since its
introduction in 4352999e0e ("Pass CPUID[1] %edx (cpu_feature), %ecx
(cpu_feature2) and CPUID[7].%ebx (cpu_stdext_feature), %ecx
(cpu_stdext_feature2) to the ifunc resolvers on x86.")

Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D46276
2024-08-22 20:36:44 +01:00
John Baldwin
776cd02b89 vmm ppt: Enable busmastering and BAR decoding while a device is assigned
Reviewed by:	corvink, markj
Fixes:		f44ff2aba2 bhyve: Treat the COMMAND register for PCI passthru devices as emulated
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D46245
2024-08-22 14:40:48 -04:00
Brooks Davis
5680cf6dc6 jemalloc: don't expose 3.0 compat symbols
Don't provide default linkage for jemalloc 3.0 compatability symbols.
We stopped declaring these interfaces with the introduction of jemalloc
4.0 prior to FreeBSD 11.0.  Any code using them would have had to
declare them manually so stop declaring them and export the symbols
directly for compatability.  Arguably they should be x86 only as they
were never declared on other Tier-1 architectures.

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D46407
2024-08-22 17:08:24 +01:00
Michael Tuexen
498286d4e8 tcp: fix format of sysctl variable
The format for CTLTYPE_UINT is "IU" instead of "UI" as specified
in sysctl.9.

Reviewed by:		cc, zlei
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46408
2024-08-22 14:44:47 +02:00
Zhenlei Huang
0f64fc6a34 kern: Align the declaration of kernconfstring with its definition
It is defined as const char[] in config.c which is auto generated by
usr.sbin/config/kernconf.tmpl .

While here prefer macro SYSCTL_CONST_STRING to avoid casting.

MFC after:	1 week
2024-08-22 18:00:34 +08:00
Michael Tuexen
a1d9ce19b1 sctp: fix format of sysctl variables
MFC after:		1 week
2024-08-22 09:07:27 +02:00
Maxim Konovalov
d399c791b2 bsd-family-tree: NetBSD 8.3 added
PR:	280983
2024-08-22 00:29:36 +00:00
John Baldwin
c0c1b1cd89 freebsd32: Fix a few typos in syscalls.conf comments
Sponsored by:	AFRL, DARPA
2024-08-21 17:14:56 -04:00
Doug Moore
d48524e21f dev_pager: define free_page for mgt devices
Callers of cdev_pager_free_page in the kernel always have object->type
== OBJT_MGTDEVICE. Define a function for them to call that skips the
runtime type check in cdev_pager_free.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D46389
2024-08-21 15:48:59 -05:00
Navdeep Parhar
d668a0b0ab cxgbe(4): reset routine for general use.
Add a reset_adapter wrapper that picks the most suitable reset routine
internally.  Use it in the fatal error handler as well as the sysctl
based reset.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-08-21 11:47:15 -07:00
John Baldwin
297a9e552b libcxxrt: Add a stub implementation of __cxa_call_terminate
This function is called by GCC 14 if a destructor invoked during
exception unwinding throws an exception.

Reviewed by:	emaste
Obtained from:	libcxxrt commit 391a3dcc1054e18c2f0dff4e14d6d79ac95399d7
Differential Revision:	https://reviews.freebsd.org/D46004
2024-08-21 13:37:48 -04:00
Konstantin Belousov
47656cc1ef amd64: use INVLPGB for kernel pmap invalidations
avoiding broadcast IPIs.

Reviewed by:	alc, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45191
2024-08-21 19:35:15 +03:00
Konstantin Belousov
bc4ffcadf2 amd64: add variables indicating INVLPGB works
Reviewed by:	alc, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45191
2024-08-21 19:35:07 +03:00
Konstantin Belousov
111c7fc2fe amd64: add convenience wrappers for INVLPGB and TBLSYNC
Reviewed by:	alc, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45191
2024-08-21 19:34:59 +03:00
Konstantin Belousov
45543d3424 DMAR: clear dmar_devs[unit] if attach failed
This should stop attempts to use a unit which was not completely
initialized, but referenced by ACPI DMAR table during scoped devices
operions.

PR:	280817
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46382
2024-08-21 18:23:07 +03:00
Konstantin Belousov
40bffb7d21 rangelocks: fix typo in rl_w_validate
The freed elements should be threaded using rl_q_free pointer.

Reported by:	dougm, markj
Tested by:	markj
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:20:28 +03:00
Konstantin Belousov
c4d8b2462e rangelocks: recheck that entry is not marked after sleepq is locked in rl_w_validate()
otherwise we might loose the wakeup.

Reported and tested by:	markj
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:19:57 +03:00
Konstantin Belousov
a725d61825 rangelock: if CAS for removal failed, restart list iteration
Our next pointer is invalid and cannot be followed.

Tested by:	markj, pho
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:19:36 +03:00
Konstantin Belousov
9467c1a69b rangelock: assert that we never insert or remove our entry after a logically deleted one
Tested by:	markj, pho
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:19:15 +03:00
Konstantin Belousov
e228961d6e rangelock_destoy(): poison lock->head to trip fault on lock attempt
Tested by:	markj, pho
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:18:56 +03:00
Konstantin Belousov
8a5b2db3d8 ranglelock_destroy(): do not remove lock entries from under live lock acquirer
Tested by:	markj, pho
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:18:39 +03:00
Konstantin Belousov
a3f10d0882 rangelocks: add rangelock_free_free() helper to free free list
Tested by:	markj, pho
Sponsored by:	The FreeBSD Foundation
2024-08-21 18:18:16 +03:00
Ed Maste
db87c98168 ctl: avoid heap info leak in ctl_request_sense
Previously 3 bytes of data from the heap could be leaked to ctl
consumers.

Reported by:	Synacktiv
Reviewed by:	asomers, mav
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46091
2024-08-21 09:32:41 -04:00
Pietro Cerutti
1af7d5f389 libfetch: don't include fragments in HTTP requests
Summary:
Fragments are reserved for client-side processing, see
https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1

Also, some servers don't like to receive HTTP requests with fragments.

```
$ fetch 'https://dropbox.com/a/b'
fetch: https://dropbox.com/a/b: Not Found

$ fetch 'https://dropbox.com/a/b#'
fetch: https://dropbox.com/a/b#: Bad Request
```

This is a real-world scenario, where some download link from dropbox
(eventually) redirects to an URL with a fragment:

```
$ fetch -v 'https://www.dropbox.com/sh/<some>/<thing>?dl=1' 2>&1 | grep requesting
requesting https://www.dropbox.com/sh/<some>/<thing>?dl=1
requesting https://www.dropbox.com/scl/fo/<foo>/<bar>?rlkey=<baz>&dl=1
requesting https://<boo>.dl.dropboxusercontent.com/zip_download_get/<some-long-strig>#
```

See how the last redirect ends with a `#`.

Currently, libfetch includes the ending fragment and makes it impossible
to download the file.

Differential Revision:	https://reviews.freebsd.org/D46318
MFC after:		2 weeks
2024-08-21 12:35:27 +00:00
Igor Ostapenko
e7f9171b67 pf: Handle m_len < sizeof(struct ether_header) case
Reviewed by:	kp
Differential Revision:	https://reviews.freebsd.org/D46391
2024-08-21 14:10:03 +02:00
Konstantin Belousov
828445cc5e if_vlan: set if_cap{abilities2,enable2} after IFCAP_IPSEC_OFFLOAD is recalculated
This makes the vlan IPSEC offload really functional.

Noted by:	Ariel Ehrenberg <aehrenberg@nvidia.com>
Sponsored by:	NVidia networking
2024-08-21 13:31:41 +03:00
Andrew Turner
024248c933 libc/aarch64: Remove an unneeded weak symbol
The index symbol doesn't belong in memcpy.S as it is already in
strchr.S where it belongs.

Sponsored by:	Arm Ltd
2024-08-21 10:16:10 +00:00
Andrew Turner
f1bc3750cf arm64: Use store-pair to zero the kernel bss
While this won't be noticed by most users the time to zero the bss
while using instruction tracing in the Arm FVP models (simulators) is
noticeable.

Reduce this time by using a store-pair instruction to double the size
of memory we zero on each iteration of the loop.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42733
2024-08-21 10:16:10 +00:00
Andrew Turner
78d69d0a3c arm64: Fix the kernel with options VMM
* We can build the non-VHE code with branch protection, it is already
   build as such in the module.
 * Use the correct file name for the non-VHE exception .o file.
2024-08-21 10:16:10 +00:00
Zhenlei Huang
7412517f29 init_main: Sprinkle const qualifiers where appropriate
No functional change intended.

MFC after:	1 week
2024-08-21 18:01:30 +08:00
Andrew Turner
0054693392 arm64: Boot into VHE mode when able
When FEAT_VHE is present the HCR_EL2 E2H field will be implemented. Try
setting this and checking if it's still set to decide if we can boot
into VHE mode or not.

When it is implemented the kernel will boot into EL2 rather than EL1
it currently boots to. The parts of the kernel that need to know if
they are in EL1 or EL2 have been updated other than the CoreSight
driver as there doesn't appear to be any way to currently use it and
it will be updated soon with the new HWT framework.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46087
2024-08-21 08:46:59 +00:00
Andrew Turner
db6e3260a8 arm64: Remove the E2H check from has_hyp
This was added to not use the physical timer when E2H was set. As we
now use the correct timer in this case we can remove this extra check.

Tested by:	kevans
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46086
2024-08-21 08:46:59 +00:00
Steve Kargl
213eb102ae
msun: Fix typo in comment
PR:		280965
MFC after:	3 days
2024-08-21 14:59:07 +08:00
Rick Macklem
2477e88b8d nfs: Add support for the NFSv4.2 mode_umask attribute
RFC8275 defines a new attribute as an extension to NFSv4.2
called MODE_UMASK.  This patch adds support for this attribute
to the NFSv4.2 client and server.

Since FreeBSD applies the umask above the VFS/VOP layer,
this attribute does not actually have any effect on the
handling of ACL inheritance, which is what it is designed for.
However, future changes to NFSv4.2 require support of it,
so this patch does that, resulting in behaviour identcal to
the mode attribute already supported.

MFC after:	2 months
2024-08-20 18:48:19 -07:00
Ed Maste
aa0bc761d2 bsd.symver.mk: pass $CFLAGS to $CPP invocation
This allows us to support symbols optionally available based on
configuration, not just on compiler built-in #defines.

Reviewed by:	brooks, jrtc27
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45346
2024-08-20 21:17:52 -04:00
Michael Tuexen
64443828bb tcp: fix list iteration in tcp_lro_flush_active()
Use LIST_FOREACH_SAFE(), since the list element is removed from
the list in the loop body, zero out and inserted in the free list.

Reviewed by:		rrs
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46383
2024-08-21 00:07:37 +02:00
Mark Johnston
417b35a97b netinet: Add a sysctl to allow disabling connections to INADDR_ANY
See the discussion in Bugzilla PR 280705 for context.

PR:		280705
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D46259
2024-08-20 21:31:57 +00:00
Gleb Smirnoff
6bc966987e dummymbuf: add to LINT 2024-08-20 13:46:09 -07:00
Gleb Smirnoff
aa72c5bacb dummymbuf: fix build without INET or INET6
Note that VIMAGE would mask both compilation failures.
2024-08-20 13:45:38 -07:00
Ed Maste
0875f3cd74 Revert "x86: Enable Intel DMAR by default"
A number of people have reported panics with it enabled by default,
possibly due to broken ACPI tables, which we do not handle well. D46382
is a potential fix for this issue.

Additionally DMAR is currently not compatible with bhyve passthrough
(see comment #10 in PR280817), with a draft patch to address that in
D25672.

Revert to disabling DMAR by default pending the resolution of those two
issues.

This reverts commit 3192fc3023.

PR:		280817
Sponsored by:	The FreeBSD Foundation
2024-08-20 11:49:25 -04:00
Michael Tuexen
aa6c490bf8 tcp: initialize the LRO hash table with correct size
There will at most lro_entries entries in the LRO hash table. So no
need to take lro_mbufs into account, which only results in the
LRO hash table being too large and therefore wasting memory.

Reviewed by:		rrs
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D46378
2024-08-20 17:30:55 +02:00
Mark Johnston
66aed7e348 socket: Set lock flags properly
Fixes:	fb901935f2 ("socket: Split up sosend_generic()")
Reported by:	cy
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
2024-08-20 15:17:14 +00:00
Wolfram Schneider
b49aec04f0 bsd-family-tree: fix macOS 11 release date 2024-08-20 14:36:20 +00:00
Eugene Grosbein
e5b8538083 libalias: add another check to previous change
If UseLink() returns NULL, it is possible that Deletelink()
has already freed "grp", so check it out carefully.

PR:		269770
Reported by:	Peter Much
X-MFC-With:	8132e95909
2024-08-20 21:04:13 +07:00
Wolfram Schneider
d4a4d1e742 bsd-family-tree: shorter URLs 2024-08-20 13:29:18 +00:00
Wolfram Schneider
d1e78fbd4a bsd-family-tree: add NetBSD 9.4 2024-08-20 13:26:46 +00:00
Konstantin Belousov
e9ace6e8f8 net/if_lagg.c: remove stray include is sys/cdefs.h
Sponsored by:	NVidia networking
2024-08-20 15:42:13 +03:00
Konstantin Belousov
66f0e2017f ipsec_offload: add ipsec_accel_drv_sa_lifetime_fetch()
A function to fetch hardware counters for offloaded SA on specific
interface.

Sponsored by:	NVidia networking
2024-08-20 15:42:13 +03:00
Ariel Ehrenberg
205263ac25 mlx5en: support ipsec offload on vlan if
Add vlan tag match to RX FS SA and policy rules
and report SA lifetime counter on vlan interface
in case SA was installed on vlan interface

Existing code didn't have the net tag id as part of
the FS matching rules. This can cause applying
ipsec offload to the wrong interface.
This commit add tag id as part of FS matchers
and treat tag value 0 as no tag

Sponsored by:   NVidia networking
2024-08-20 15:42:13 +03:00
Konstantin Belousov
84abf7e26d ipsec_offload: support vlans
Sponsored by:	NVIDIA networking
2024-08-20 15:42:12 +03:00