]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 months agolibgssapi: Remove a set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
libgssapi: Remove a set but unused variable.

Reported by: clang -Wunused-but-set-variable

12 months agolibalias tests: Mark an unused variable with __unused.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
libalias tests: Mark an unused variable with __unused.

It is not trivial to remove this set but unused variable since it
assigned to inside of a macro body, so just mark it with __unused
instead.

12 months agounix_seqpacket_test: Consistently use datalen as length to send.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
unix_seqpacket_test: Consistently use datalen as length to send.

This matches the other tests in this file and quiets a set but unused
warning from GCC.

12 months agortld-elf: Remove set but unused variable on 32-bit arm.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
rtld-elf: Remove set but unused variable on 32-bit arm.

12 months agoac: Remove set but not used variable.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
ac: Remove set but not used variable.

Reported by: clang

12 months agoypldap: Remove set but unused variables.
John Baldwin [Tue, 20 Jun 2023 16:29:00 +0000 (09:29 -0700)]
ypldap: Remove set but unused variables.

Some of these were reported by GCC, others reported by clang.

12 months agonscd: Remove set but unused variables.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
nscd: Remove set but unused variables.

Reported by: GCC

12 months agobluetooth: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
bluetooth: Remove set but unused variable.

Reported by: GCC

12 months agobluetooth/ath3kfw: Propagate return value from ath3k_load_fwfile.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
bluetooth/ath3kfw: Propagate return value from ath3k_load_fwfile.

The caller ignores the return value so this is a no-op, but
ath3k_init_ar3012 returns the return values of its internal functions,
so this is more consistent.

Fix some misleading indentation while here.

Reported by: GCC -Wunused-but-set-variable (1)

12 months agomptable: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
mptable: Remove set but unused variable.

Reported by: GCC

12 months agotraceroute: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
traceroute: Remove set but unused variable.

Reported by: GCC

12 months agorpc.lockd: Remove set but unused variables.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
rpc.lockd: Remove set but unused variables.

Reported by: GCC

12 months agounits: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
units: Remove set but unused variable.

Reported by: GCC

12 months agomkuzip: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
mkuzip: Remove set but unused variable.

Reported by: GCC

12 months agolibvgl: Remove set but unused andmask variable from VGLMouseInit.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
libvgl: Remove set but unused andmask variable from VGLMouseInit.

Reported by: GCC

12 months agolib9p: Remove set but unused sockets[] array from l9p_start_server.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
lib9p: Remove set but unused sockets[] array from l9p_start_server.

Reported by: GCC

12 months agolibkvm: Remove set but unused variable from ppc64mmu_hpt_init.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
libkvm: Remove set but unused variable from ppc64mmu_hpt_init.

Reported by: GCC

12 months agolibgssapi: Remove set but unused variable.
John Baldwin [Tue, 20 Jun 2023 16:28:59 +0000 (09:28 -0700)]
libgssapi: Remove set but unused variable.

Reported by: GCC

12 months agoriscv: improve KTR_TRAP trace entries
Mitchell Horne [Tue, 20 Jun 2023 14:52:26 +0000 (11:52 -0300)]
riscv: improve KTR_TRAP trace entries

For more informative records of exceptions, include key details such as
the exception code and stval register contents. Remove the curthread
argument as it is redundant (saved with every ktr entry), and the
trapframe as it is somewhat meaningless.

Add a new KTR_TRAP trace record for interrupts.

Reviewed by: markj, jhb
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40584

12 months agoossl: Don't try to initialize the cipher for Chacha20+Poly1305.
John Baldwin [Tue, 20 Jun 2023 14:53:50 +0000 (07:53 -0700)]
ossl: Don't try to initialize the cipher for Chacha20+Poly1305.

Chacha20+Poly1305 doesn't use an ossl_cipher instance the way AES-GCM
does, so ossl_lookup_cipher() failed causing ossl_newsession() to
always fail for Chacha20+Poly1305 sessions.

Reported by: gallatin (ktls_test fails with ossl.ko loaded)
Fixes: 9a3444d91c70 ossl: Add a VAES-based AES-GCM implementation for amd64
Tested by: gallatin
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D40580

12 months agopf: Add code to enable filtering for locally delivered packets
Doug Rabson [Tue, 20 Jun 2023 13:01:58 +0000 (14:01 +0100)]
pf: Add code to enable filtering for locally delivered packets

This is disabled by default since it potentially changes the behavior of
existing filter rule sets. To enable this extra filter for packets being
delivered locally, use:

sysctl net.pf.filter_local=1
service pf restart

PR:             268717
Reviewed-by: kp
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40373

12 months agoifconfig.8: Document limitation of groupname
Koichiro Iwao [Tue, 20 Jun 2023 10:14:39 +0000 (19:14 +0900)]
ifconfig.8: Document limitation of groupname

Approved by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40645

12 months agopf: fix build without VIMAGE
Kristof Provost [Tue, 20 Jun 2023 11:20:11 +0000 (13:20 +0200)]
pf: fix build without VIMAGE

