]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 years agoFix dtrace fbt return probes on arm64
Andrew Turner [Tue, 14 Dec 2021 15:49:07 +0000 (15:49 +0000)]
Fix dtrace fbt return probes on arm64

As with arm and riscv fix return fbt probes on arm64. arg0 should be
the offset within the function of the return instruction and arg1
should be the return value.

Reviewed by: kp, markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33440

2 years agobhnd: plug set-but-not-used vars
Mateusz Guzik [Tue, 14 Dec 2021 14:59:09 +0000 (14:59 +0000)]
bhnd: plug set-but-not-used vars

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

2 years agombuf: plug set-but-not-used vars
Mateusz Guzik [Tue, 14 Dec 2021 14:54:02 +0000 (14:54 +0000)]
mbuf: plug set-but-not-used vars

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

2 years agokobj: plug set-but-not-used vars
Mateusz Guzik [Tue, 14 Dec 2021 14:52:25 +0000 (14:52 +0000)]
kobj: plug set-but-not-used vars

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

2 years agoktls: plug set-but-not-used vars
Mateusz Guzik [Tue, 14 Dec 2021 14:44:37 +0000 (14:44 +0000)]
ktls: plug set-but-not-used vars

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

2 years agovirtio: plug some of set-but-not-used vars
Mateusz Guzik [Tue, 14 Dec 2021 14:38:42 +0000 (14:38 +0000)]
virtio: plug some of set-but-not-used vars

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

2 years agosis: plug set-but-not-used vars
Mateusz Guzik [Tue, 14 Dec 2021 14:31:10 +0000 (14:31 +0000)]
sis: plug set-but-not-used vars

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

2 years agoral: plug set-but-not-used vars
Mateusz Guzik [Tue, 14 Dec 2021 14:23:16 +0000 (14:23 +0000)]
ral: plug set-but-not-used vars

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

2 years agoipfilter userland: Replace sprintf with range checking version (snprintf)
Cy Schubert [Mon, 13 Dec 2021 22:54:38 +0000 (14:54 -0800)]
ipfilter userland: Replace sprintf with range checking version (snprintf)

MFC after: 1 week

2 years agoipfilter: radix_ipf is a kernel source file
Cy Schubert [Mon, 13 Dec 2021 21:35:43 +0000 (13:35 -0800)]
ipfilter: radix_ipf is a kernel source file

Remove duplicate radix_ipf.* files. They live in sys/.

MFC after: 1 week

2 years agoipfilter: Replace sprintf with range checking version (snprintf)
Cy Schubert [Mon, 13 Dec 2021 21:24:17 +0000 (13:24 -0800)]
ipfilter: Replace sprintf with range checking version (snprintf)

MFC after: 1 week

2 years agoipfilter radix_ipf: name is only valid with RDX_DEBUG
Cy Schubert [Mon, 13 Dec 2021 21:18:04 +0000 (13:18 -0800)]
ipfilter radix_ipf: name is only valid with RDX_DEBUG

ipf_rdx_node.name is only vaild when RDX_DEBUG is defined.

MFC after: 1 week

2 years agoipfilter: The SNPRINTF macro doesn't exist, remove it
Cy Schubert [Mon, 13 Dec 2021 21:04:34 +0000 (13:04 -0800)]
ipfilter: The SNPRINTF macro doesn't exist, remove it

MFC after: 1 week

2 years agohostapd: Fix wlan interfaces not UP/RUNNING
Cy Schubert [Mon, 13 Dec 2021 23:47:51 +0000 (15:47 -0800)]
hostapd: Fix wlan interfaces not UP/RUNNING

Like wpa_supplicant, hostapd does not automatically UP the interface
when configured. The fix is similar to 5fcdc19a8111.

Reported by: avg
Tested by: avg
MFC after: 1 week

2 years agovirtio console: plug set-but-not-used vars
Mateusz Guzik [Tue, 14 Dec 2021 14:14:34 +0000 (14:14 +0000)]
virtio console: plug set-but-not-used vars

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

2 years agovmx: plug set-but-not-used var
Mateusz Guzik [Tue, 14 Dec 2021 14:12:35 +0000 (14:12 +0000)]
vmx: plug set-but-not-used var

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

