Commit graph

287508 commits

Author SHA1 Message Date
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
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
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
Baptiste Daroussin 030af1b62d pkgbase: set the prefix of debug files and macros to /usr/src
When the macro PACKAGE_BUILDING is set, then consider we are building package
for pkgbase, this has already been used in Makefile.inc1 and reuse the
PACKAGE_BUILDING macros already used for that purpose in the ports tree

In the future this should be tied to REPRODUCIBLE_BUILD

MFC After:	3 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D42569
2023-11-14 08:43:15 +01:00
Warner Losh 3fd60a6b73 awk: Merge upstream 2nd Edition Awk Book
Merge in the November 2nd, 2023 version of one true awk.

This brings in Unicode support, CSV support and a number of bug fixes.

Sponsored by:		Netflix
Reviewed by:		delphij
Differential Revision:	https://reviews.freebsd.org/D42447
2023-11-13 21:49:34 -07:00
Andrey V. Elsukov 194df014fe ipfw: fix copy&paste bug for number:array tables
Use compare_numarray() method for binary search. This fixes
table lookups for keys greater than UINT16_MAX.

Obtained from:	Yandex LLC
MFC after:	1 week
Sponsored by:	Yandex LLC
2023-11-14 07:37:04 +03:00
John Baldwin 9b57e30cf5 abort2: Generate a core dump
Call sigexit rather than exit1 so that a core is generated.

If running the SIGABRT handler is desired, this would need to use
kern_psignal() instead.  In that case a userspace wrapper in libc
would be needed to force an exit if the handler doesn't exit.  Given
that abort2(2)'s intended use case is when userland is in a
sufficiently bad state such that it can't safely call syslog(3) before
abort(3), a userspace abort2(3) wrapper in libc might be dubious.

Reviewed by:	Olivier Certner <olce.freebsd@certner.fr>, emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D42163
2023-11-13 17:00:52 -08:00
Andrew Gallatin ab063ac444 ipmi_ssif: Fix typo in debug print
Fix a typo in a debug print that prevents compilation.

Sponsored by: Netflix
2023-11-13 19:46:56 -05:00
Cy Schubert 6726773431 Unbound: Manually update version strings
This was missed earlier today.

Reported by:	"Herbert J. Skuhra" <herbert@gojira.at>
Fixes:		16fd0b2491
MFC:		2 weeks
2023-11-13 16:46:12 -08:00
Cy Schubert 5aab39b24c Unbound: Remove backup file brought in from upstream
Upstream tarball included config.h~.

This was previously manually removed from vendor where in fact it
should not have been as it would have caused a merge conflict.

Reported by:	"Herbert J. Skuhra" <herbert@gojira.at>
MFC:		2 weeks
2023-11-13 16:46:12 -08:00
John W. O'Brien 99132daf6f rc.d/ldconfig: Prepend rtld stdlib paths to ldconfig(32)_paths
Ensure that ldconfig-managed elf and elf32 hints always include
the standard library paths that are known independently to rtld.

PR:			275031
Reviewed by:		kib
MFC after:		2 weeks
Sponsored by:		Saltant Solutions LLC
Differential Revision:	https://reviews.freebsd.org/D42557
2023-11-14 01:39:17 +02:00
Brooks Davis da8238d6cf libc: fix typo in Makefile comment
MFC after:	1 week
2023-11-13 23:05:11 +00:00
Konstantin Belousov 23210f538a vn_copy_file_range(): busy both in and out mp around call to VOP_COPY_FILE_RANGE()
This is required e.g. for nullfs to ensure liveness of the lower mount
points.

Reviewed by:	jah, rmacklem, Olivier Certner <olce.freebsd@certner.fr>
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42554
2023-11-14 00:26:34 +02:00
Konstantin Belousov 89188bd6ba vn_copy_file_range(): use local variables for invp/outvp vnodes v_mounts
This avoids possible NULL dereference when checking mnt_vfc names.

Reviewed by:	jah, rmacklem, Olivier Certner <olce.freebsd@certner.fr>
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D42554
2023-11-14 00:26:28 +02:00
Cy Schubert 103ba509e7 unbound: Vendor import 1.19.0
Release notes at
    https://www.nlnetlabs.nl/news/2023/Aug/30/unbound-1.19.0-released/