Remove the name conflict between the pfsync_defer_tmo variable and
function.

This worked fine in kernels with VIMAGE (the default), but not in those
without.

Reported by: des@
Sponsored by: Rubicon Communications, LLC ("Netgate")

12 months agotarfs: Don't use IO_DIRECT when reading from tarball.
Dag-Erling Smørgrav [Tue, 20 Jun 2023 09:37:24 +0000 (09:37 +0000)]
tarfs: Don't use IO_DIRECT when reading from tarball.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D40612

12 months agobhyve: dos2unix
Corvin Köhne [Tue, 20 Jun 2023 09:47:42 +0000 (11:47 +0200)]
bhyve: dos2unix

tpm_intf.h was incorrectly committed with dos line endings.

Fixes: 0917f925b46e3142c4373d1591bf22014d0f338e ("bhyve: add basic CRB interface for TPM devices")
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

12 months agopf tests: make pfsync:defer test more robust
Kristof Provost [Mon, 19 Jun 2023 14:41:13 +0000 (16:41 +0200)]
pf tests: make pfsync:defer test more robust

Set the defer timeout to 2.5 seconds, and only make sure that there's at
least a second of delay between the pfsync packet and the ping packet.
The intent is to allow the test to pass even when there's considerable
jitter on the timing measurement (e.g. when the test runs in a VM, such
as during the CI tests).

Allow the test to run in CI.

Sponsored by: Rubicon Communications, LLC ("Netgate")

12 months agopf: allow defer timeout to be configured
Kristof Provost [Mon, 19 Jun 2023 14:37:19 +0000 (16:37 +0200)]
pf: allow defer timeout to be configured

Add the net.pfsync.defer_delay sysctl to allow the defer timeout (i.e.
how long pf holds onto packets waiting for the peer to ack the new
state) to be changed.

This is intended to make testing of the defer code more robust, by
allowing longer timeouts to mitigate scheduling/measurement jitter.

Sponsored by: Rubicon Communications, LLC ("Netgate")

12 months agobhyve/tpm: create crb thread for sending tpm commands
Corvin Köhne [Mon, 29 Aug 2022 10:10:44 +0000 (12:10 +0200)]
bhyve/tpm: create crb thread for sending tpm commands

Commands send to a tpm are very slow. They can take up to several
seconds for completion. For that reason, create a thread which issues
the commands to the tpm device.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40458

12 months agobhyve/tpm: build TPM2 table by tpm interface
Corvin Köhne [Mon, 29 Aug 2022 10:10:43 +0000 (12:10 +0200)]
bhyve/tpm: build TPM2 table by tpm interface

Each tpm has a device specific table. Which table a tpm uses depends on
the tpm interface.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40457

12 months agobhyve: maintain RSDT and XSDT by basl
Corvin Köhne [Thu, 15 Jun 2023 09:12:53 +0000 (11:12 +0200)]
bhyve: maintain RSDT and XSDT by basl

In a subsquent commit the TPM emulation will build it's own TPM2 table.
This needs to be registered to the RSDT and XSDT. Instead of making the
rsdt and xsdt variables global, we can simply add a helper to basl.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40559

12 months agobhyve: add bootindex option for several devices
Corvin Köhne [Mon, 16 Aug 2021 07:50:15 +0000 (09:50 +0200)]
bhyve: add bootindex option for several devices

The bootindex option creates an entry in the "bootorder" fwcfg file.
This file can be picked up by the guest firmware to determine the
bootorder. Nevertheless, it's not guaranteed that the guest firmware
uses the bootorder. At the moment, our OVMF ignores the bootorder. This
will change in the future.

If guest firmware supports the "bootorder" fwcfg file and no device uses
the bootindex option, the boot order is determined by the firmware
itself. If one or more devices specify a bootindex, the first bootable
device with the lowest bootindex will be booted. It's not garanteed that
devices without a bootindex will be recognized as bootable from the
firmware in that case.

Reviewed by: jhb
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39285

12 months agobhyve: add helper to create a bootorder
Corvin Köhne [Mon, 16 Aug 2021 07:47:53 +0000 (09:47 +0200)]
bhyve: add helper to create a bootorder

Qemu's fwcfg allows to define a bootorder. Therefore, the hypervisor has
to create a fwcfg item named bootorder, which has a newline seperated
list of boot entries. Qemu's OVMF will pick up the bootorder and applies
it.

Add the moment, bhyve's OVMF doesn't support a custom bootorder by
qemu's fwcfg. However, in the future bhyve will gain support for qemu's
OVMF. Additonally, we can port relevant parts from qemu's to bhyve's
OVMF implementation.

Reviewed by: jhb, markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39284

12 months agoRestore dummy WITHOUT_{CAPSICUM,CASPER} descriptions
Ed Maste [Tue, 20 Jun 2023 01:49:59 +0000 (21:49 -0400)]
Restore dummy WITHOUT_{CAPSICUM,CASPER} descriptions