2 years agosdhci: plug set-but-not-unused vars
Mateusz Guzik [Tue, 14 Dec 2021 14:07:37 +0000 (14:07 +0000)]
sdhci: plug set-but-not-unused vars

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

2 years agovtnet: plug set-but-not-used vars
Mateusz Guzik [Tue, 14 Dec 2021 14:04:36 +0000 (14:04 +0000)]
vtnet: plug set-but-not-used vars

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

2 years agosk: plug set-but-not-used vars
Mateusz Guzik [Tue, 14 Dec 2021 14:03:56 +0000 (14:03 +0000)]
sk: plug set-but-not-used vars

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

2 years agoAdd genet.4 for RPi 4 Ethernet
Mike Karels [Thu, 9 Dec 2021 14:06:15 +0000 (08:06 -0600)]
Add genet.4 for RPi 4 Ethernet

Add new man page for genet(4) Ethernet on Raspberry Pi 4B, based on
several other Ethernet man pages.  Hook into build.

Note, this could potentially be added as an aarch64 man page; not
sure if that matters now.  Include if_genet(4) link as for other
network devices.

Copyright notice cloned from a recent FreeBSD Foundation copyright.

MFC after: 3 days
Reviewed by: imp bcr #manpages
Differential Revision: https://reviews.freebsd.org/D33360

2 years agodummynet: drop unused definitions
Franco Fichtner [Tue, 14 Dec 2021 12:00:06 +0000 (13:00 +0100)]
dummynet: drop unused definitions

Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D33429

2 years agocap_net: fix verification of bind permission
Mariusz Zaborski [Tue, 14 Dec 2021 11:01:10 +0000 (12:01 +0100)]
cap_net: fix verification of bind permission

MFC after: 5 days

2 years agocap_net: plug memory leak
Mariusz Zaborski [Tue, 14 Dec 2021 10:57:36 +0000 (11:57 +0100)]
cap_net: plug memory leak

MFC after: 5 days

2 years agoOnly change DMAP props on DMAP covered memory
Andrew Turner [Tue, 14 Dec 2021 10:05:15 +0000 (10:05 +0000)]
Only change DMAP props on DMAP covered memory

When changing memory properties in the arm64 pmap we need to keep both
the kernel address and DMAP mappings in sync.

To keep the kernel and DMAP memory in sync we recurse when updating the
former to also update the latter. There was insuffucuent checking around
this recursion. It would check if the virtual address is not within the
DMAP region, but not if the physical address is covered.

Add the missing check as without it the recursion may return an error.

Sponsored by: The FreeBSD Foundation

2 years agoloader/kboot: minor style nit
Warner Losh [Mon, 13 Dec 2021 23:53:04 +0000 (16:53 -0700)]
loader/kboot: minor style nit

Kill trailing white space.

Sponsored by: Netflix

2 years agolibdwarf: Add a weak uncompress() symbol
Mark Johnston [Mon, 13 Dec 2021 23:44:13 +0000 (18:44 -0500)]
libdwarf: Add a weak uncompress() symbol

This works around brokenness in buildworld's bootstrapping logic: it
uses the source tree's metadata to collect dependency info (such as,
"libdwarf depends on libz") but links against static host libraries.
If these two are out of sync, as is the case if one builds a commit
prior to the introduction of the libz dependency, then the build fails
when trying to statically link nm(1).

Mitigate the problem by defining a weak uncompress() symbol which simply
returns an error.  This ensures that the build won't fail when
statically linking libdwarf without zlib.  The downside is that any
tools using libdwarf without zlib will now hit a runtime error if they
attempt to decode compressed sections, but at least they'll fail
deterministically, and compressed debug info is only enabled by default
in main.

In particular, this fixes building of branches lacking commit
dbf05458e3bd, such as releng branches, stable/12 and 13 and old
revisions of main.  Previously the nm(1) build would fail with:

ld: error: undefined symbol: uncompress
>>> referenced by libdwarf_elf_init.c:233
>>> (/usr/src/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c:233)
>>>               libdwarf_elf_init.o:(_dwarf_elf_init) in archive
>>> /usr/lib/libdwarf.a

Reported by: dim, ler, krion
Reviewed by: imp, emaste
Fixes: dbf05458e3bd ("libdwarf: Support consumption of compressed ELF sections")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33419

