Commit graph

287581 commits

Author SHA1 Message Date
Mark Bloch 45e2e55df6 mlx5: Add packet reformat support to flow rules
Allow attaching a packet reformat action to a flow rule.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch 847542c60c mlx5: Add modify header support to flow rules
Allow attaching a modify header to a flow rule.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch cb054a493a mlx5: Refactor flow actions into a struct
Create a struct to hold flow actions to be used when creating
a flow rule.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch bb4645b95b mlx5: Add packet reformat allocation support
Add support to allocating a packet reformat context.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:16 +02:00
Mark Bloch e4f84168b3 mlx5: Add modify header support
Add support to allocating a modify header context.

Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2023-11-16 01:08:15 +02:00
Warner Losh b2376a5f1e Revert "awk: Merge upstream 2nd Edition Awk Book"
The pre-push testing I did turned out to be testing the old version with
the old testsuite (for reasons I don't understnad). There's issues with
the new version, the new test in the suite or (likely) both. Revert
until they can be chased down.

This should also fix the github CI that's gone red since this commit.

This reverts commit 3fd60a6b73, reversing
changes made to 194df014fe.

Sponsored by:		Netflix
2023-11-15 15:28:05 -07:00
Andrew Gallatin 6f38d2e7b0 acpi: Add workaround for Altra I2C memory resource
Submitted by: allanjude
Sponsored by: Ampere Computing LLC
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D28741
2023-11-15 16:25:00 -05:00
Andrew Turner 257b044548 arm64: Correct a comment in locore.S
We now use the physical address of get_load_phys_addr. Use it in a
comment rather than the old symbol.

Sponsored by:	Arm Ltd
2023-11-15 18:13:39 +00:00
Andrew Turner 9eecef0521 Add an Armv8 rndr random number provider
Armv8.5 adds an optional random number generator. This is implemented
as two special registers one to read a random number, the other to
re-seed the entropy pool before reading a random number. Both registers
will set the condition flags to tell the caller they can't produce a
random number in a reasonable amount of time.

Without a signal to reseed the entropy pool use the latter register
to provide random numbers to the kernel pool. If at a later time we
had a way to tell the provider if it needs to reseed or not we could
use the former.

On an Amazon AWS Graviton3 VM this never failed, however this may not
be the case on low end CPUs so retry reading the random number 10 times
before returning an error.

Reviewed by:	imp, delphij (csprng)
Sponsored by:	The FreeBSD Foundation
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D35411
2023-11-15 18:05:08 +00:00
Andrew Turner 61f14f1da3 arm64: Clean up finding our load address
Use the linker to pre-calculate the offset of a known symbol from
KERNBASE, and use this to find the physical address KERNBASE should
map to.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42568
2023-11-15 18:05:08 +00:00
Andrew Turner ba31362694 arm64: Make kern_delta unneeded in the boot params
Use pmap_early_vtophys to translate from a virtual to physical where
we were previously using the calculated delta. This means that, while
we still calculate it, we don't need to pass it to initarm or either
pmap bootstrap functions.

While here remove an unneeded printf that indirectly used it or was
related to the previous printf.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42567
2023-11-15 18:05:08 +00:00
Andrew Turner 5fae53589e arm64: Use pmap_early_vtophys in pmap_bootstrap_san
Use pmap_early_vtophys to find the physical address of the kernel base
rather than using the calculated offset as it will be removed in a
latter commit.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42566
2023-11-15 18:05:08 +00:00
Andrew Turner 7eb26be9c8 arm64: Use adrp + :lo12: to load globals from asm
When loading a global variable we can use a pseudo-instruction similar
to "ldr, xn, =global" to load the address of the symbol. As this is
unlikely to be supported by a mov instruction a pc-relative load is
used, with the absolute address written at the end of the function so
it will be loaded.

This load can be partially replaced with an adrp instruction. This
generates the address, aligned to a 4k boundary, using a pc-relative
addition. Because the address is 4k-aligned we then update reading the
global variable using a load with the offset of the load the low
12-bits of the global. Arm64 assemblers have :lo12: to support this,
e.g. "ldr xn, [xn, :lo12:global]".

The only remaining users of "ldr, xn, =global" that I can find are
executed from the physical address space the kernel was loaded in and
need an address in the kernels virtual address space. Because of this
they can't use adrp.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42565
2023-11-15 18:05:08 +00:00
Brooks Davis 1ca63a8219 libc: Remove empty comments in Symbol.map
These were left over from $FreeBSD$ removal.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D42612
2023-11-15 17:51:03 +00:00
Brooks Davis b73eace889 libc/<arch>/sys/Makefile.inc: remove cruft
Remove stray blank lines left over from $FreeBSD$ removal as well as
some CVS-era (perhaps pre-repocopy) version comments.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D42611
2023-11-15 17:50:53 +00:00
Brooks Davis b146e5e68a git-blame-ignore-revs: OptionalObsoleteFiles.inc sorting commits
Add sorting commits.  This causes (suitably configured) git blame to
ignore the moving of blocks, correcting the associated commit for ~300
lines.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D42602
2023-11-15 17:47:02 +00:00
Brooks Davis afe1e6ba86 Sort .git-blame-ignore-revs by commit order
This makes it easier to add blocks of commits such as
4ca5df80393e1f2..c90d0600ee000e78 which do a single thing over the
course of multiple commits.  Sorting by hash would require manually
inserting each one with a comment.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D42601
2023-11-15 17:46:57 +00:00
Andrew Gallatin ba0e4d7971 smbios: handle smbios3 for arm64
Get smbios working on arm64 where it seems to be
exclusively smbios version 3.x

The "interesting" thing here is that the smbios table seems to be
RAM in the EFI runtime services table. This makes it owned by "ram0",
and not io memory. That prevents bus_alloc_resource() from being able
to claim it, since ram0 already owns it. According to jhb, this is
how things are supposed to work.  Eg, bus_alloc_resource() is meant
to be used with IO memory, not physical memory.  Following his
suggestion, I converted the driver to simply use pmap_mapbios().

This is a prerequisite for getting IPMI to attach via the SSIF
attachment on arm64 servers, where all IPMI that I've seen
uses SSIF.

Note that this change is based on initial work by Allan Jude in
https://reviews.freebsd.org/D28739.

Reviewed by: imp
Sponsored by: Netflix, Ampere Computing LLC (D28739)
Differential Revision: https://reviews.freebsd.org/D42592
2023-11-15 11:20:04 -05:00
Doug Moore 2a4897bd4e vm_phys: fix freelist_contig
vm_phys_find_freelist_contig is called to search a list of max-sized
free page blocks and find one that, when joined with adjacent blocks
in memory, can satisfy a request for a memory allocation bigger than
any single max-sized free page block. In commit
fa8a6585c7, I defined this function in
order to offer two improvements: 1) reduce the worst-case search time,
and 2) allow solutions that include less-than max-sized free page
blocks at the front or back of the giant allocation. However, it turns
out that this change introduced an error, reported in In Bug
274592. That error concerns failing to check segment boundaries. This
change fixes an error in vm_phys_find_freelist_config that resolves
that bug. It also abandons improvement 2), because the value of that
improvement is small and because preserving it would require more
testing than I am able to do.

