]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
23 months agompc85xx/pci: Conditionally reset PCI bridges
Justin Hibbits [Sat, 30 Jul 2022 01:43:42 +0000 (21:43 -0400)]
mpc85xx/pci: Conditionally reset PCI bridges

Sometimes we need to reset a PCIe bus, but sometimes it breaks the
downstream device(s).  Since, from my testing, this is only needed for
Radeon cards installed in the AmigaOne machines because the card was
already initialized by firmware, make the reset dependent on a device
hint (hint.pcib.X.reset=1).  With this, AmigaOne X5000 machines can have
other devices in the secondary PCIe slots.

23 months agoIntroduce and use the NET_EPOCH_DRAIN_CALLBACKS() macro
Zhenlei Huang [Fri, 29 Jul 2022 13:02:39 +0000 (15:02 +0200)]
Introduce and use the NET_EPOCH_DRAIN_CALLBACKS() macro

Reviewed by: melifao, kp
Differential Revision: https://reviews.freebsd.org/D35968

23 months agovmd: Add 8086:A77F PCI ID for all Intel Raptor Lake SKUs
Neel Chauhan [Fri, 29 Jul 2022 18:06:06 +0000 (11:06 -0700)]
vmd: Add 8086:A77F PCI ID for all Intel Raptor Lake SKUs

Summary:
This is based on the Linux kernel commit
922bfd001d1ac02111ebbe0524aaab6ca7925521.

Reviewed by: mav (src)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D35996

23 months agoFix for 90e2971 that caused some geli commands to return the wrong exit status.
Kirk McKusick [Fri, 29 Jul 2022 18:11:09 +0000 (11:11 -0700)]
Fix for 90e2971 that caused some geli commands to return the wrong exit status.

The reported problem is that some geli commands exit with a
success status when they should exit with a failed status.

The gctl_error() function is defined differently in the kernel
(in sys/geom/geom_ctl.c) versus in the geom user facilities (in
sbin/geom/misc/subr.c). In the kernel, calling gctl_error() causes
an error return to be set while in the user version it does not.
It was only by a quirk that had been added to the user geom return
processing that I "cleaned up" that the lack of the user implementaion
to set the error return showed up.

This patch adds the missing setting of the error code when calling
the user facility gctl_error().

Reported by:  Jenkins
Debugging by: Alan Somers
Debugging by: Cy Schubert
Debugging by: Li-Wen Hsu

23 months agoLinuxKPI: 802.11 header updates
Bjoern A. Zeeb [Fri, 29 Jul 2022 15:23:49 +0000 (15:23 +0000)]
LinuxKPI: 802.11 header updates

While working on new and updates to drivers more structs, fields,
functions, .. were found, had to be shuffled around, ..
Some of these are (so far still dummy) functions or not properly
typed fields.  The IEEE80211_HE_ constants are all still dummy.
This was msotly as a start to make new (out-of-tree) things compile.

Sponsored by: The FreeBSD Foundation (minor VHT/chan width bits)
MFC after: 1 week

23 months agoLinuxKPI: skbuff: sort list header and add new (dummy) functions
Bjoern A. Zeeb [Fri, 29 Jul 2022 15:21:48 +0000 (15:21 +0000)]
LinuxKPI: skbuff: sort list header and add new (dummy) functions

While working on new and updates to drivers more skbuff changes
came up.  Sort out the list/prev/next header problem and add more
(so far dummy) functions needed.

MFC after: 1 week

23 months agonet80211: change order in ieee80211_vhtchanflags()
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:18:48 +0000 (00:18 +0000)]
net80211: change order in ieee80211_vhtchanflags()

While 80P80 is less likely to be used, VHT160 (a single contiguous
width) is harder to acquire but also preferable so return that first.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by:    adrian
Differential Revision: https://reviews.freebsd.org/D35977

23 months agonet80211: VHT correct check/option in ieee80211_vht_adjust_channel()
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:12:34 +0000 (00:12 +0000)]
net80211: VHT correct check/option in ieee80211_vht_adjust_channel()

In ieee80211_vht_adjust_channel() we have to check for all possible
IEEE80211_FVHT_VHT* options using the mask rather than just checking
for IEEE80211_FVHT_VHT;  ieee80211_vhtchanflags() (contrary to its
HT counterpart) only returns the "highest" flag nor or-ing them together
with the base flag.  For the moment this seems to make sense as with
more width options we'd add a pyramid.

Later on, in the same function when we get VHT160 actually go and look
for VHT160 and not VHT80.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

23 months agonet80211: add VHT5G and VHT2G checks/return to media_status
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:10:34 +0000 (00:10 +0000)]
net80211: add VHT5G and VHT2G checks/return to media_status

Add the fields for VHT (2Ghz and 5Ghz) to report back by media_status
so we actually have a chance to get the right information.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

23 months agonet80211: improve DDB output.
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:05:51 +0000 (00:05 +0000)]
net80211: improve DDB output.

Start adding more fields to DDB output related to VHT (11ac) and
mark COM, VAP, and STA more explicitly to make show all vaps /..
more readable.

Sponsored by: The FreeBSD Foundaton
MFC after: 1 week
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

23 months agonet80211: correct IEEE80211_FEXT_BITS
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:03:37 +0000 (00:03 +0000)]
net80211: correct IEEE80211_FEXT_BITS

Correct IEEE80211_FEXT_BITS adding the missed one and move the later
one further.  This will actually make VHT to show.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

23 months agonet80211: add more 802.11ac Element IDs
Bjoern A. Zeeb [Thu, 28 Jul 2022 23:59:08 +0000 (23:59 +0000)]
net80211: add more 802.11ac Element IDs

Add more Element IDs for VHT (11ac) to complete the current list
and we can use them if/as needed.

Sposnored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