The makeman CI job ensures that all options have description files.

Bring the CI job back to green by adding back WITHOUT_CAPSICUM and
WITHOUT_CASPER description files (that now state the assoicated options
have no effect).

Fixes: c24c117b9644 ("Remove WITHOUT_{CAPSICUM,CASPER} options")
Sponsored by: The FreeBSD Foundation

12 months agoRemove WITHOUT_{CAPSICUM,CASPER} options
Colin Percival [Sun, 18 Jun 2023 00:03:56 +0000 (17:03 -0700)]
Remove WITHOUT_{CAPSICUM,CASPER} options

At this point CAPSICUM and CASPER are merely forced on via the newly
added __REQUIRED_OPTIONS list; after stable/14 branches I'll sweep
the tree for MK_{CAPSICUM,CASPER}.

This change will not be MFCed.

Discussed on: freebsd-arch
Differential Revision: https://reviews.freebsd.org/D40592

12 months agooptions/makeman: Handle __REQUIRED_OPTIONS
Colin Percival [Sun, 18 Jun 2023 00:01:52 +0000 (17:01 -0700)]
options/makeman: Handle __REQUIRED_OPTIONS

Teach the code which generates src.conf.5 about __REQUIRED_OPTIONS;
without this change it gets confused and thinks that every option
turns the required options on.

Reviewed by: sjg, imp
Differential Revision: https://reviews.freebsd.org/D40591

12 months agobsd.mkopt.mk: Add REQUIRED_OPTIONS list
Colin Percival [Sat, 17 Jun 2023 20:08:37 +0000 (13:08 -0700)]
bsd.mkopt.mk: Add REQUIRED_OPTIONS list

Options on this list will be forced to 'yes'.  This is intended for use
as a transitional measure when an option is ceasing to be optional,
before all of the associated make logic is removed.

Differential Revision: https://reviews.freebsd.org/D40590

12 months agocamcontrol: Include stdbool.h rather than relying on namespace pollution
Warner Losh [Mon, 19 Jun 2023 20:52:58 +0000 (14:52 -0600)]
camcontrol: Include stdbool.h rather than relying on namespace pollution

I have several environments, and at least one of them fails to build
because bool is undefined. Since we use bool, always include stdbool.h
rather than relying on any indirect definitions to pull it in.

Sponsored by: Netflix

12 months agocamcontrol: Zone fix two warnings
Warner Losh [Mon, 19 Jun 2023 20:51:07 +0000 (14:51 -0600)]
camcontrol: Zone fix two warnings

Remove a set but never used variable, and use the protocol variable for
its intended purpose.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D40528

12 months agocam: Remove duplicate definition for READ_DEFECT_DATA_10
Warner Losh [Mon, 19 Jun 2023 20:43:45 +0000 (14:43 -0600)]
cam: Remove duplicate definition for READ_DEFECT_DATA_10

This isn't needed by all devices and is only used by the da device (in
camcontrol). All the other da specific da scsi opcodes are only in
scsi_da.h.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D40527

12 months agocamcontrol: In defects make -S actually imply 12-byte command
Warner Losh [Mon, 19 Jun 2023 20:43:37 +0000 (14:43 -0600)]
camcontrol: In defects make -S actually imply 12-byte command

camcontrol(8) says that -S to start at a different offset implies that
we're using the 12 byte command. But really, we're using the 10-byte
command. Fix this by setting use_12byte for -S.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D40526

12 months agocamcontrol: simplify summary logic for defects
Warner Losh [Mon, 19 Jun 2023 20:43:30 +0000 (14:43 -0600)]
camcontrol: simplify summary logic for defects

We don't need to count the number of lists requested. Instead, use the
more general form of checking to see if any of the non-defect format
bits are set. Also, check summary boolean to control summary reporting
behavior.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D40524

12 months agocamcontrol: No need to set CAM_ARG_[PG]LIST in defects
Warner Losh [Mon, 19 Jun 2023 20:43:12 +0000 (14:43 -0600)]
camcontrol: No need to set CAM_ARG_[PG]LIST in defects

We can or in the the list_format bits directly if we or in the
list_format when we look it up the first time. Free up CAM_ARG_[PG]LIST
from the CAM_ARG_xxx enum.

Sponsored by: Netflix
Reviewed by: mav (I made his suggested change)
Differential Revision: https://reviews.freebsd.org/D40523

12 months agocamcontrol: Simplfiy 12-byte retry logic in defects command
Warner Losh [Mon, 19 Jun 2023 20:43:05 +0000 (14:43 -0600)]
camcontrol: Simplfiy 12-byte retry logic in defects command

We always start out using the 10-byte version of READ DEFECT DATA, and
then switch to 12-byte when necessary due to errors or data length
requirements. We always need to get the length again when we do this,
and we're always going to be using 12-byte commands from that point
forward. Simplify the logic a bit based on this observation.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D40522