2 years agolibdwarf: Fix error handling in _dwarf_elf_init()
Mark Johnston [Mon, 13 Dec 2021 23:45:24 +0000 (18:45 -0500)]
libdwarf: Fix error handling in _dwarf_elf_init()

We were not setting "ret" before jumping to the error path, so the
function returned success even when it had failed.

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

2 years agonfscl: add a filesize limit check to nfs_allocate()
Rick Macklem [Mon, 13 Dec 2021 23:32:19 +0000 (15:32 -0800)]
nfscl: add a filesize limit check to nfs_allocate()

As reported in PR#260343, nfs_allocate() did not check
the filesize rlimit. This patch adds that check.

PR: 260343
Reviewed by: asomers
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33422

2 years agonfsd: Limit parsing of layout errors to maxcnt bytes
Rick Macklem [Mon, 13 Dec 2021 23:21:31 +0000 (15:21 -0800)]
nfsd: Limit parsing of layout errors to maxcnt bytes

This patch decrements maxcnt by the appropriate
number of bytes during parsing and checks to see
if there is data remaining.  If not, it just returns
from nfsrv_flexlayouterr() without further processing.
This prevents the tl pointer from running off the end
of the error data pointed at by layp, if there are
flaws in the data.

Reported by: rtm@lcs.mit.edu
Tested by: rtm@lcs.mit.edu
PR: 260293
MFC after: 2 weeks

2 years agorc: network.subr improve network6_getladdr()
Bjoern A. Zeeb [Mon, 13 Dec 2021 22:10:25 +0000 (22:10 +0000)]
rc: network.subr improve network6_getladdr()

In network6_getladdr() we are iterating over inet6 lines and are not
interested in any others.  So tell ifconfig to limit output to "inet6"
as much as possible.
This is probably a micro-optimisation but was noticed while looking
at other IPv6-related boot-time improvements.

MFC after: 1 week

2 years agoloader:prefix is only used for LOADER_VERIEXEC
Warner Losh [Mon, 13 Dec 2021 19:02:16 +0000 (12:02 -0700)]
loader:prefix is only used for LOADER_VERIEXEC

Only define and set prefix when LOADER_VERIEXEC is defined. It's only
used by the LOADER_VERIEXEC code.

Sponsored by: Netflix

2 years agondp tests: fix cleanup
Kristof Provost [Mon, 13 Dec 2021 17:13:42 +0000 (18:13 +0100)]
ndp tests: fix cleanup

Fix the cleanup function name so we actually remove our test jail and
interfaces.

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

2 years agosys/dev/arcmsr: Update Areca RAID driver to fix some issues on ARC-1886.
黃清隆 [Mon, 13 Dec 2021 16:09:15 +0000 (08:09 -0800)]
sys/dev/arcmsr: Update Areca RAID driver to fix some issues on ARC-1886.

1. Doorbell interrupt status may arrive lately when doorbell interrupt on
   ARC-1886.
2. System boot up hung when ARC-1886 with no volume created or no device
   attached.

Many thanks to Areca for continuing to support FreeBSD.

MFC after: 2 weeks

2 years agoAdd accelerated arm64 sha512 to libmd
Andrew Turner [Fri, 19 Nov 2021 11:32:58 +0000 (11:32 +0000)]
Add accelerated arm64 sha512 to libmd

As with sha256 add support for accelerated sha512 support to libmd on
arm64. This depends on clang 13+ to build as this is the first release
with the needed intrinsics. Gcc should also support them, however from
a currently unknown release.

Reviewed by: cem
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33373

2 years agopf tests: log additional information when a test ends
Kristof Provost [Mon, 13 Dec 2021 12:01:27 +0000 (13:01 +0100)]
pf tests: log additional information when a test ends

Log information from the running jails (routing, interfaces and pf) as
well as interfaces on the host.

This information is expected to be useful in debugging test failures.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

2 years agoipfilter: Fix struct ifnet pointer type
Cy Schubert [Sun, 12 Dec 2021 23:57:36 +0000 (15:57 -0800)]
ipfilter: Fix struct ifnet pointer type

The fr_info struct contains a summary of a packet. One of its fields
is a pointer to the ifnet struct the packet arrived on. It is pointed
to by a void* because ipfilter supports multiple O/Ses. Unfortunately
this makes it difficult it examine with DTrace. Defining fin_ifp as a
pointer to an ifnet struct makes the struct it points to using a DTrace
script possible.