23 months agonet80211: radiotap: add one more define for HE
Bjoern A. Zeeb [Thu, 28 Jul 2022 23:56:07 +0000 (23:56 +0000)]
net80211: radiotap:  add one more define for HE

Add one more define for HE radiotap used by a driver.

MFC after: 1 week
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

23 months agoip6(4): document IP_ORIGDSTADDR
Alan Somers [Sun, 24 Jul 2022 15:06:39 +0000 (09:06 -0600)]
ip6(4): document IP_ORIGDSTADDR

The option was originally added in r313524, but with incomplete
documentation.

MFC after: 1 week
Reviewed by: karels, gbe (manpages)
Differential Revision: https://reviews.freebsd.org/D35890

23 months agoMove sort to runtime
Doug Rabson [Fri, 29 Jul 2022 09:15:24 +0000 (10:15 +0100)]
Move sort to runtime

Allows pkg bootstrap without having to install FreeBSD-utilities

23 months agoloader: fix powerpc64le ofw loader
Alfredo Dal'Ava Junior [Fri, 29 Jul 2022 08:03:30 +0000 (05:03 -0300)]
loader: fix powerpc64le ofw loader

This is similar to 5d48fb3b16c1496bf415fee620c61cc944b0326d.
With LLVM14 the .data.rel.ro ELF section appears after .data,
making loader behave erractly and kernel is not loaded.
This patch makes ensures the correct order.

Based on discussion at:
            https://github.com/llvm/llvm-project/issues/56306

MFC after: 1 day
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)

23 months agox86/iommu: Reduce DMAR lock contention
Alan Cox [Tue, 26 Jul 2022 06:04:54 +0000 (01:04 -0500)]
x86/iommu: Reduce DMAR lock contention

Replace the DMAR unit's tlb_flush TAILQ by a custom list implementation
that enables dmar_qi_task() to dequeue entries without holding the DMAR
lock.

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35951

23 months agoObsoleteFiles: Fix paths for removed manual pages.
Xin LI [Fri, 29 Jul 2022 05:03:02 +0000 (22:03 -0700)]
ObsoleteFiles: Fix paths for removed manual pages.

23 months agoLinuxKPI 802.11/iwlwifi/rtw88: update KPI
Bjoern A. Zeeb [Thu, 28 Jul 2022 23:39:03 +0000 (23:39 +0000)]
LinuxKPI 802.11/iwlwifi/rtw88: update KPI

Upgrade the argument of (*bss_info_changed) mac80211 ops function call
from 32 to 64 bit.
Add an extra argument to ieee80211_beacon_get_template().

Both changes are needed in order to keep other out-of-tree drivers in
synch and to move forward.

The driver changes were extracted from Linux wireless-testing
7b7090b4c6a906cc7c3e2a460335f705b93f4506 and
6e8912a503759bb8f1f01c5b761d0d45815fa6de.

Sponsored by: The FreBSD Foundation
MFC after: 1 week

23 months agopmap_mapdev: Consistently use vm_paddr_t for the first argument.
John Baldwin [Thu, 28 Jul 2022 22:55:10 +0000 (15:55 -0700)]
pmap_mapdev: Consistently use vm_paddr_t for the first argument.

The devmap variants used vm_offset_t for some reason, and a few places
explicitly cast bus addresses to vm_offset_t.  (Probably those casts
along with similar casts for vm_size_t should just be removed and
instead permit the compiler to DTRT.)

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D35961

23 months agokboot: Make console raw when we start
Warner Losh [Tue, 26 Jul 2022 23:39:45 +0000 (17:39 -0600)]
kboot: Make console raw when we start

Put the console into raw mode on startup. This allows the menus to work
as expected. Boot is now interruptable.

Note: Likely should restore the terminal settings on most exists.  It's
not clear the best way to do this, and most shells have an auto stty
sane anyway, so note it for future improvement.

Sponsored by: Netflix

23 months agokboot: implement stripped down termios
Warner Losh [Tue, 26 Jul 2022 23:31:23 +0000 (17:31 -0600)]
kboot: implement stripped down termios

Implement a stripped down termios, obtained from various files in musl
and HOST_ or host_ prepended to most things and a few unavoidable style
tweaks. Only implements the bits of termios we need for the boot loader:
put the terminal into raw mode, restore terminal settings and speed
stuff.

Sponsored by: Netflix

23 months agokboot: Implement host_ioctl
Warner Losh [Tue, 26 Jul 2022 23:30:30 +0000 (17:30 -0600)]
kboot: Implement host_ioctl

Sponsored by: Netflix

23 months agokboot: Add host_exit and use it to implement exit()
Warner Losh [Thu, 28 Jul 2022 21:18:08 +0000 (15:18 -0600)]
kboot: Add host_exit and use it to implement exit()

Clients of libsa are expected to implement exit(). The current exit just
loops forever. It is better to really exit: when running as init that
will reboot the system. When not running as init, other programs can
recover (not that we support running as init, but when we do in the
future, this is still the rigtht thing).

Sponsored by: Netflix

23 months agokboot: aarch64 support
Warner Losh [Mon, 11 Jul 2022 23:49:11 +0000 (17:49 -0600)]
kboot: aarch64 support

Add support for aarch64. exec.c and ldscript are copied from the EFI
version with #ifdefs for the differences. Once complete, I'll refactor
them. host_syscall.S implements a generic system call. tramp.S is a
first attempt to create a tramoline that we can use to jump to the
aarch64 kernel. Add aarch64-specific startup and stat files as well.
exec.c tweaked slightly to avoid bringing in bi_load(), which will come
in later. Includes tweaks to stat due to name differences between names
on different Linux architectures.

Sponsored by: Netflix

23 months agokboot: Move conf.c up to top level
Warner Losh [Thu, 28 Jul 2022 20:53:25 +0000 (14:53 -0600)]
kboot: Move conf.c up to top level

