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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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