12 months agocamcontrol: Convert int used as booleans to bools
Warner Losh [Mon, 19 Jun 2023 20:42:57 +0000 (14:42 -0600)]
camcontrol: Convert int used as booleans to bools

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D40521

12 months agocamcontrol: Label the unused command args
Warner Losh [Mon, 19 Jun 2023 20:42:48 +0000 (14:42 -0600)]
camcontrol: Label the unused command args

Remove CAM_ARG_FORMAT_{BLOCK,BLI,PHYS} since they are not used.  Label
all the unused CAM_ARG_ bits as unused in comments to make them stand
out.

Sponsored by: Netflix
Reviewed by: mav
Differential Revision: https://reviews.freebsd.org/D40520

12 months agobhyve: Refactor vmexit_suspend() a bit
Mark Johnston [Mon, 19 Jun 2023 19:46:32 +0000 (15:46 -0400)]
bhyve: Refactor vmexit_suspend() a bit

Move some of its logic into fbsdrun_deletecpu().  This makes it easier
to split vmexit handlers into a separate file, which in turn makes
landing arm64 support easier.  Also increase the scope of the mutex and
use it to synchronize updates to the vcpu mask.  No functional change
intended.

Reviewed by: corvink, jhb
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40573

12 months agobhyve: Register hlt and pause vmexit handlers unconditionally
Mark Johnston [Mon, 19 Jun 2023 19:46:02 +0000 (15:46 -0400)]
bhyve: Register hlt and pause vmexit handlers unconditionally

These exit handlers might not be used if the corresponding VM
capabilities are not set, but there is no harm in putting them into the
handler table regardless.  Doing so simplifies initialization code,
makes it easier to split vmexit handlers into a separate file, and lets
us declare the handler table as const.

Reviewed by: corvink, jhb
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D40572

12 months agobhyve: Include vmm.h via the usual path
Mark Johnston [Thu, 8 Jun 2023 21:25:25 +0000 (17:25 -0400)]
bhyve: Include vmm.h via the usual path

No functional change intended.

MFC after: 1 week
Sponsored by: Innovate UK

12 months agobhyve: Remove some unneeded includes of segments.h
Mark Johnston [Thu, 8 Jun 2023 21:24:45 +0000 (17:24 -0400)]
bhyve: Remove some unneeded includes of segments.h

They are not needed and are specific to x86.  No functional change
intended.

MFC after: 1 week
Sponsored by: Innovate UK

12 months agoApply llvm fix for hanging gcc builds on 32-bit arm
Dimitry Andric [Mon, 19 Jun 2023 18:32:40 +0000 (20:32 +0200)]
Apply llvm fix for hanging gcc builds on 32-bit arm

Merge commit 962c306a11d0 from llvm-project (by Florian Hahn):

  [LV] Don't consider pointer as uniform if it is also stored.

  Update isVectorizedMemAccessUse to also check if the pointer is stored.
  This prevents LV to incorrectly consider a pointer as uniform if it is
  used as both pointer and stored by the same StoreInst.

  Fixes #61396.

PR: 271992
Reported by: John F. Carr <jfc@mit.edu>
MFC after: 3 days

12 months agoservice: Add -E option to set environment variables before starting a service.
Alexander Leidinger [Wed, 30 Nov 2022 18:31:41 +0000 (19:31 +0100)]
service: Add -E option to set environment variables before starting a service.

This allows for quicker testing/debugging of rc scripts and is a pre-req
for automatic service jails.

Differential Revision: https://reviews.freebsd.org/D40369
Reviewed by: se

12 months agoifconfig: Pacify a sign comparison warning in regdomain_sort.
John Baldwin [Mon, 19 Jun 2023 17:38:18 +0000 (10:38 -0700)]
ifconfig: Pacify a sign comparison warning in regdomain_sort.

Both ic_flags values are unsigned (uint32_t), so cast them to a signed
int to generate a signed result.  Both ic_req values are also
unsigned, but since they are uint16_t, they are implicitly promited to
int before the subtraction.

Reported by: GCC -Wsign-compare
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40610

12 months agoifconfig: Consistently use uint32_t for wireless channel flags.
John Baldwin [Mon, 19 Jun 2023 17:38:07 +0000 (10:38 -0700)]
ifconfig: Consistently use uint32_t for wireless channel flags.

Reported by: GCC -Wsign-compare
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40609

12 months agoifconfig: Avoid issues with trying to negate unsigned values.
John Baldwin [Mon, 19 Jun 2023 17:37:52 +0000 (10:37 -0700)]
ifconfig: Avoid issues with trying to negate unsigned values.

The if_flags and if_cap fields hold a bitmask of flags.  If a flag is
the MSB of the field, then the logic in setifflags and setifcap which
uses a < 0 check does the wrong thing (it tries to clear the flag
rather than setting it).  Also, trying to use -<FOO> doesn't actually
work as the result is a nop.  To fix, stop overloading setifcap and
setifflags and instead add new dedicated action functions clearifcap
and clearifflags for clearing a flag.  The value passed in the
argument to the command is now always the raw flag.