conf.c is the same now between powerpc64 and amd64, so move it up to
kboot. Move powerpc file formats defines to ppc64_elf_freebsd.c

Sponsored by: Netflix

23 months agoaltq: improve pfctl config time for large numbers of queues
James Skon [Thu, 28 Jul 2022 19:58:31 +0000 (21:58 +0200)]
altq: improve pfctl config time for large numbers of queues

In the current implementation of altq_hfsc.c, whne new queues are being
added (by pfctl), each queue is added to the tail of the siblings linked
list under the parent queue.

On a system with many queues (50,000+) this leads to very long load
times at the insertion process must scan the entire list for every new
queue,

Since this list is unordered, this changes merely adds the new queue to
the head of the list rather than the tail.

Reviewed by: kp
MFC after: 3 weeks
Sponsored by: RG Nets
Differential Revision: https://reviews.freebsd.org/D35964

23 months agohidbus(4): Align refcount checks for hidbus_intr_start() and hidbus_intr_stop().
Hans Petter Selasky [Thu, 23 Jun 2022 13:44:25 +0000 (15:44 +0200)]
hidbus(4): Align refcount checks for hidbus_intr_start() and hidbus_intr_stop().

No functional change intended.

Discussed with: wulf @
MFC after: 1 week
Sponsored by: NVIDIA Networking

23 months agoriscv: Avoid passing invalid addresses to pmap_fault()
Mark Johnston [Thu, 28 Jul 2022 13:38:52 +0000 (09:38 -0400)]
riscv: Avoid passing invalid addresses to pmap_fault()

After the addition of SV48 support, VIRT_IS_VALID() did not exclude
addresses that are in the SV39 address space hole but not in the SV48
address space hole.  This can result in mishandling of accesses to that
range when in SV39 mode.

Fix the problem by modifying VIRT_IS_VALID() to use the runtime address
space bounds.  Then, if the address is invalid, and pcb_onfault is set,
give vm_fault_trap() a chance to veto the access instead of panicking.

PR: 265439
Reviewed by: jhb
Reported and tested by: Robert Morris <rtm@lcs.mit.edu>
Fixes: 31218f3209ac ("riscv: Add support for enabling SV48 mode")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35952

23 months agosrc.libnames.mk: NEED/WANT_COMPAT+static support
Brooks Davis [Thu, 28 Jul 2022 17:54:35 +0000 (18:54 +0100)]
src.libnames.mk: NEED/WANT_COMPAT+static support

Look in _LIB_OBJTOP for all static libraries not just INTERNALLIBs. In
normal operation this is a no-op, but improves the consistency of this
file.

Reviewed by: imp, jhb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35822

23 months agoncal: LT is the country code for Lithuania
Warner Losh [Thu, 28 Jul 2022 17:34:38 +0000 (11:34 -0600)]
ncal: LT is the country code for Lithuania

PR: 265479
MFC After: 3 days

23 months ago/usr/sbin/pkg: don't sleep on fetch failure
John Hood [Thu, 21 Apr 2022 21:39:14 +0000 (17:39 -0400)]
/usr/sbin/pkg: don't sleep on fetch failure

PR: 263458

23 months agodate: remove some ambiguity in tzdata references
Kyle Evans [Wed, 27 Jul 2022 17:30:18 +0000 (12:30 -0500)]
date: remove some ambiguity in tzdata references

The use of 'package' in this could be understood to mean a FreeBSD
package provided by pkg, rather than the fact that we use data provided
by IANA.  Re-word it to clearly identify `tzdata` as the IANA Time Zone
Database on first use, then drop subsequent uses of the word 'package'.

Reviewed by: 0mp, pauamma, philip
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35966

23 months agolagg: fix lagg ifioctl after SIOCSIFCAPNV
Andrew Gallatin [Thu, 28 Jul 2022 14:36:22 +0000 (10:36 -0400)]
lagg: fix lagg ifioctl after SIOCSIFCAPNV

Lagg was broken by SIOCSIFCAPNV when all underlying devices
support SIOCSIFCAPNV.  This change updates lagg to work with
SIOCSIFCAPNV and if_capabilities2.

Reviewed by: kib, hselasky
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D35865

23 months agolibc: ANSIfy div / ldiv function definitions
Ed Maste [Thu, 28 Jul 2022 14:17:33 +0000 (10:17 -0400)]
libc: ANSIfy div / ldiv function definitions

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

23 months agoqat: Add a required MODULE_DEPEND for firmware(9)
Mark Johnston [Thu, 28 Jul 2022 13:48:58 +0000 (09:48 -0400)]
qat: Add a required MODULE_DEPEND for firmware(9)

Reported by: kib
Sponsored by: The FreeBSD Foundation

23 months agoqat_c2xxx: Add a required MODULE_DEPEND for firmware(9)
Mark Johnston [Thu, 28 Jul 2022 13:47:34 +0000 (09:47 -0400)]
qat_c2xxx: Add a required MODULE_DEPEND for firmware(9)

Reported by: kib
Sponsored by: The FreeBSD Foundation

23 months agostyle: Tighten up one use of 'may'
Warner Losh [Thu, 28 Jul 2022 14:01:09 +0000 (08:01 -0600)]
style: Tighten up one use of 'may'

Declarations of variables must be placed before the statements of a
block, by convention. Use 'must' instead of 'may' here and clarify
langauge.

Sponsored by: Netflix
Reviewed by: pstef, rpokala, hselasky
Differential Revision: https://reviews.freebsd.org/D35959

23 months agostyle: Use oxford comma in one place.
Warner Losh [Thu, 28 Jul 2022 13:59:56 +0000 (07:59 -0600)]
style: Use oxford comma in one place.

Suggested by: pauamma
Sponsored by: Netflix