PR:		274592
Reported by:	shafaisal.us@gmail.com
Reviewed by:	alc, markj
Tested by:	shafaisal.us@gmail.com
Fixes:	fa8a6585c7 vm_phys: avoid waste in multipage allocation
MFC after:	10 days
Differential Revision:	https://reviews.freebsd.org/D42509
2023-11-15 03:25:45 -06:00
John Baldwin ede077bf2a sys: Disable -Walloc-size-larger-than for GCC 9+
By default this warns about sizes larger than PTRDIFF_MAX passed to
malloc (rather than SIZE_MAX).  This doesn't trigger
deterministically, but it does trigger for kmalloc() of struct_size()
in iwlwifi's iwl_configure_rxq even when struct_size() is changed to
use PTRDIFF_MAX.  NB: struct_size() in Linux caps the size at
SIZE_MAX, not PTRDIFF_MAX via size_mul().

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42587
2023-11-14 18:37:25 -08:00
John Baldwin be909a79a8 qlnx: Fix a couple of type mismatches in function declarations
Reported by:	GCC 13 via -Wenum-int-mismatch
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42586
2023-11-14 18:37:06 -08:00
John Baldwin 7aa5b2a9e7 ocs: Fix a couple of type mismatches in function prototypes
Reported by:	GCC 13 via -Wenum-int-mismatch
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42585
2023-11-14 18:36:48 -08:00
John Baldwin 1e65df6840 ath_hal: Fix a couple of type mismatches in function prototypes
Reported by:	GCC 13 via -Wenum-int-mismatch
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42584
2023-11-14 18:36:32 -08:00
John Baldwin cc61bf9ecc snmp_wlan: Fix a couple of type mismatches in function prototypes
Reported by:	GCC 13 via -Wenum-int-mismatch
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42582
2023-11-14 18:36:03 -08:00
John Baldwin 5fc8ed9313 makefs: Quiet a -Wdangling-pointer warning in cd9660_generate_path_table
This function temporarily stores a pointer to an on-stack variable (a
TAILQ_HEAD of a temporary list) into a global variable (*n).

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D42581
2023-11-14 18:35:44 -08:00
John Baldwin c06962057b makefs cd9660: Unexpand a few TAILQ macros
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42580
2023-11-14 18:35:27 -08:00
John Baldwin 28fc837b70 bsd.sys.mk: Disable -Wdangling-reference for GCC 13+
GCC raises this warning for libc++'s istream.  It raises false
positives in other cases as well (GCC bugs 109640, 109642, 109671).

