Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge FreeBSD 2024-05-17 #2208

Merged
merged 255 commits into from
Aug 29, 2024
Merged

Merge FreeBSD 2024-05-17 #2208

merged 255 commits into from
Aug 29, 2024

Conversation

bsdjhb
Copy link
Collaborator

@bsdjhb bsdjhb commented Aug 28, 2024

PR for CI

bsdimp and others added 30 commits May 11, 2024 13:03
Consistently use the weird ssize_t type for things I know are unsigned,
but which none-the-less need to be compared to signed things to prevent
a bogus warning. Sigh, these aren't bugs, can't possibly be bugs and
a waste of time to fix.

Sponsored by:		Netflix
PR: 277677

Signed-off-by: Henrich Hartzer <[email protected]>
Reviewed by: imp
Pull Request: freebsd/freebsd-src#1161
In some cases, the USB_QUIRK_VP macro was being misused. Instead of
setting quirks to the intended value, the first two supplied quirks
would go into lo_rev and hi_rev. Replace it with USB_QUIRK_VO which only
takes the needed args. This also makes the Dummy products, which where
being used to correctly set vendor only quirks, not necessary.

Reviewed by: imp
Pull Request: freebsd/freebsd-src#1153
Seperate usb quirks that target specific revisions from those that
dont. Alot of the quirks dont use lo_rev and hi_rev, so we can abstract
the 0x0000, 0xffff into a macro.

[[ This commit is a bit more churn than we like. I carefully reviewed
   each one and they are all good. The end product is better -- imp ]]

Reviewed by: imp
Pull Request: freebsd/freebsd-src#1153
Signed-off-by: Ricardo Branco <[email protected]>
Reviewed by: imp
Pull Request: freebsd/freebsd-src#1218
Add opt_inet.h and opt_usb.h to make linux module buildable standalone.

Sponsored by:		Netflix
Cast the time type to (long). This is correct on all architectures. On
i386, this promotes the int time_t to a long (which is also 32-bit). On
64-bit architectures, this promotes the 64-bit signed time_t to a 64-bit
signed int type.

Sponsored by:		Netflix
…nly once

per allocated vm_object.  Otherwise, since constructors are not
idempotent, we e.g. leak device reference in case of non-managed pager.

PR:	278826
Reported by:	Austin Zhang <[email protected]>
Reviewed by:	alc, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45113
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
The cast to (long) is wrong on all the other 32-bit platforms. (long
long) is the correct type on all platforms. Also, use a z modifier for
size_t which also fails on 32-bit platforms.

Fixes: 02f481a
Sponsored by: Netflix
- s/defaul/default/

MFC after:	3 days
There's a race in these that I missed in my review that needs
to be resolved.

This reverts commit ee2e366.
This reverts commit 02f481a.
This reverts commit 099a81a.
ALL_DISTRIBUTIONS and VERIFY_MANIFEST_SIG