23 months agoStyle(9): Strengthen statements about not using K&R function definitions
Warner Losh [Thu, 28 Jul 2022 13:58:32 +0000 (07:58 -0600)]
Style(9): Strengthen statements about not using K&R function definitions

K&R function definitions will soon be obsolete. Work has been underway
to remove all K&R function definitions from the tree for a while now. A
future C version will remove this construct from the language. So
strengthen existing statements about K&R function definitions and
declarations.

While here, remove __P macro reference. It's not been in active use for
almost two decades apart from legacy contrib code.

Sponsored by: Netflix
Reviewed by: pauamma, rpokala, hselasky, kp, brooks, markm, emaste
Differential Revision: https://reviews.freebsd.org/D35945

23 months agoRevert "csu: test: explicitly add libm as build parameter"
Alfredo Dal'Ava Junior [Wed, 27 Jul 2022 22:10:56 +0000 (19:10 -0300)]
Revert "csu: test: explicitly add libm as build parameter"

This reverts commit 4f5890a0fb086324a657f3cd7ba1abc57274e0db.

9ef1127008ce94cf626daed346a3c1ee03063617 is a proper fix for
the problem we tried to address.

Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)

23 months agokboot: Remove RELOC defines, it's unused
Warner Losh [Thu, 28 Jul 2022 05:11:12 +0000 (23:11 -0600)]
kboot: Remove RELOC defines, it's unused

This was copied from powerpc/ofw and has never been used. We also don't
care about -DAIM. It's only relevant for in-kernel structures, which we
don't use in this userland program.

Sponsored by: Netflix

23 months agokboot: Convert from getdents to getdents64
Warner Losh [Thu, 28 Jul 2022 04:24:50 +0000 (22:24 -0600)]
kboot: Convert from getdents to getdents64

Linux 2.4 introduced getdents64. Switch to using it because aarch64
doesn't have getdents as that syscall was obsoleted before that port was
created.

Sponsored by: Netflix

23 months agokboot: Do a style(9) pass on kbootfdt.c
Warner Losh [Thu, 28 Jul 2022 04:07:52 +0000 (22:07 -0600)]
kboot: Do a style(9) pass on kbootfdt.c

Mostly just properly indent.

Sponsored by: Netflix

23 months agoRemove unnecessary terminating slash in iscsi module Makefile
Dimitry Andric [Wed, 27 Jul 2022 19:04:22 +0000 (21:04 +0200)]
Remove unnecessary terminating slash in iscsi module Makefile

The additional slash causes double slashes in the filenames that
eventually get passed to the compiler.

MFC after: 3 days

23 months agoAdjust function definition in isa's pnp.c to avoid clang 15 warning
Dimitry Andric [Wed, 27 Jul 2022 19:02:51 +0000 (21:02 +0200)]
Adjust function definition in isa's pnp.c to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/isa/pnp.c:118:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    pnp_send_initiation_key()
                           ^
                            void

This is because pnp_send_initiation_key() is declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after: 3 days

23 months agoSuppress possible unused variable warning for icl_soft.c
Dimitry Andric [Wed, 27 Jul 2022 19:00:22 +0000 (21:00 +0200)]
Suppress possible unused variable warning for icl_soft.c

With clang 15, the following -Werror warning is produced on i386:

    sys/dev/iscsi//icl_soft.c:1277:6: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
            int i;
                ^

The 'i' variable is used later in the icl_soft_conn_pdu_get_bio()
function, via the PHYS_TO_DMAP() macro. However, on i386 and some other
architectures, this macro is defined to panic immediately, so in those
cases, 'i' is indeed not used. Suppress the warning by marking 'i' as
unused.

MFC after: 3 days

23 months agobhyve: fix spelling mistake in passthru emulation
Corvin Köhne [Wed, 27 Jul 2022 14:43:01 +0000 (16:43 +0200)]
bhyve: fix spelling mistake in passthru emulation

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35707
Sponsored by: Beckhoff Automation GmbH & Co. KG

23 months agobhyve: Initialize more registers in vcpu_reset()
Corvin Köhne [Wed, 27 Jul 2022 14:41:02 +0000 (16:41 +0200)]
bhyve: Initialize more registers in vcpu_reset()

- Clear CR2, EFER, and R8-15 to zero.
- Reset DR6 and DR7 to their documented reset values.
- Reset interrupt shadow state.
- Document the reason CR0 is reset to a value that doesn't match its
documented value.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35622
Sponsored by: Beckhoff Automation GmbH & Co. KG

23 months agovmm: emulate INVD by ignoring it
Corvin Köhne [Wed, 27 Jul 2022 14:39:47 +0000 (16:39 +0200)]
vmm: emulate INVD by ignoring it

On physical systems the ram isn't initialized on boot. So, coreboot uses
the cache as ram in this boot phase. When exiting cache as ram, coreboot
calls INVD for making the cache consistent.

In a virtual environment ram is always initialized and the cache is
always consistent. So, we can safely ignore this call.

Reviewed by: jhb, imp
Differential Revision: https://reviews.freebsd.org/D35620
Sponsored by: Beckhoff Automation GmbH & Co. KG

23 months agoUpdate to bmake-20220726
Simon J. Gerraty [Wed, 27 Jul 2022 15:58:09 +0000 (08:58 -0700)]
Update to bmake-20220726

Merge commit '31a96ca5f0b6e5f8f7fa8cecf3a5c4354b3b096f'

23 months agoImport bmake-20220726
Simon J. Gerraty [Wed, 27 Jul 2022 15:56:53 +0000 (08:56 -0700)]
Import bmake-20220726

Relevant/interesting changes:

* Auto-create objdir for bmake/unit-tests if appropriate

23 months agoRELNOTES: Fix whitespace
Mark Johnston [Thu, 21 Jul 2022 15:07:33 +0000 (11:07 -0400)]
RELNOTES: Fix whitespace