MFC after:	2 weeks

Merge commit '16fd0b24910488e59ca1941387b9ac7fb646a837' into unbound
2023-11-13 13:38:45 -08:00
Brooks Davis ec4c2adb50 Retire LLD_IS_LD option
The option was added to parallel the CLANG_IS_CC which was removed in
commit 20a66ab4bf.

Reviewed by:	imp, dim, emaste
Differential Revision:	https://reviews.freebsd.org/D42575
2023-11-13 21:34:14 +00:00
Brooks Davis f64a688dfd Remove gratuitous copyouts of unchanged struct mac.
The get operations change the data pointed to by the structure, but do
not update the contents of the struct.

Mark the struct mac arguments of mac_[gs]etsockopt_*label() and
mac_check_structmac_consistent() const to prevent this from changing
in the future.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D14488
2023-11-13 21:32:15 +00:00
Cy Schubert 16fd0b2491 unbound: Vendor import 1.19.0
Release notes at
    https://www.nlnetlabs.nl/news/2023/Aug/30/unbound-1.19.0-released/
2023-11-13 11:44:16 -08:00
Warner Losh 0e80440647 busdma: Add deferred time measurement to arm and powerpc
Add the forgotten field to these implementations as well.

Pointy hat to: me (make universe vs make tinderbox)
Fixes: 20f8814cd3
Sponsored by: Netflix
2023-11-13 12:25:56 -07:00
Warner Losh 49025a1109 _bus.h: Use standard licnese text
All of these used the 'immediately at beginning' variation of the
BSD-2-Clause license. This wasn't intentional, just what I copied from
from a random file in the tree back in 2005. It was not an intentional
decision.

The different arch bus.h files are a mix of BSD-2-Clause and
BSD-4-Clause that have various copyright holders (Charles M. Hannum,
Christopher G. Demetriou, The NetBSD Foundation and KATO Takenori), and
some of the content of these files were likely copied from there.
However, apart from the uncopyrightable interface lines, there are very
few comments. It's unclear if these comments are 'original material'
here to copyright, but to the extent that there is, license it under the
standard BSD-2-Clause copyright that's the norm for the project today.
In any event, the standard BSD-2-Clause is also closer to those
originals.

In addition, FreeBSD uses different type definitions than the original
NetBSD code in part. The comments that were copied have been copied a
lot, but appear in NetBSD's bus.h files in NetBSD 1.3.

While I'm here, assign the copyright, to the extent any exists from me,
to the FreeBSD Foundation. I just cut and pasted these into _bus.h from
the different machine files and those files have a rich history of
modification from the original imports from NetBSD over more than 25
years so it's tricky to say who, exactly, wrote each bit. Given the size
of the files, this seems like the best compromise.  Also add an
acknowledgement to the NetBSD 1.3 bus.h files and their authors (there
were no additional FreeBSD authors listed in the various
sys/*/include/bus.h files). Finally, use the SPDX identifier instead of
multiple copies of the text.

Differential Revision:	https://reviews.freebsd.org/D42532
Sponsored by:		Netflix
2023-11-13 12:25:30 -07:00
Bojan Novković c6d7be2148 tty: properly check character position when handling IUTF8 backspaces
The tty_rubchar() code handling backspaces for UTF-8 characters didn't
properly check whether the beginning of the current line was reached.
This resulted in a kernel panic in ttyinq_unputchar() when prodded with
certain malformed UTF-8 sequences.

Fixes:		PR 275009
Reviewed by:	christos
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D42564
2023-11-13 20:04:11 +02:00
Cy Schubert 7963e41154 sqlite3: Vendor import of sqlite3 3.44.0
Release notes at https://www.sqlite.org/releaselog/3_44_0.html.

Obtained from:  https://www.sqlite.org/2023/sqlite-autoconf-3440000.tar.gz
MFC after:	2 weeks

Merge commit '3a88fe13354325b9f56f07927e654de4f5398707'
2023-11-13 08:50:36 -08:00