Warning from <istream>:

/usr/include/c++/v1/istream:1464:34: error: possibly dangling reference to a temporary [-Werror=dangling-reference]
 1464 |             const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
      |                                  ^~~~
/usr/include/c++/v1/istream:1464:71: note: the temporary was destroyed at the end of the full expression 'std::__1::use_facet<ctype<char> >(std::__1::ios_base::getloc() const())'
 1464 |             const ctype<_CharT>& __ct = std::use_facet<ctype<_CharT> >(__is.getloc());
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42579
2023-11-14 18:35:04 -08:00
John Baldwin ab43851b0c Merge commit 3537338d1ab9 from llvm git (by Nikolas Klauser):
[libc++][libunwind] Fixes to allow GCC 13 to compile libunwind/libc++abi/libc++

    These are changes to allow GCC 13 to successfully compile the runtimes stack.

    Reviewed By: ldionne, #libc, #libunwind, MaskRay

    Spies: MaskRay, zibi, SeanP, power-llvm-team, mstorsjo, arichardson, libcxx-commits

    Differential Revision: https://reviews.llvm.org/D151387

Reviewed by:	imp, dim, emaste
Differential Revision:	https://reviews.freebsd.org/D42578
2023-11-14 18:34:45 -08:00
John Baldwin 0355ecace8 libgpio: Fix type mismatch for gpio_pin_[gs]et
Reported by:	GCC 13 via -Wenum-int-mismatch
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42577
2023-11-14 18:34:21 -08:00
John Baldwin b7f7cc25c0 libcasper: Neuter false positive -Wuse-after-free warnings from GCC 13
GCC 13 incorrectly thinks a call to free after a failed realloc is a
use after free.

lib/libcasper/services/cap_grp/cap_grp.c: In function 'group_resize':
lib/libcasper/services/cap_grp/cap_grp.c:65:17: error: pointer 'buf' may be used after 'realloc' [-Werror=use-after-free]
   65 |                 free(buf);
      |                 ^~~~~~~~~
lib/libcasper/services/cap_grp/cap_grp.c:63:19: note: call to 'realloc' here
   63 |         gbuffer = realloc(buf, gbufsize);
      |                   ^~~~~~~~~~~~~~~~~~~~~~

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D42576
2023-11-14 18:34:01 -08:00
Cy Schubert b50261e21f libevent: Import libevent 2.1.12
MFC after:	2 weeks

Merge commit '5223d1d95fddcef6f9a36e264a5800bd907ade8b' into main
2023-11-14 17:13:02 -08:00
Stephen J. Kiernan fa08011a52 zoneinfo: fix makefile rules script
In make target rules, one needs to use subshell if there are
change directory commands that should only have an effect on the
other commands in the same line. Otherwise, if make is not running in
compatibility mode (for example, when -j flag is specified), commands
would be executed in a single shell and lines following the "cd" might
not work as expected.

Adjust the target script lines that use "cd" to run in a subshell
by adding appropriate parenthesis.

Reviewed by:	sjg
Differential Revision:        https://reviews.freebsd.org/D42608
2023-11-14 19:51:40 -05:00
Cy Schubert 5223d1d95f libevent: Import libevent 2.1.12 2023-11-14 15:02:42 -08:00
Alexander Motin 35da345160
L2ARC: Restrict write size to 1/4 of the device
PR #15457 exposed weird logic in L2ARC write sizing. If it appeared
bigger than device size, instead of liming write it reset all the
system-wide tunables to their default.  Aside of being excessive,
it did not actually help with the problem, still allowing infinite
loop to happen.