23 months agoRELNOTES: Add an entry for the new QAT driver
Mark Johnston [Thu, 21 Jul 2022 15:07:11 +0000 (11:07 -0400)]
RELNOTES: Add an entry for the new QAT driver

Sponsored by: The FreeBSD Foundation

23 months agoqat: Import a new Intel (R) QAT driver
Julian Grajkowski [Tue, 19 Jul 2022 08:15:34 +0000 (09:15 +0100)]
qat: Import a new Intel (R) QAT driver

QAT in-tree driver ported from out-of-tree release available
from 01.org.

The driver exposes complete cryptography and data compression
API in the kernel and integrates with Open Crypto Framework.
Details of supported operations, devices and usage can be found
in man and on 01.org.

Patch co-authored by: Krzysztof Zdziarski <krzysztofx.zdziarski@intel.com>
Patch co-authored by: Michal Jaraczewski <michalx.jaraczewski@intel.com>
Patch co-authored by: Michal Gulbicki <michalx.gulbicki@intel.com>
Patch co-authored by: Julian Grajkowski <julianx.grajkowski@intel.com>
Patch co-authored by: Piotr Kasierski <piotrx.kasierski@intel.com>
Patch co-authored by: Adam Czupryna <adamx.czupryna@intel.com>
Patch co-authored by: Konrad Zelazny <konradx.zelazny@intel.com>
Patch co-authored by: Katarzyna Rucinska <katarzynax.kargol@intel.com>
Patch co-authored by: Lukasz Kolodzinski <lukaszx.kolodzinski@intel.com>
Patch co-authored by: Zbigniew Jedlinski <zbigniewx.jedlinski@intel.com>

Reviewed by: markj, jhb (OCF integration)
Reviewed by: debdrup, pauamma (docs)
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D34632

23 months agoqat: Rename to qat_c2xxx and remove support for modern chipsets
Mark Johnston [Wed, 27 Jul 2022 14:55:40 +0000 (10:55 -0400)]
qat: Rename to qat_c2xxx and remove support for modern chipsets

A replacement QAT driver will be imported, but this replacement does not
support Atom C2xxx hardware.  So, the existing driver will be kept
around to provide opencrypto offload support for those chipsets.

Reviewed by: pauamma, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35817

23 months agostand: tftp.c doesn't need bootinfo.h
Warner Losh [Tue, 26 Jul 2022 03:45:35 +0000 (21:45 -0600)]
stand: tftp.c doesn't need bootinfo.h

tftp.c includes bootinfo.h, but doesn't need it. Remove it, and remove
the -Istand/common from CFALGS since that's the only reason we had it.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D35928

23 months agostand: Make sure nobody has a NULL pointer for dv_cleanup
Warner Losh [Wed, 27 Jul 2022 14:46:21 +0000 (08:46 -0600)]
stand: Make sure nobody has a NULL pointer for dv_cleanup

dv_cleanup is specified almost everywhere. Use nullsys instead of NULL
to indicate 'do nothing'. Also, be consistent in trailing commas that
were missing before.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D35913

23 months agostand: Small comment correction
Warner Losh [Wed, 27 Jul 2022 14:46:12 +0000 (08:46 -0600)]
stand: Small comment correction

While in theory, once upon a time, dv_type was arch specific, that's
never been the case in FreeBSD (and certaintly isn't in the surviving
drivers). Remove that notation.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D35911

23 months agostand: Create DEV_NAMLEN for the length of a device name
Warner Losh [Wed, 27 Jul 2022 14:45:59 +0000 (08:45 -0600)]
stand: Create DEV_NAMLEN for the length of a device name

Rather than hard coding 8 for the device name length, create a #define for it.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D35910

23 months agoipsec: Improve validation of PMTU
Kornel Dulęba [Wed, 27 Jul 2022 14:12:34 +0000 (16:12 +0200)]
ipsec: Improve validation of PMTU

Currently there is no upper bound on the PMTU value that is accepted.
Update hostcache only if the new pmtu is smaller than the current entry
and the link MTU.

Approved by: mw(mentor)
Sponsored by: Stormshield
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D35872

23 months agoicmp6: Improve validation of PMTU
Kornel Dulęba [Wed, 20 Jul 2022 07:22:34 +0000 (09:22 +0200)]
icmp6: Improve validation of PMTU

Currently we accept any pmtu between IPV6_MMTU(1280B) and the link mtu.
In some network topologies could allow a bad actor to perform a DOS attack.
Contrary to IPv4 in IPv6 oversized packets are dropped, and a ICMP
PACKET_TOO_BIG message is sent back to the sender.
After receiving an ICMPv6 packet with pmtu bigger than the
current one the victim will start sending frames that will be dropped
a router with reduced MTU.
Although it will eventually receive another message with correct pmtu,
an attacker can still just inject their spoofed packets frequently
enough to overwrite the correct value.
This issue is described in detail in RFC8201, section 6.
Fix this by checking the current pmtu, and accepting the new one only
if it's smaller.

Approved by: mw(mentor)
Reviewed by: tuexen
MFC after: 1 week
Sponsored by: Stormshield
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D35871

23 months agostand: Spell License correctly
Warner Losh [Tue, 26 Jul 2022 22:29:56 +0000 (16:29 -0600)]
stand: Spell License correctly

An e got dropped and then cut and pasted into far too many places.

Sponsored by: Netflix
Noticed by: freqlabs on irc

23 months agosbin/md5.c: fix -q -c for BSD style versions
Stefan Eßer [Tue, 26 Jul 2022 21:04:57 +0000 (23:04 +0200)]
sbin/md5.c: fix -q -c for BSD style versions

The BSD style commands (with names not ending in "sum") ignored the -c
options and the passed digest value when invoked with -q.

The man page stated that -q causes only the calculated digest to be
printed, but did not consider the case of both the -q and -c being
used in combination.