MFC after: 1 week

2 years agoRevert "mmc_sim: fix setting of the mutex name"
Andriy Gapon [Mon, 13 Dec 2021 11:51:47 +0000 (13:51 +0200)]
Revert "mmc_sim: fix setting of the mutex name"

This reverts commit df472af034e7726dea533ac7f44440dad4ba6a34.

The change hasn't been reviewed.

2 years agods3231: fix accidental breakage of !FDT in 1256067c
Andriy Gapon [Mon, 13 Dec 2021 11:49:47 +0000 (13:49 +0200)]
ds3231: fix accidental breakage of !FDT in 1256067c

MFC after: 10 days

2 years agommc_sim: fix setting of the mutex name
Andriy Gapon [Fri, 26 Nov 2021 14:00:45 +0000 (16:00 +0200)]
mmc_sim: fix setting of the mutex name

To quote the manual:
 The pointer passed in as name and type is saved rather than the data
 it points to.  The data pointed to must remain stable until the mutex
 is destroyed.

It seems that the type is actually copied, but the name is stored as
a pointer indeed.
mmc_cam_sim_alloc used a name stored on stack.
So, a corrupt mutex name would be reported.
For example:
  lock order reversal: (sleepable after non-sleepable)
  1st 0xd7285b20 <8A><C0><C0>P@<C1><D0>P@<C1>^D^A (aw_mmc_sim, sleep mutex) @ /usr/devel/git/orange/sys/cam/cam_xpt.c:2804

This change moves the name to struct mmc_sim.
Also, that name is used as the sim name as well.
Unused mtx_name variable is removed too.

2 years agods3231: allow configuration via hints on FDT systems
Andriy Gapon [Mon, 13 Dec 2021 07:21:08 +0000 (09:21 +0200)]
ds3231: allow configuration via hints on FDT systems

MFC after: 10 days

2 years agopcf8591: remove write-only variables
Andriy Gapon [Mon, 13 Dec 2021 11:10:12 +0000 (13:10 +0200)]
pcf8591: remove write-only variables

MFC after: 1 week

2 years agoamdsbwd: always enable watchdog register decoding
Andriy Gapon [Wed, 27 May 2020 10:15:54 +0000 (13:15 +0300)]
amdsbwd: always enable watchdog register decoding

This seems to be required even if the watchdog is accessed via the common
MMIO space.

Tested on:
- Ryzen 3 3200U APU;
- Ryzen 7 5800X CPU with X570 chipset.

MFC after: 2 weeks

2 years agokbdmap: adapt to the new libbsddialog API
Alfonso Siciliano [Mon, 13 Dec 2021 08:06:21 +0000 (09:06 +0100)]
kbdmap: adapt to the new libbsddialog API

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

2 years agotzsetup: adapt for libbsddialog 0.0.1
Alfonso Siciliano [Mon, 13 Dec 2021 08:03:40 +0000 (09:03 +0100)]
tzsetup: adapt for libbsddialog 0.0.1

libbsdialog 0.0.1 provides:
* bsddialog_conf.auto_minwidth:
* menurows is variable with autosize (properly defines max menurows)

Then tzsetup can use BSDDIALOG_AUTOSIZE keeping the dialog behavior:
min 24 cols, max 16 menurows

Differential revision: https://reviews.freebsd.org/D33397

2 years agobsddialog: import version 0.0.1
Baptiste Daroussin [Mon, 13 Dec 2021 08:01:21 +0000 (09:01 +0100)]
bsddialog: import version 0.0.1

2 years agobsddialog: import version 0.0.1
Alfonso Siciliano [Mon, 13 Dec 2021 07:54:07 +0000 (08:54 +0100)]
bsddialog: import version 0.0.1

2 years agoAdd a tool to test AVX context integrity under ctx switches and signals (amd64)
Konstantin Belousov [Mon, 13 Dec 2021 02:31:40 +0000 (04:31 +0200)]
Add a tool to test AVX context integrity under ctx switches and signals (amd64)

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agonfscl: Fix must_commit handling for mirrored pNFS mounts
Rick Macklem [Sun, 12 Dec 2021 23:40:30 +0000 (15:40 -0800)]
nfscl: Fix must_commit handling for mirrored pNFS mounts