This was reported by a GCC warning after raising WARNS:

sbin/ifconfig/ifconfig.c:2061:33: error: integer overflow in expression '-2147483648' of type 'int' results in '-2147483648' [-Werror=overflow]
 2061 |         DEF_CMD("-txtlsrtlmt",  -IFCAP_TXTLS_RTLMT,     setifcap),
      |                                 ^

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D40608

12 months agox86: Add defines for a couple of thermal and PM bits
Mark Johnston [Mon, 19 Jun 2023 17:26:07 +0000 (13:26 -0400)]
x86: Add defines for a couple of thermal and PM bits

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

12 months agosh: also auto-complete built-ins
Piotr Pawel Stefaniak [Sat, 29 Apr 2023 15:53:58 +0000 (17:53 +0200)]
sh: also auto-complete built-ins

Reported in a comment in PR 261728.

Reported by: Oleg
Reviewed by: jilles (previous version), bapt
Differential Revision: https://reviews.freebsd.org/D39839

12 months agompi3mr: fix GCC kernel build
Ed Maste [Mon, 19 Jun 2023 13:23:45 +0000 (09:23 -0400)]
mpi3mr: fix GCC kernel build

Previously every file that included mpi3mr_app.h but did not use
mpi3mr_mgmt_info reported error: 'mpi3mr_mgmt_info' defined but not
used.

Fixes: 2d1d418e1e7b ("mpi3mr: 3rd Generation Tri-Mode NVMe/SAS/SATA...")
Reported by: amd64-gcc12 Cirrus-CI job
Sponsored by: The FreeBSD Foundation

12 months agopcib: Allocate the memory BAR with the MSI-X table.
John Baldwin [Mon, 19 Jun 2023 16:15:48 +0000 (09:15 -0700)]
pcib: Allocate the memory BAR with the MSI-X table.

This is required for pci_alloc_msix() to work and to thus use
MSI-X interrupts for PCI-e hotplug.

Reported by: cperciva
Reviewed by: cperciva
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40581

12 months agoseq: fix check for rounding error/truncation
Ed Maste [Mon, 19 Jun 2023 01:37:06 +0000 (21:37 -0400)]
seq: fix check for rounding error/truncation

Based on OpenBSD 30f0fd29ba6c:
> We need to compare the printable version of the last value displayed,
> not the floating point representation.  Otherwise, we may print the
> last value twice.

PR: 271964
Reported by: Daniel Kolesa
Reviewed by: yuripv
Obtained from: OpenBSD
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40601

12 months agoifconfig: set boolean to true rather than incrementing
Ed Maste [Mon, 19 Jun 2023 15:01:08 +0000 (11:01 -0400)]
ifconfig: set boolean to true rather than incrementing

GCC warns about "increment of a boolean expression."

Reported by: amd64-gcc12 Cirrus-CI run
Sponsored by: The FreeBSD Foundation

12 months agonameser: Fix a typo in a source code comment
Gordon Bergling [Mon, 19 Jun 2023 11:49:23 +0000 (13:49 +0200)]
nameser: Fix a typo in a source code comment

-s /unknwon/unknown/

MFC after: 3 days

12 months agoFix some shell issues by adding quotes and replace backticks with $()
Benedict Reuschling [Mon, 19 Jun 2023 11:03:06 +0000 (11:03 +0000)]
Fix some shell issues by adding quotes and replace backticks with $()

This patch fixes the following issues reported by shellcheck:
- Quote default assignments (SC2223)
- Use $() instead of backticks (SC2006)
- Double quote $@ (SC2068)
- Double quote variables in if-statements and other places (SC2086)

While here, fix a whitespace at one end of line instance in the license
text.

Approved by: manu
Differential Revision: https://reviews.freebsd.org/D40604

12 months agopf: Fix usage of pf tags with syncookies
Kajetan Staszkiewicz [Mon, 19 Jun 2023 08:21:29 +0000 (10:21 +0200)]
pf: Fix usage of pf tags with syncookies

The value stored in pf_mtag->tag comes from "tag" and "match tag"
keywords in pf.conf and must not be abused for storing other
information. A ruleset with enough tags could set or remove the bits
responsible for PF_TAG_SYNCOOKIE_RECREATED.

Move this syncookie status to pf_mtag->flags. Rename this and other
related constants in a way that will prevent such mistakes in the
future. Move PF_REASSEMBLED constant to mbuf.h and rename accordingly
because it's not a flag stored in pf_mtag, but an identifier of a
different m_tag. Change the value of the constant to avoid conflicts
with other m_tags using MTAG_ABI_COMPAT.

Rename the variables in pf_build_tcp() and pf_send_tcp() in to reduce
confusion.

Reviewed by: kp
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D40587

12 months agopf: extend use of skip steps for Ethernet rules
Kristof Provost [Thu, 15 Jun 2023 15:12:11 +0000 (17:12 +0200)]
pf: extend use of skip steps for Ethernet rules