Since there is no warning that -c will be ignored when the -q option
is used, users night (and did) expect that the exit code would reflect
the matching of the calculated digest and the argument passed with -c.

This update implements and documents this expected behavior.

PR: 265461
Reported by: Dmitrij <bugs.freebsd@1fff.net>
MFC after: 2 weeks

23 months agoAuto-create bmake/unit-tests objdir if appropriate
Simon J. Gerraty [Tue, 26 Jul 2022 20:24:34 +0000 (13:24 -0700)]
Auto-create bmake/unit-tests objdir if appropriate

Given the way bmake/unit-tests is visited, when doing 'test'
MK_AUTO_OBJ=yes will not be effective.
So create the objdir before running the sub-make.

Also ensure MAKEOBJDIR is passed to opt-m-include-dir

Reviewed by: deo

23 months agoSuppress unused variable warning for zfs_fm.c
Dimitry Andric [Tue, 26 Jul 2022 20:07:42 +0000 (22:07 +0200)]
Suppress unused variable warning for zfs_fm.c

With clang 15, the following -Werror warning is produced:

    sys/contrib/openzfs/module/zfs/zfs_fm.c:256:6: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable]
            int cnt = 0;
                ^

The 'cnt' variable does not seem to be used for anything, but since this
is contributed code, suppress the warning instead.

MFC after: 3 days

23 months agoFix unused variable warning in amd64's pmap.c
Dimitry Andric [Tue, 26 Jul 2022 19:53:08 +0000 (21:53 +0200)]
Fix unused variable warning in amd64's pmap.c

With clang 15, the following -Werror warning is produced:

    sys/amd64/amd64/pmap.c:8274:22: error: variable 'freed' set but not used [-Werror,-Wunused-but-set-variable]
            int allfree, field, freed, i, idx;
                                ^

The 'freed' variable is only used when PV_STATS is defined. Ensure it is
only declared and set in that case.

MFC after: 3 days

23 months agoFix unused variable warning in usb's atp.c
Dimitry Andric [Tue, 26 Jul 2022 19:46:02 +0000 (21:46 +0200)]
Fix unused variable warning in usb's atp.c

With clang 15, the following -Werror warning is produced:

    sys/dev/usb/input/atp.c:2018:11: error: variable 'n_vertical_scrolls' set but not used [-Werror,-Wunused-but-set-variable]
            u_int8_t n_vertical_scrolls = 0;
                     ^

The 'n_vertical_scrolls' variable is no longer used after 197b9a2ef003,
so remove it.

MFC after: 3 days

23 months agoAdjust function definition in acpi_timer.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 19:35:07 +0000 (21:35 +0200)]
Adjust function definition in acpi_timer.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/dev/acpica/acpi_timer.c:402:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    acpi_timer_test()
                   ^
                    void

This is because acpi_timer_test() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust function definitions in ufs_dirhash.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 19:32:20 +0000 (21:32 +0200)]
Adjust function definitions in ufs_dirhash.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/ufs/ufs/ufs_dirhash.c:1303:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ufsdirhash_init()
                   ^
                    void
    sys/ufs/ufs/ufs_dirhash.c:1319:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ufsdirhash_uninit()
                     ^
                      void

This is because ufsdirhash_init() and ufsdirhash_uninit() are declared
with (void) argument lists, but defined with empty argument lists. Make
the definitions match the declarations.

MFC after: 3 days

23 months agoFix unused variable warning in ffs_snapshot.c
Dimitry Andric [Tue, 26 Jul 2022 19:30:41 +0000 (21:30 +0200)]
Fix unused variable warning in ffs_snapshot.c

With clang 15, the following -Werror warning is produced:

    sys/ufs/ffs/ffs_snapshot.c:204:7: error: variable 'redo' set but not used [-Werror,-Wunused-but-set-variable]
            long redo = 0, snaplistsize = 0;
                 ^

The 'redo' variable is only used when DIAGNOSTIC is defined. Ensure it
is only declared and set in that case.

MFC after: 3 days

23 months agoAdjust function definition in ufs_dirhash.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 19:22:58 +0000 (21:22 +0200)]
Adjust function definition in ufs_dirhash.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/ufs/ufs/ufs_dirhash.c:1252:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    ufsdirhash_lowmem()
                     ^
                      void

This is ufsdirhash_lowmem() is declared with a (void) argument list, but
defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoFix unused variable warning in netipsec's key_debug.c
Dimitry Andric [Tue, 26 Jul 2022 19:21:44 +0000 (21:21 +0200)]
Fix unused variable warning in netipsec's key_debug.c

With clang 15, the following -Werror warning is produced:

    sys/netipsec/key_debug.c:923:9: error: variable 'j' set but not used [-Werror,-Wunused-but-set-variable]
            int i, j;
                   ^

The 'j' variable was in key_debug.c when it was first added, but it
appears to have been a debugging aid that has never been used, so remove
it.

MFC after: 3 days

23 months agoAdjust function definitions in netipsec's key.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 19:15:37 +0000 (21:15 +0200)]
Adjust function definitions in netipsec's key.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/netipsec/key.c:6432:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    key_getcomb_ah()
                  ^
                   void
    sys/netipsec/key.c:6489:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    key_getcomb_ipcomp()
                      ^
                       void

This is because key_getcomb_ah() and key_getcomb_ipcomp() are declared
with (void) argument lists, but defined with empty argument lists. Make
the definitions match the declarations.

MFC after: 3 days

23 months agoAdjust function definition in nd6.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 19:10:58 +0000 (21:10 +0200)]
Adjust function definition in nd6.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/netinet6/nd6.c:247:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    nd6_destroy()
               ^
                void