For pNFS mounts to mirrored Flexible File layout pNFS servers,
the "must_commit" component in the nfsclwritedsdorpc
structure must be checked and the "must_commit" argument passed
into nfscl_doiods() must be updated.  Technically, only writes to
the DS with a writeverf change must be redone, but since this
occurrence will be rare, the must_commit argument to nfscl_doiosd()
is set to 1, so all writes to all DSs will be redone.

This bug would affect few, since use of mirrored pNFS servers
is rare and "writeverf" rarely changes. Normally "writeverf"
only changes when a NFS server reboots.

MFC after: 2 weeks

2 years agobhyve: set EV_CLEAR for EVFILT_VNODE mevents
Robert Wing [Sun, 12 Dec 2021 21:39:40 +0000 (12:39 -0900)]
bhyve: set EV_CLEAR for EVFILT_VNODE mevents

When an EVFILT_VNODE filter event is triggered, reset it.

This fixes the issue where a virtio-blk resize event would cause the
mevent thread to consume 100% of the cpu.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D33326

2 years agoRevert clang change that breaks CTF on aarch64
Dimitry Andric [Sun, 12 Dec 2021 20:11:40 +0000 (21:11 +0100)]
Revert clang change that breaks CTF on aarch64

Revert commit e655e74a318e from llvm git (by Peter Collingbourne):

  AST: Create __va_list in the std namespace even in C.

  This ensures that the mangled type names match between C and C++,
  which is significant when using -fsanitize=cfi-icall. Ideally we
  wouldn't have created this namespace at all, but it's now part of
  the ABI (e.g. in mangled names), so we can't change it.

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

As reported by Jessica in https://reviews.llvm.org/D104830#3129527, this
upstream change is implemented in such a way that it breaks DTrace's
CTF. Since a proper fix has not yet been forthcoming, and we are
unaffected by the (CFI-related) problem upstream was trying to address,
revert the change for now.

Requested by: jrtc27
MFC after: 3 days

2 years agoamd64: correct size of the SSE area in the xsave layout
Konstantin Belousov [Sun, 12 Dec 2021 02:49:50 +0000 (04:49 +0200)]
amd64: correct size of the SSE area in the xsave layout

PR: https://github.com/golang/go/issues/46272
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

2 years agoexec_elf: use intermediate u_long variable to correct mismatched type
Konstantin Belousov [Sun, 12 Dec 2021 16:47:26 +0000 (18:47 +0200)]
exec_elf: use intermediate u_long variable to correct mismatched type

vm_offset_t * vs. u_long *

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 years agobhyve: Support a _VARS.fd file for bootrom
Rebecca Cran [Sun, 28 Nov 2021 16:34:33 +0000 (09:34 -0700)]
bhyve: Support a _VARS.fd file for bootrom

OVMF creates two separate .fd files, a _CODE.fd file containing
the UEFI code, and a _VARS.fd file containing a template of an
empty UEFI variable store.

OVMF decides to write variables to the memory range just below the
boot rom code if it detects a CFI flash device. So here we add
just the barest facsimile of CFI command handling to bootrom.c
that is needed to placate OVMF.

Submitted by: D Scott Phillips <d.scott.phillips@intel.com>
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19976
MFC After: 1 week

2 years agoimgact_elf: avoid mapsz overflow
Konstantin Belousov [Wed, 8 Dec 2021 09:33:19 +0000 (11:33 +0200)]
imgact_elf: avoid mapsz overflow

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33359

2 years agoimgact_elf: check that the alignment of PT_LOAD segment is power of two
Konstantin Belousov [Thu, 9 Dec 2021 15:27:24 +0000 (17:27 +0200)]
imgact_elf: check that the alignment of PT_LOAD segment is power of two

and stop recalculating alignment for PIE base, which was off by one
power of two.

Suggested and reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33359

2 years agoimgact_elf: exclude invalid alignment requests
Konstantin Belousov [Wed, 8 Dec 2021 09:33:57 +0000 (11:33 +0200)]
imgact_elf: exclude invalid alignment requests