Use the already populated PFE_SKIP_DST_ADDR and extend the skip
infrastructure to also skip on IP source/destination addresses.

This should make evaluating the rules slightly faster.

Reported by: R. Christian McDonald <rcm@rcm.sh>
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40567

12 months agomotd: unbreak for source upgrade
Eugene Grosbein [Mon, 19 Jun 2023 07:49:35 +0000 (14:49 +0700)]
motd: unbreak for source upgrade

In case of source upgrade path from 12.x proper merge of new /etc
installs /etc/motd.template. Becase of that, the system in left
without symlink /etc/motd -> /var/run/motd but with stale /etc/motd contents.

Fix it creating symlink despite of presence of /etc/motd.template.

MFC after: 1 week

12 months agobhyve: add command line parameter and parsing for migration
Mihai Burcea [Mon, 19 Jun 2023 06:46:28 +0000 (08:46 +0200)]
bhyve: add command line parameter and parsing for migration

This covers warm and live migration.

Reviewed by: corvink
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34717

12 months agobhyve: use pci_next() to save/restore pci devices
Vitaliy Gusev [Mon, 15 May 2023 14:29:04 +0000 (14:29 +0000)]
bhyve: use pci_next() to save/restore pci devices

Current snapshot implementation doesn't support multiple devices with
similar type. For example, two virtio-blk or two CD-ROM-s, etc.

So the following configuration cannot be restored.

bhyve \
-s 3,virtio-blk,disk.img \
-s 4,virtio-blk,disk2.img

In some cases it is restored silently, but doesn't work. In some cases
it fails during restore stage.

This commit fixes that issue.

Reviewed by: corvink, rew
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D40109

12 months agobhyve: add .pe_snapshot method for PCI 'hostbridge'
Vitaliy Gusev [Mon, 15 May 2023 16:29:56 +0000 (16:29 +0000)]
bhyve: add .pe_snapshot method for PCI 'hostbridge'

There is no error when dump doesn't have it, but to be more
consistent this PCI devices should be saved as well.

Reviewed by: corvink, rew
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D40108

12 months agobhyve: add bus, slot and func to device name
Vitaliy Gusev [Mon, 15 May 2023 14:28:45 +0000 (14:28 +0000)]
bhyve: add bus, slot and func to device name

Each device needs a unique identifier to store and restore snapshots
properly. Adding the pci bsf information to the device name creates a
unique identifier as a bsf can't be occupied twice.

Reviewed by: corvink
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D40107

12 months agobhyve: rename 'user_dev' with 'devices'
Vitaliy Gusev [Mon, 15 May 2023 14:28:14 +0000 (14:28 +0000)]
bhyve: rename 'user_dev' with 'devices'

Bhyve don't use 'user' specifier for emulated devices. And
using 'user' adds duality.

Reviewed by: corvink, rew
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D40106

12 months agobhyve: simplify restore of kernel structs
Vitaliy Gusev [Mon, 15 May 2023 14:27:29 +0000 (14:27 +0000)]
bhyve: simplify restore of kernel structs

Both devices and kernel struct can use the same 'lookup_dev'
function instead of having duplicated code.

Reviewed by: corvink, rew
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D40105

12 months agobhyve: rename 'structs' snapshot key with 'kern_structs'
Vitaliy Gusev [Mon, 15 May 2023 14:25:15 +0000 (14:25 +0000)]
bhyve: rename 'structs' snapshot key with 'kern_structs'

Using key 'structs' is ambiguous. This section contains data
related to the kernel. It should use a more informative naming.

Reviewed by: corvink, rew
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D40104

12 months agoacl_is_trivial_np(3): minor fixes
Kyle Evans [Mon, 19 Jun 2023 05:31:16 +0000 (00:31 -0500)]
acl_is_trivial_np(3): minor fixes

- Correct the document title
- This function has an _np suffix
- acl_strip_np has a manpage, xref it
- RETURN VALUES should describe acl_is_trivial_np, not acl_get_tag_type

Sponsored by: Klara, Inc.

12 months agomount_nfs.8: Note a case where the "nconnect" option does not work
Rick Macklem [Sun, 18 Jun 2023 20:02:20 +0000 (13:02 -0700)]
mount_nfs.8: Note a case where the "nconnect" option does not work

The "nconnect" NFS mount option will not work
correctly for servers where the TCP connections
might connect to different NFS clusters that do not
share NFSv4.1/4.2 state information, such as file locks.

This patch adds a sentence to the "nconnect" section
of mount_nfs.8 noting this case.

This is a content change.

Reviewed by: karels, pauamma_gundo.com (manpages)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D40547

12 months agoexamples/kld/syscall: unbreak compilation
Maxim Konovalov [Sun, 18 Jun 2023 05:52:01 +0000 (05:52 +0000)]
examples/kld/syscall: unbreak compilation

modfind(9)/modstat(9) need sys/param.h.

12 months agomlx4en(4): add missing newline to debug messages
Kevin Lo [Sun, 18 Jun 2023 04:14:41 +0000 (12:14 +0800)]
mlx4en(4): add missing newline to debug messages