They are neither used in the script nor exported.
Not referenced anywhere in bsdinstall/*

Approved by:		imp@
Differential Revision:	https://reviews.freebsd.org/D42369
When the page size is 16K, use ATTR_CONTIGUOUS to map the kernel code
and data sections using 2M pages.  Previously, they were mapped using
16K pages.

Reviewed by:	markj
Tested by:	markj
Differential Revision:	https://reviews.freebsd.org/D45162
This is a mostly-unmodified copy of the various *_chk implementations
and headers from NetBSD, without yet modifying system headers to start
actually including them.  A future commit will also apply the needed
bits to fix ssp/unistd.h.

Reviewed by:	imp, pauamma_gundo.com (both previous versions), kib
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32306
Notably:
- libc needs to #undef some of the macros from ssp/* for underlying
  implementations
- ssp/* wants a __RENAME() macro (snatched more or less from NetBSD)

There's some extra hinkiness included for read(), since libc spells it
as "_read" while the rest of the world spells it "read."

Reviewed by:	imp, ngie
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32307
In the future, we will Default to _FORTIFY_SOURCE=2 if SSP is enabled,
otherwise default to _FORTIFY_SOURCE=0.  For now we default it to 0
unconditionally to ease bisect across older versions without the new
symbols, and we'll put out a call for testing.

include/*.h include their ssp/*.h equivalents as needed based on the
knob. Programs and users are allowed to override FORTIFY_SOURCE in their
Makefiles or src.conf/make.conf to force it off.

Reviewed by:	des, markj
Relnotes:	yes
Sponsored by:	Stormshield
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D32308
access(), eaccess() and faccessat() will always dereference
symbolic links.

So add a note in the manual page, that lstat(2) should be
used in the case of symbolic links.

PR:	262895
Reviewed by:	gbe, pauamma_gundo.com
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44890
User misconfiguration may lead to routing loops where we try to send the tunnel
packet into the tunnel. This eventually leads to stack overflows and panics.

Avoid this using if_tunnel_check_nesting(), which will drop the packet if we're
looping or we hit three layers of nested tunnels.

MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
PR:		274897
Fixes:		8993d78
MFC after:	3 days
Reviewed by:	gbe
Differential Revision:	https://reviews.freebsd.org/D45167
There is no reason not do do this, we already allow fork(2),
and I need vfork(2) for CHERI process colocation.

Reviewed by:	brooks, emaste, oshogbo
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39829
Regen to pick up WITHOUT_SSP addition from commit 9bfd3b4.

Sponsored by:	The FreeBSD Foundation
We haven't exposed gets(3) in a long time, rip out __gets_chk before
it's too late and something builds a gets(3) user with it enabled.
Pointed out by: trasz
Reported and tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45119
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45119
Which allows tmpfs_pager_writecount_recalc() to reliably detect
reclaimed vnode and make its accesses to object->un_pager.swp.private
(== vp) safe against reclaim.  Note that vnode instantiation already
assigns v_object under the object lock.

Reviewed by:	markj
Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D45119
Pointed out by:	brooks
Reviewed by:	dab, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45152
Reviewed by:	dab, imp
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45153
zxombie and others added 27 commits August 29, 2024 15:58
These can be used even when the compiler is too old for the register
to be included.

Reviewed by:	Zachary Leaf <[email protected]>
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45176
To build with old toolchains use the *_REG macros to access the ID
registers. These become a name in the form S?_?_C?_C?_? where the '?'
values encode the op and CR values needed to access the register.

For consistency use these macros for all ID registers, even if most
toolchains understand them.

Reviewed by:	Zachary Leaf <[email protected]>
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45177
It's missing an mtree update

This reverts commit 9e48c30.
Reported by:	eduardo@
Fixes:		c2e9c5b ("tpm: Refactor TIS and add a SPI attachment")
- Fix the spelling of handle_el2_el1_irq64
- Add .section before .rodata as the GCC build needs it

Sponsored by:	Arm Ltd
dd a missing underscore to arm_smccc_1_2_* to fix the GCC build.

Sponsored by:	Arm Ltd
When the register is not defined in Armv8.0 i.e. added in a later
extension, like SPE added in v8.2, the alternative name format of:
    S<op0>_<op1>_C<crn>_C<crm>_<op2>
should be used; otherwise, calls to {READ,WRITE}_SPECIALREG() will
fail.

Use the MRS_REG_ALT_NAME() macro for SPE changing hex to decimal as
required by the macro.

Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45171
Bits [5:0] of PMBSR_MSS encodes either Buffer Status Code (BSC) or Fault
Status Code (FSC) depending on PMBSR_EC value.

Add PMBSR_MSS_{BSC,FSC} to cover this field.

Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45172
CONTEXTIDR_EL1 is used in debug and trace features to identify the
current process or context.

Reviewed by:	andrew
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45173
gcc doesn't have -m32 support on aarch64 so mark LIB32 broken there.

We have to check both COMPILER_TYPE and X_COMPILER_TYPE becuase
X_COMPILER_TYPE is only conditionally set and COMPILER_TYPE is the host
compiler in Makefile.inc1.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45089
Since at least 2022 (see https://reviews.freebsd.org/D36754), it has
not been possible to build armv6/armv7 with gcc due to atomics macros
gcc doesn't like.  Prevent developers doing due diligance from wasting
time and CPU cycles on this combination as it just fails to build in
libc.

Reviewed by:	imp, andrew
Differential Revision:	https://reviews.freebsd.org/D45193
On 32-bit platforms long long is generally 64-bits.  Sufficiently modern
versions of gcc (13 in my testing) complains when casting a pointer to
an integer of a different width so cast to uintptr_t first to avoid the
warning.

Fix i386 gcc builds while we wait for this to be merged to OpenZFS.

Sponsored by:	DARPA, AFRL
Pull Request:	openzfs/zfs#16203
The Debug Port Table 2 (DBG2) contains information on which devices
can be used for debugging purposes.

Add support to the uart driver to use the DBG2 table when enabled from
loader.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D44359
The ACPI generic timer attachment added 3 interrupts, but missed the
hypervisor physical interrupt. As the field is present in all versions
of the GTDT ACPI table and isn't an optional interrupts we can add it
to the interrupts provided to the driver.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43974
When booting in the hypervisor state we need to use the hypervisor
interrupt in the generic timer. In this case the registers we access
in the kernel are remapped to the EL2 versions, however this causes
an unexpected interrupt to trigger.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43975
When booting the kernel with VHE it will be running at EL2. The current
config register values only enable the reaces at EL1 when tracing the
kernel.

Set the HMC flag to also trap from EL2.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45121
When calling dxr_init(), the FIB_ALGO infrastructure may provide a
pointer to a previous dxr instance, which permits reuse of auxiliary
dxr structures, i.e. incremental lookup structure updates.  For dxr this
is a crucial feature provided by FIB_ALGO, since dxr incremental updates
are typically several orders of magnitude faster than full lookup table
rebuilds.

However, the auxiliary dxr structure caches a pointer to struct fib_data and
relies upon it for performing incremental updates.  Apparently, incremental
rebuild requests from FIB_ALGO, i.e. a calls to dxr_init() with a pointer
old_data set, may (under not yet fully understood circumstances) be invoked
within a different fib_data context than the one cached in the previous
version of dxr auxiliary structures.  In such (rare) events, we ignore the
offered old dxr context, and proceed with a full lookup structure rebuild
instead of attempting an incremental one using a fib_data context which
may or may not no longer be valid, and thus lead to a system crash.

PR:		278422
MFC after:	1 week
In e820_finalize(), the e820_fwcfg_item variable, containing the
etc/e820 file (for the e820 table from the BIOS) is not free()'d when it
could not be added to the QEMU firmware configuration device (fw_cfg).

Reported by:	Coverity Scan
CID:		1522761
Reviewed by:	corvink, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45223
DXR lookup table encoding has an inherent structural limit on the amount
of binary search ranges it can accomodate.  With the current IPv4 BGP views
(circa 1 M prefixes) and default DXR encoding we are only at around 5% of
that limit, so far, far away from hitting it.  Just in case it ever gets
hit, make sure we free the allocated structures, instead of leaking it.

MFC after:	1 week
The !DXR2 code corresponds to the original DXR encoding proposal from
2012 with a single direct-lookup stage, which is inferior to the more
recent (DXR2) variant with two-stage trie both in terms of memory
footprint of the lookup structures, and in terms of overall lookup
througput.

I'm axing the old code chunks to (hopefully) somewhat improve readability,
as well as to simplify future maintenance and updates.

MFC after:	1 week
These symbols are present on amd64 or i386.

Reported by:	kaktus, jhibbits
Fixes:		98c8caa libgcc_s: 80-bit long double function are x86-only
An assert() was setting the error variable instead of checking it.

Reported by:	Coverity Scan
CID:		1521431
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Pull Request:	freebsd/freebsd-src#1244
GCC 13 supports _Float16 and __int128 on fewer architectures than clang
and thus libcxxrt compiled with gcc13 is sometimes missing related
symbols.  Hack around this by explicitly appending --undefined-version
to LDFLAGS in problematic cases.

Reviewed by:	theraven, dim
Differential Revision:	https://reviews.freebsd.org/D45233
Mark powerpc* and riscv broken.

Refactor and add a TRY_GCC_BROKEN option to build anyway.  This
simplifies things for people trying to get gcc builds working
while letting other developers know that they aren't expected to work.

Reviewed by:	jhb, emaste
Improves:	4c0dfd5 arm: fail early on gcc builds
Differential Revision:	https://reviews.freebsd.org/D45230
MFC after:	1 week
Sponsored by:	Chelsio Communications
MFC after:      1 week
Sponsored by:   Chelsio Communications
PR:		278988
Reviewed by:	bapt
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45220
@bsdjhb bsdjhb merged commit b1bce6e into CTSRD-CHERI:dev Aug 29, 2024
29 checks passed
@bsdjhb bsdjhb deleted the merge-freebsd-20240517 branch August 29, 2024 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.