Only accept at most superpage alignment, or if the arch does not have
superpages supported, artificially limit it to PAGE_SIZE * 1024.
This is somewhat arbitrary, and e.g. could change what binaries do
we accept between native i386 vs. amd64 ia32 with superpages disabled,
but I do not believe the difference there is affecting anybody with
real (useful) binaries.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33359

2 years agornd_elf: add comment explaining the interface
Konstantin Belousov [Thu, 9 Dec 2021 15:22:54 +0000 (17:22 +0200)]
rnd_elf: add comment explaining the interface

Requested and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33359

2 years agoelf image activator: convert asserts into errors
Konstantin Belousov [Tue, 7 Dec 2021 09:29:53 +0000 (11:29 +0200)]
elf image activator: convert asserts into errors

Invalid (artificial) layout of the loadable ELF segments might result in
triggering the assertion.  This means that the file should not be
executed, regardless of the kernel debug mode.  Change calling
conventions for rnd_elf{32,64} helpers to allow returning an error, and
abort activation with ENOEXEC if its invariants are broken.

Reported and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33359

2 years agoexec_elf: assert that the image vnode is still locked on return
Konstantin Belousov [Thu, 9 Dec 2021 15:14:46 +0000 (17:14 +0200)]
exec_elf: assert that the image vnode is still locked on return

Suggested and reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33359

2 years agoStyle
Konstantin Belousov [Wed, 8 Dec 2021 15:08:59 +0000 (17:08 +0200)]
Style

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33359

2 years agonfscl: Fix must_commit/writeverf handling for Direct I/O
Rick Macklem [Sat, 11 Dec 2021 23:00:30 +0000 (15:00 -0800)]
nfscl: Fix must_commit/writeverf handling for Direct I/O

Without this patch, the KASSERT(must_commit == 0,..) can be
triggered by the writeverf in the Direct I/O write reply changing.
This is not a situation that should cause a panic(). Correct
handling is to ignore the change in "writeverf" for Direct
I/O, since it is done with NFSWRITE_FILESYNC.

This patch modifies the semantics of the "must_commit"
argument slightly, allowing an initial value of 2 to indicate
that a change in "writeverf" should be ignored.
It also fixes the KASSERT()s.

This bug would affect few, since Direct I/O is not enabled
by default and "writeverf" rarely changes. Normally "writeverf"
only changes when a NFS server reboots, however I found the
bug when testing against a Linux 5.15.1 kernel nfsd, which
replied to a NFSWRITE_FILESYNC write with a "writeverf" of all
0x0 bytes.

MFC after: 2 weeks

2 years agoloader: framebuffer should only be written into
Toomas Soome [Mon, 6 Dec 2021 17:21:58 +0000 (19:21 +0200)]
loader: framebuffer should only be written into

Reading from Write Combining memory can be very-very slow. Try to use
shadow buffer to avoid such reads.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33305

2 years agostress2: Remove tests from the exclude list
Peter Holm [Sat, 11 Dec 2021 10:45:11 +0000 (10:45 +0000)]
stress2: Remove tests from the exclude list

2 years agostress2: Disable aslr for this test to work
Peter Holm [Sat, 11 Dec 2021 10:43:30 +0000 (10:43 +0000)]
stress2: Disable aslr for this test to work

2 years agostress2: Save a copy of the program file for regression tests
Peter Holm [Sat, 11 Dec 2021 06:07:04 +0000 (06:07 +0000)]
stress2: Save a copy of the program file for regression tests

Suggested by:  kib

2 years agoip_log: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 05:11:45 +0000 (21:11 -0800)]
ip_log: remove set-but-not-unused vars

MFC after: 3 days

2 years agoippool: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 05:01:14 +0000 (21:01 -0800)]
ippool: remove set-but-not-unused vars

Display of stats from a kernel core dump was never fully implemented.
Remove the dangling vars and remove the documentation.

MFC after: 3 days

2 years agoipfcomp: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:56:10 +0000 (20:56 -0800)]
ipfcomp: remove set-but-not-unused vars

MFC after: 3 days

2 years agoipfilter printfieldhdr: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:51:01 +0000 (20:51 -0800)]
ipfilter printfieldhdr: remove set-but-not-unused vars

MFC after: 3 days

2 years agoipft_tx: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:49:22 +0000 (20:49 -0800)]
ipft_tx: remove set-but-not-unused vars

MFC after: 3 days