Add newline to debug messages after dumping uar_page_shift and reserved_uars.

Reviewed by: hselasky
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40582

12 months agoamdtemp: Fix missing 49 degree offset on current EPYC CPUs
Val Packett [Sat, 17 Jun 2023 16:29:53 +0000 (13:29 -0300)]
amdtemp: Fix missing 49 degree offset on current EPYC CPUs

On an EPYC 7313P, the temperature reported by amdtemp was off, because
the offset was not applied. Turns out it needs to be applied with one
more condition: https://lkml.org/lkml/2023/4/13/1095

Reviewed by: mhorne
Tested by: mike.jakubik@gmail.com
MFC after: 1 week
Sponsored by: https://www.patreon.com/valpackett
Pull Request: https://github.com/freebsd/freebsd-src/pull/754

12 months agoarm64/disassem.c: Add shifted register definitions with ror
Mykola Hohsadze [Sat, 17 Jun 2023 15:31:25 +0000 (12:31 -0300)]
arm64/disassem.c: Add shifted register definitions with ror

Add disassembly support for the following shifted register instructions:
* mvn
* orn
* orr
* and
* ands
* bic
* bics
* eon
* eor
* tst

According to Arm64 documenation, operational pseuducode of shifted
register instruction must return `UNDEFINED` if shift type is `RESERVED`
('11'). Hence, removed "rsv" from `shift_2` array and add "ror". In case
of shift type is 3 and this type is `RESERVED`, we will return
`undefined`.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D40386

12 months agotcpdump: Reconnect pfsync printer
Joseph Mingrone [Fri, 16 Jun 2023 13:40:00 +0000 (10:40 -0300)]
tcpdump: Reconnect pfsync printer

Fixes: ee67461e (tpcdump: Update to 4.99.4)

Reported by: glebius
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40578

12 months agohifn(4): Fix a typo in a source code comment
Gordon Bergling [Sat, 17 Jun 2023 08:51:23 +0000 (10:51 +0200)]
hifn(4): Fix a typo in a source code comment

- s/regesters/registers/

MFC after: 3 days

12 months agoxdr(3): Fix a typo in a source code comment
Gordon Bergling [Sat, 17 Jun 2023 08:49:40 +0000 (10:49 +0200)]
xdr(3): Fix a typo in a source code comment

- s/curren/current/

MFC after: 3 days

12 months agozfs: merge openzfs/zfs@10e36e176
Martin Matuska [Fri, 16 Jun 2023 21:12:27 +0000 (23:12 +0200)]
zfs: merge openzfs/zfs@10e36e176

Notable upstream pull request merges:
  #14948 Remove ARC/ZIO physdone callbacks
  #14963 Store the L2ARC device ashift in the vdev label
  #14970 Switch refcount tracking from lists to AVL-trees
  #14981 Shorten arcstat_quiescence sleep time

Obtained from: OpenZFS
OpenZFS commit: 10e36e17612ba9c634b140ae76847bb62b5be68f

12 months agoshare/mk/bsd.cpu.mk: handle the default case when CPUTYPE is not specified on powerpc*
Piotr Kubaj [Fri, 16 Jun 2023 09:43:42 +0000 (11:43 +0200)]
share/mk/bsd.cpu.mk: handle the default case when CPUTYPE is not specified on powerpc*

Approved by: imp
Differential Revision: https://reviews.freebsd.org/D40576

12 months agorc.suspend: update man pages for new keyword
Johannes Totz [Fri, 16 Jun 2023 16:48:17 +0000 (13:48 -0300)]
rc.suspend: update man pages for new keyword

rc.suspend has gained an rcorder keyword recently. Document it alongside
the existing resume keyword.

Reviewed By: mhorne, Pau Amma <pauamma@gundo.com>
Differential Revision: https://reviews.freebsd.org/D40484

12 months agohwpmc(4): document debugging options
Mitchell Horne [Fri, 16 Jun 2023 16:38:43 +0000 (13:38 -0300)]
hwpmc(4): document debugging options