This patch removes the tunables reverting logic, but instead limits
L2ARC writes (or at least eviction/trim) to 1/4 of the capacity.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Amanakis <gamanakis@gmail.com>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #15519
2023-11-14 13:47:57 -08:00
Justin Hibbits 8ef8939fd4 bcm2835/spi: Support SPI_FLAG_KEEP_CS
Summary:
3c08673438 brought in SPI_FLAG_KEEP_CS to keep the SPI chip select held
post-transfer completion.  Add this support to bcm2835 SPI for SPI
devices that need it.  As part of this, the owner thread needed carried
through so that no other thread can take over the SPI bus until the
owner releases the chip select.

Reviewed by:	manu
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D42599
2023-11-14 16:47:35 -05:00
George V. Neville-Neil 029848334f Address review feedback on a typo.
Reviewed by:	jhb, gbe
Differential Revision:	<https://reviews.freebsd.org/D42096>
2023-11-14 16:09:50 -05:00
George V. Neville-Neil b2e41172bd A skeleton kernel module suitable for creating new such modules. 2023-11-14 16:08:13 -05:00
Chunwei Chen da51bd17e5
Fix snap_obj_array memory leak in check_filesystem()
Use goto out instead of return for early exit to make sure
snap_obj_array is freed.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@nutanix.com>
Closes #15516
2023-11-14 12:59:02 -08:00
Tony Hutter 2319656802
Linux 6.6 compat: META
Update the META file to reflect compatibility with the 6.6 kernel.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #15520
2023-11-14 09:55:28 -08:00
Robert Clausecker b49596de26 lib/libc/tests/string: add extended unit tests for strcmp()
This changeset add a new set of tests that comprehensively test strcmp() on
various alignments of the input. This made it easy to smoke out many
exciting new bugs in the new SSE strcmp() implementation from D41971.

MFC after:	1 week
Reviewed by:	ngie
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41970
2023-11-14 12:37:06 -05:00
Brooks Davis 4cd0f014a1 OptionalObsoleteFiles.inc: document block order
Options should be in sort(1) order by primary option (usually, but not
always, first in the if statement).

Reviewed by:	emaste, imp, netchild
Pull Request:	https://github.com/freebsd/freebsd-src/pull/896
2023-11-14 16:50:52 +00:00
Brooks Davis c90d0600ee Sort MK_NETLINK option
Reviewed by:	emaste, imp, netchild
Pull Request:	https://github.com/freebsd/freebsd-src/pull/896
2023-11-14 16:50:01 +00:00
Brooks Davis 2b3bf27da4 Sort MK_GNU_DIFF option
Reviewed by:	emaste, imp, netchild
Pull Request:	https://github.com/freebsd/freebsd-src/pull/896
2023-11-14 16:49:59 +00:00
Brooks Davis fb173fc89e Combine and sort MK_LLVM_COV
These used to be grouped with MK_GCOV option or the like.

Reviewed by:	emaste, imp, netchild
Pull Request:	https://github.com/freebsd/freebsd-src/pull/896
2023-11-14 16:49:55 +00:00
Brooks Davis 16743f0e0b Sort MK_EFI and MK_FTP options
Reviewed by:	emaste, imp, netchild
Pull Request:	https://github.com/freebsd/freebsd-src/pull/896
2023-11-14 16:49:53 +00:00
Brooks Davis a62cefbb5c Sort MK_DTRACE and MK_ZFS options
Presumably these were under MK_CDDL at some point, but these days
src.opts.mk takes care of setting them to "no" when MK_CDDL is.

Reviewed by:	emaste, imp, netchild
Pull Request:	https://github.com/freebsd/freebsd-src/pull/896
2023-11-14 16:49:50 +00:00
Brooks Davis e70ad278f4 Sort MK_HYPERV option
Reviewed by:	emaste, imp, netchild
Pull Request:	https://github.com/freebsd/freebsd-src/pull/896
2023-11-14 16:49:47 +00:00
Brooks Davis 4ca5df8039 Sort MK_BSD_CPIO before MK_BSDINSTALL
Using sort(1) order makes verification of the sort easier.

Reviewed by:	emaste, imp, netchild
Pull Request:	https://github.com/freebsd/freebsd-src/pull/896
2023-11-14 16:49:41 +00:00
Eugene Grosbein 20e1f207cc ng_ipfw: allow use of 32 bits wide cookies
There is no reason in truncating 32 bits cookie value to 16 bits.

Reviewed by:	glebius
MFC after:	2 weeks
2023-11-14 16:36:08 +07:00
Baptiste Daroussin 051d69d6f8 pkgbase: create package with SRCRELDATE not OSRELDATE as OSVERSION
In 188fe88ec5 OSVERSION has been set
to OSRELDATE which is the RELDATE of the building OS while we wanted
to use SRCRELDATE which is the RELDATE of the target system
2023-11-14 08:43:15 +01:00