2 years agoipft_pc: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:48:17 +0000 (20:48 -0800)]
ipft_pc: remove set-but-not-unused vars

MFC after: 3 days

2 years agoipft_hx: remove set-but-not-unused vars
Cy Schubert [Sat, 11 Dec 2021 04:46:11 +0000 (20:46 -0800)]
ipft_hx: remove set-but-not-unused vars

MFC after: 3 days

2 years agoMake msgbuf_peekbytes() not return leading zeroes.
Alexander Motin [Sat, 11 Dec 2021 04:18:52 +0000 (23:18 -0500)]
Make msgbuf_peekbytes() not return leading zeroes.

Introduce new MSGBUF_WRAP flag, indicating that buffer has wrapped
at least once and does not keep zeroes from the last msgbuf_clear().
It allows msgbuf_peekbytes() to return only real data, not requiring
every consumer to trim the leading zeroes after doing pointless copy.
The most visible effect is that kern.msgbuf sysctl now always returns
proper zero-terminated string, not only after the first buffer wrap.

MFC after: 1 week
Sponsored by: iXsystems, Inc.

2 years agoif_epair: fix module build outside of kernel build environment
Eugene Grosbein [Sat, 11 Dec 2021 04:07:50 +0000 (11:07 +0700)]
if_epair: fix module build outside of kernel build environment

MFC after: 3 days

2 years agorc.conf.5: Fix a typo
Mateusz Piotrowski [Fri, 10 Dec 2021 22:36:38 +0000 (23:36 +0100)]
rc.conf.5: Fix a typo

2 years agovfs: annotate all unused MNTK_ flags
Mateusz Guzik [Fri, 10 Dec 2021 20:06:28 +0000 (20:06 +0000)]
vfs: annotate all unused MNTK_ flags

2 years agovfs: retire MNTK_NOKNOTE and VV_NOKNOTE
Mateusz Guzik [Fri, 10 Dec 2021 14:08:26 +0000 (15:08 +0100)]
vfs: retire MNTK_NOKNOTE and VV_NOKNOTE

MNTK_NOKNOTE was introduced in 679985d03a64f5dfb4355538ae6e3b70f8347f38
(dated 2005), VV_NOKNOTE in 34cc826ae8999f454dd6cb9c77d17ce83b169f92 few
months later.

Neither was ever used by anything in the tree.

2 years agolibkvm: fix kvm_walk_pages
Bora Özarslan [Thu, 25 Nov 2021 19:09:26 +0000 (14:09 -0500)]
libkvm: fix kvm_walk_pages

Correct bitmap operations in _kvm_bitmap_next.

Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19183

2 years agomips: Turn off LLVM MIPS targets by default
Warner Losh [Fri, 10 Dec 2021 18:31:07 +0000 (11:31 -0700)]
mips: Turn off LLVM MIPS targets by default

Now that MIPS isn't a recognized target for buildworld, move llvm mips
to off by default.

Sponsored by: Netflix
Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D33364

2 years agostand: remove mips support
Warner Losh [Fri, 10 Dec 2021 18:04:48 +0000 (11:04 -0700)]
stand: remove mips support

As part of decommissioning mips support, remove the boot loader
support. Do this in advance of other boot loader work to limit the
amount of work that will be thrown away.

Sponsored by: Netflix
Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D33377

2 years agoloader.mk: Simplify a little bit
Warner Losh [Fri, 10 Dec 2021 18:04:37 +0000 (11:04 -0700)]
loader.mk: Simplify a little bit

The elf loader needs to know how to reach into the gfx_fb code, so
simplify how we include files to find that stuff.

Sponsored by: Netflix
Reviewed by: manu, tsoome
Differential Revision: https://reviews.freebsd.org/D33376

2 years agohdda: Remove extra topo_unlock
Warner Losh [Fri, 10 Dec 2021 17:00:20 +0000 (10:00 -0700)]
hdda: Remove extra topo_unlock

Reported by: Taku YAMAMOTO
Sponsored by: Netflix

2 years agopcf85063: Fix real time clock
Hubert Mazur [Fri, 10 Dec 2021 15:07:25 +0000 (16:07 +0100)]
pcf85063: Fix real time clock

Previosuly real time clock driver always set time format to 12-hour
mode. Fix this by choosing hour mode depending on HW register.