The debug options for hwpmc are not documented in detail anywhere, and
setting it up was error-prone the first time I had to figure it out (and
each time I've had to remember it). Add some explanation of the required
options and describe the kern.hwpmc.debugflags sysctl format.

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

12 months agohwpmc: add error for HWPMC_DEBUG without KTR
Mitchell Horne [Fri, 16 Jun 2023 16:38:26 +0000 (13:38 -0300)]
hwpmc: add error for HWPMC_DEBUG without KTR

The option is a no-op otherwise, but this is not necessarily obvious.
Failing the compile gives the user a hint.

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40544

12 months agopmc: clarify and strengthen statements about API/ABI
Mitchell Horne [Fri, 16 Jun 2023 16:38:19 +0000 (13:38 -0300)]
pmc: clarify and strengthen statements about API/ABI

- Make it clear that applications are not only encouraged to use the
  pmc(3) library, but use of the hwpmc(4) interface directly is a
  use-case we do not support
- Move the COMPATIBILITY section above PROGRAMMING API in hwpmc(4)
- Drop statements about the driver and library being "under development"

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40543

12 months agohwpmc(4): more detailed SYNOPSYS
Mitchell Horne [Fri, 16 Jun 2023 16:38:03 +0000 (13:38 -0300)]
hwpmc(4): more detailed SYNOPSYS

Include some boilerplate similar to other section 4 man pages,
describing how to load the module at boot-time or include it in the
kernel.

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40542

12 months agohwpmc(4): remove paragraph about Pentium Pro handling
Mitchell Horne [Fri, 16 Jun 2023 16:34:02 +0000 (13:34 -0300)]
hwpmc(4): remove paragraph about Pentium Pro handling

Support for these CPUs was removed in 2018 (e92a1350b50e).

Reviewed by: jkoshy, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40541

12 months agonetlink: convert to IfAPI.
Alexander V. Chernikov [Fri, 16 Jun 2023 15:58:57 +0000 (15:58 +0000)]
netlink: convert to IfAPI.

Convert to IfAPI everything except `IF_AFDATA_WLOCK` usage in neigh.c.

Reviewed By: jhibbits
Differential Revision: https://reviews.freebsd.org/D40577

12 months agoifnet: fix if_strings.h build check
Alexander V. Chernikov [Fri, 16 Jun 2023 15:54:29 +0000 (15:54 +0000)]
ifnet: fix if_strings.h build check

12 months agonetlink: dump interface capabilities with other interface data.
Alexander V. Chernikov [Fri, 16 Jun 2023 14:56:39 +0000 (14:56 +0000)]
netlink: dump interface capabilities with other interface data.

This change exports interface capabilities using the standard
Netlink attribute type, bitset, and switches `ifconfig(8)` to use
it when displaying interface data.
Bitset comes in two representations. The first one is "compact",
where the bits are exported via two arrays - "mask" listing the
"valid" bits and "values, providing the values for those bits.
The second one is more verbose, listing each bit as a separate item,
with its name, id and value. The latter option is handy when submitting
update requests.

The support for setting capabilities will be added in the upcoming diffs.

Differential Revision: https://reviews.freebsd.org/D40331

12 months agoperiodic: Honor kern.localbase
Juraj Lutter [Tue, 6 Jun 2023 11:40:49 +0000 (13:40 +0200)]
periodic: Honor kern.localbase

Take kern.localbase into account with fallback to /usr/local and
also allow for LOCALBASE/etc/periodic.conf (similarly to what
many other utilities do).

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40435
MFC after: 2 weeks

12 months agoifconfig: fix armv6 build
Alexander V. Chernikov [Fri, 16 Jun 2023 08:23:14 +0000 (08:23 +0000)]
ifconfig: fix armv6 build

12 months agovm_phys: Fix typo in 9e8174289236
Alan Cox [Fri, 16 Jun 2023 08:12:42 +0000 (03:12 -0500)]
vm_phys: Fix typo in 9e8174289236

12 months agoipfw: add state/comment tests
Alexander V. Chernikov [Fri, 16 Jun 2023 07:24:19 +0000 (07:24 +0000)]
ipfw: add state/comment tests

12 months agoifconfig: use default (more rigid) WARNS level.
Alexander V. Chernikov [Wed, 14 Jun 2023 13:21:17 +0000 (13:21 +0000)]
ifconfig: use default (more rigid) WARNS level.

It helps catch more errors at compile time.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40536
MFC after: 2 weeks

12 months agoifconfig: remove global 'ifr' usage from ifmedia.c & remove 'ifr'.
Alexander V. Chernikov [Wed, 14 Jun 2023 13:04:10 +0000 (13:04 +0000)]
ifconfig: remove global 'ifr' usage from ifmedia.c & remove 'ifr'.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40535
MFC after: 2 weeks

12 months agoifconfig: remove (most of) the usages of global 'struct ifreq ifr'.
Alexander V. Chernikov [Wed, 14 Jun 2023 13:00:49 +0000 (13:00 +0000)]
ifconfig: remove (most of) the usages of global 'struct ifreq ifr'.

It is hard to reason about the contents of 'ifr' at any given time
as nearly every function sets random fields or pointers in this
structure.
Use local on-stack clean 'struct ifreq' for each function instead.

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D40534
MFC after: 2 weeks

12 months agovm_phys: add binary segment search
Doug Moore [Fri, 16 Jun 2023 06:43:45 +0000 (01:43 -0500)]
vm_phys: add binary segment search

Replace several sequential searches for a segment that contains a
phyiscal address with a call to a function that does it by binary
search.  In vm_page_reclaim_contig_domain_ext, find the first segment
to reclaim from, and reclaim from each subsequent appropriate segment.
Eliminate vm_phys_scan_contig.

Reviewed by: alc, markj
Differential Revision: https://reviews.freebsd.org/D40058