This is nd6_destroy() is declared with a (void) argument list, but
defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoFix unused variable warning in ieee80211_proto.c
Dimitry Andric [Tue, 26 Jul 2022 19:05:36 +0000 (21:05 +0200)]
Fix unused variable warning in ieee80211_proto.c

With clang 15, the following -Werror warning is produced:

    sys/net80211/ieee80211_proto.c:1070:34: error: variable 'num_mixed' set but not used [-Werror,-Wunused-but-set-variable]
            int num_vaps = 0, num_pure = 0, num_mixed = 0;
                                            ^

The 'num_mixed' variable was in ieee80211_proto.c when the function
vap_update_ht_protmode() was added, but it was never used for anything,
so remove it.

MFC after: 3 days

23 months agoAdjust function definitions in route_ctl.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 18:28:25 +0000 (20:28 +0200)]
Adjust function definitions in route_ctl.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/net/route/route_ctl.c:130:17: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    vnet_rtzone_init()
                    ^
                     void
    sys/net/route/route_ctl.c:139:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    vnet_rtzone_destroy()
                       ^
                        void

This is because vnet_rtzone_init() and vnet_rtzone_destroy() are
declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after: 3 days

23 months agoAdjust function definition in nhop_ctl.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 18:26:46 +0000 (20:26 +0200)]
Adjust function definition in nhop_ctl.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/net/route/nhop_ctl.c:508:21: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    alloc_nhop_structure()
                        ^
                         void

This is alloc_nhop_structure() is declared with a (void) argument list,
but defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoSuppress -Wstrict-prototypes for several zlib files
Dimitry Andric [Tue, 26 Jul 2022 18:24:58 +0000 (20:24 +0200)]
Suppress -Wstrict-prototypes for several zlib files

Clang 15 is more strict about function definitions not matching
declarations, and zlib has a lot of these, but since it is contributed
code (and in K&R style to boot), suppress those warnings instead.

MFC after: 3 days

23 months agoFinish update to bmake-20220724
Simon J. Gerraty [Tue, 26 Jul 2022 18:06:27 +0000 (11:06 -0700)]
Finish update to bmake-20220724

23 months agoAdjust function definition in vfs_bio.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 17:48:20 +0000 (19:48 +0200)]
Adjust function definition in vfs_bio.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/kern/vfs_bio.c:3430:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    buf_daemon()
              ^
               void

This is because buf_daemon() is declared with a (void) argument list,
but defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoAdjust function definitions in sysv_msg.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 17:46:15 +0000 (19:46 +0200)]
Adjust function definitions in sysv_msg.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/kern/sysv_msg.c:213:8: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    msginit()
           ^
            void
    sys/kern/sysv_msg.c:316:10: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    msgunload()
             ^
              void

This is because msginit() and msgunload() are declared with (void)
argument lists, but defined with empty argument lists. Make the
definitions match the declarations.

MFC after: 3 days

23 months agoAdjust function definition in subr_bus.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 16:01:16 +0000 (18:01 +0200)]
Adjust function definition in subr_bus.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/kern/subr_bus.c:871:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    bus_topo_assert()
                   ^
                    void

This is because bus_topo_assert() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust function definition in subr_autoconf.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 15:27:54 +0000 (17:27 +0200)]
Adjust function definition in subr_autoconf.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/kern/subr_autoconf.c:119:34: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    run_interrupt_driven_config_hooks()
                                     ^
                                      void

This is because run_interrupt_driven_config_hooks() is declared with a
(void) argument list, but defined with an empty argument list. Make the
definition match the declaration.

MFC after: 3 days

23 months agoAdjust function definitions in kern_resource.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 14:14:50 +0000 (16:14 +0200)]
Adjust function definitions in kern_resource.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/kern/kern_resource.c:1212:10: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    lim_alloc()
             ^
              void
    sys/kern/kern_resource.c:1365:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    uihashinit()
              ^
               void

This is because lim_alloc() and uihashinit() are declared with (void)
argument lists, but defined with empty argument lists. Make the
definitions match the declarations.

MFC after: 3 days

23 months agoAdjust function definitions in kern_dtrace.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 14:11:05 +0000 (16:11 +0200)]
Adjust function definitions in kern_dtrace.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/kern/kern_dtrace.c:64:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    kdtrace_proc_size()
                     ^
                      void
    sys/kern/kern_dtrace.c:87:20: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    kdtrace_thread_size()
                       ^
                        void

This is because kdtrace_proc_size() and kdtrace_thread_size() are
declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after: 3 days

23 months agoAdjust function definitions in kern_cons.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 14:03:35 +0000 (16:03 +0200)]
Adjust function definitions in kern_cons.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/kern/kern_cons.c:201:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cninit_finish()
                 ^
                  void
    sys/kern/kern_cons.c:376:7: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cngrab()
          ^
           void
    sys/kern/kern_cons.c:389:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cnungrab()
            ^
             void
    sys/kern/kern_cons.c:402:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    cnresume()
            ^
             void

This is because cninit_finish(), cngrab(), cnungrab(), and cnresume()
are declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after: 3 days

23 months agoAdjust function definition in geom_subr.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 14:01:04 +0000 (16:01 +0200)]
Adjust function definition in geom_subr.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/geom/geom_subr.c:484:16: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    g_wither_washer()
                   ^
                    void

This is because g_wither_washer() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust function definition in geom_io.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 14:00:08 +0000 (16:00 +0200)]
Adjust function definition in geom_io.c to avoid clang 15 warnings

With clang 15, the following -Werror warning is produced:

    sys/geom/geom_io.c:272:10: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    g_io_init()
             ^
              void

This is because g_io_init() is declared with a (void) argument list, but
defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoAdjust function definitions in geom_event.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 13:58:31 +0000 (15:58 +0200)]
Adjust function definitions in geom_event.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/geom/geom_event.c:261:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    g_run_events()
                ^
                 void
    sys/geom/geom_event.c:405:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    g_do_wither()
               ^
                void
    sys/geom/geom_event.c:449:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    g_event_init()
                ^
                 void