2 years agogmultipath.8: Fix a typo
Mateusz Piotrowski [Fri, 10 Dec 2021 13:32:33 +0000 (14:32 +0100)]
gmultipath.8: Fix a typo

It's Word Wide Port Name, not World Word Port Name.

MFC after: 3 days

2 years agoFix a set but not used warning in the arm GIC driver
Andrew Turner [Fri, 10 Dec 2021 12:30:01 +0000 (12:30 +0000)]
Fix a set but not used warning in the arm GIC driver

Sponsored by: Innovate UK

2 years agoFix set but not used warnings in arm64 rockchip
Andrew Turner [Fri, 10 Dec 2021 12:23:21 +0000 (12:23 +0000)]
Fix set but not used warnings in arm64 rockchip

Reviewed by: manu, mmel
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33372

2 years agobxe: plug some of set-but-not-used vars
Mateusz Guzik [Fri, 10 Dec 2021 12:19:16 +0000 (12:19 +0000)]
bxe: plug some of set-but-not-used vars

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

2 years agoFix set but not used warnings in arm64 core code
Andrew Turner [Fri, 10 Dec 2021 12:06:25 +0000 (12:06 +0000)]
Fix set but not used warnings in arm64 core code

2 years agoFix a set but not used warning in the arm64 pmap
Andrew Turner [Tue, 7 Dec 2021 14:32:11 +0000 (14:32 +0000)]
Fix a set but not used warning in the arm64 pmap

In pmap_ts_referenced we read the virtual address from pv->pv_va,
but then continue to use the pv struct to get the same value later
in the function.

Use the virtual address value we initially read rather than loading
from the pv struct each time.

2 years agohn: plug set-but-not-unused vars
Mateusz Guzik [Fri, 10 Dec 2021 12:09:26 +0000 (12:09 +0000)]
hn: plug set-but-not-unused vars

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

2 years agoctl: plug set-but-not-unused var
Mateusz Guzik [Fri, 10 Dec 2021 12:06:48 +0000 (12:06 +0000)]
ctl: plug set-but-not-unused var

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

2 years agobfe: plug a set-but-not-unused var
Mateusz Guzik [Fri, 10 Dec 2021 12:02:05 +0000 (12:02 +0000)]
bfe: plug a set-but-not-unused var

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

2 years agox86: plug a set-but-not-unused var in native_lapic_ipi_free
Mateusz Guzik [Fri, 10 Dec 2021 11:55:03 +0000 (11:55 +0000)]
x86: plug a set-but-not-unused var in native_lapic_ipi_free

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

2 years agonfe: plug set-but-not-unused vars
Mateusz Guzik [Fri, 10 Dec 2021 11:53:38 +0000 (11:53 +0000)]
nfe: plug set-but-not-unused vars

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

2 years agoalc: plug set-but-not-unused vars
Mateusz Guzik [Fri, 10 Dec 2021 11:48:42 +0000 (11:48 +0000)]
alc: plug set-but-not-unused vars

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

2 years agoasmc: plug set-but-not-unused vars
Mateusz Guzik [Fri, 10 Dec 2021 11:45:36 +0000 (11:45 +0000)]
asmc: plug set-but-not-unused vars

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

2 years agoxdma: Fix another -Wunused-but-set-variable warning previously missed
Jessica Clarke [Fri, 10 Dec 2021 05:06:54 +0000 (05:06 +0000)]
xdma: Fix another -Wunused-but-set-variable warning previously missed

MFC after: 1 week

2 years agoriscv: Fix PLIC -Wunused-but-set-variable warnings
Jessica Clarke [Fri, 10 Dec 2021 04:51:32 +0000 (04:51 +0000)]
riscv: Fix PLIC -Wunused-but-set-variable warnings

2 years agoxdma: Fix -Wunused-but-set-variable warnings
Jessica Clarke [Fri, 10 Dec 2021 04:48:51 +0000 (04:48 +0000)]
xdma: Fix -Wunused-but-set-variable warnings

MFC after: 1 week

2 years agobusdma: Remove outdated comments about Giant.
Alexander Motin [Fri, 10 Dec 2021 03:17:54 +0000 (22:17 -0500)]
busdma: Remove outdated comments about Giant.

MFC after: 2 weeks