This is because g_run_events(), g_do_wither(), and g_event_init() are
declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after: 3 days

23 months agoFix unused variable warning in sfxge's ef10_tx.c
Dimitry Andric [Tue, 26 Jul 2022 13:17:05 +0000 (15:17 +0200)]
Fix unused variable warning in sfxge's ef10_tx.c

With clang 15, the following -Werror warning is produced:

    sys/dev/sfxge/common/ef10_tx.c:345:15: error: variable 'eqp' set but not used [-Werror,-Wunused-but-set-variable]
            efx_qword_t *eqp;
                         ^

The 'eqp' variable is passed as an argument to the EFSYS_BAR_WC_WRITEQ()
macro, but currently this macro ignores the argument, similar to its
other _esbp argument. Silence the warning by casting the _eqp argument
to void in the macro.

MFC after: 3 days

23 months agoAdjust function definitions in xen's control.c to avoid clang 15 warnings
Dimitry Andric [Tue, 26 Jul 2022 12:11:09 +0000 (14:11 +0200)]
Adjust function definitions in xen's control.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

    sys/dev/xen/control/control.c:188:15: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_poweroff()
                  ^
                   void
    sys/dev/xen/control/control.c:194:13: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_reboot()
                ^
                 void
    sys/dev/xen/control/control.c:207:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_suspend()
                 ^
                  void
    sys/dev/xen/control/control.c:344:12: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    xctrl_crash()
               ^
                void

This is because xctrl_poweroff(), xctrl_reboot(), xctrl_suspend(), and
xctrl_crash() are declared with (void) argument lists, but defined with
empty argument lists. Make the definitions match the declarations.

MFC after: 3 days

23 months agoFix unused variable warning in xen's blkback.c
Dimitry Andric [Tue, 26 Jul 2022 12:02:36 +0000 (14:02 +0200)]
Fix unused variable warning in xen's blkback.c

With clang 15, the following -Werror warning is produced:

    sys/dev/xen/blkback/blkback.c:1561:12: error: variable 'req_seg_idx' set but not used [-Werror,-Wunused-but-set-variable]
                    u_int                    req_seg_idx;
                                             ^

The 'req_seg_idx' variable was used in the for loop later in the
xbb_dispatch_io() function, but refactoring in 112cacaee408 got rid of
it. Remove the variable since it no longer serves any purpose.

MFC after: 3 days

23 months agoFix unused variable warning in xen's blkfront.c
Dimitry Andric [Tue, 26 Jul 2022 12:01:26 +0000 (14:01 +0200)]
Fix unused variable warning in xen's blkfront.c

With clang 15, the following -Werror warning is produced:

    sys/dev/xen/blkfront/blkfront.c:602:6: error: variable 'sbp' set but not used [-Werror,-Wunused-but-set-variable]
            int sbp;
                ^

The 'sbp' variable was used in the for loop later in the xb_dump()
function, but refactoring in e4808c4b2dba got rid of it. Remove the
variable since it no longer serves any purpose.

MFC after:      3 days

23 months agoAdjust playinit() definition to avoid clang 15 warning
Dimitry Andric [Tue, 26 Jul 2022 11:43:46 +0000 (13:43 +0200)]
Adjust playinit() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/dev/speaker/spkr.c:182:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    playinit()
            ^
             void

This is because playinit() is declared with a (void) argument list, but
defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoAdjust check_struct_sizes() definition to avoid clang 15 warning
Dimitry Andric [Tue, 26 Jul 2022 11:20:58 +0000 (13:20 +0200)]
Adjust check_struct_sizes() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/dev/smartpqi/smartpqi_helper.c:374:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    check_struct_sizes()
                      ^
                       void

This is because check_struct_sizes() is declared with a (void) argument
list, but defined with an empty argument list. Make the definition match
the declaration.

MFC after: 3 days

23 months agoAdjust sctp_drain() definition to avoid clang 15 warning
Dimitry Andric [Tue, 26 Jul 2022 11:19:39 +0000 (13:19 +0200)]
Adjust sctp_drain() definition to avoid clang 15 warning

With clang 15, the following -Werror warning is produced:

    sys/netinet/sctp_pcb.c:6946:11: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    sctp_drain()
              ^
               void

This is because sctp_drain() is declared with a (void) argument list,
but defined with an empty argument list. Make the definition match the
declaration.

MFC after: 3 days

23 months agoUpdate to bmake-20220724
Simon J. Gerraty [Tue, 26 Jul 2022 16:07:25 +0000 (09:07 -0700)]
Update to bmake-20220724

Merge commit '308a28d6cd2e87028e535eabccb89a9dc2fd9515'

23 months agoImport bmake-20220724
Simon J. Gerraty [Tue, 26 Jul 2022 15:52:53 +0000 (08:52 -0700)]
Import bmake-20220724

Relevant/interesting changes:

o parse.c: fix out-of-bounds read when parsing an invalid line
        https://bugs.freebsd.org/265119
fix memory leak in wildcard targets and sources
fix off-by-one error in buffer for .WAIT nodes
o allow to randomize build order of targets
.MAKE.MODE += randomize-targets can help uncover dependency bugs

23 months agorc: Start testing the rc(8) framework (beginning with *_oomprotect)
Mateusz Piotrowski [Thu, 7 Jul 2022 18:24:27 +0000 (20:24 +0200)]
rc: Start testing the rc(8) framework (beginning with *_oomprotect)

This change adds 2 tests to make sure that the *_oomprotect variable
sets the protection against OOM killer properly within rc(8) scripts.

This is also adding the first tests for the rc(8) framework. More tests
will be added as we go.

PR: 256148
Approved by: des
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35745