Commit Graph

270313 Commits

Author SHA1 Message Date
Konstantin Belousov
16b238b740 libc/rpc/getrpcent.c: Mark write-only variables as unused
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-29 17:39:50 +02:00
Konstantin Belousov
0e00befcaf libc/net/nscachedcli.c: remove write-only variables
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-29 17:39:50 +02:00
Konstantin Belousov
346eaa41f8 libc/net/getservent.c: Mark write-only variables as unused
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-29 17:39:50 +02:00
Konstantin Belousov
f6d403743c libc/net/getprotoent.c: Mark write-only variables as unused
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-29 17:39:50 +02:00
Konstantin Belousov
1c4f305d21 libc/net/getnetnamadr.c: Mark write-only variables as unused
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-29 17:39:50 +02:00
Konstantin Belousov
024547c9bd libc/net/gethostnamadr.c: mark write-only variables as __unused
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-29 17:39:50 +02:00
Konstantin Belousov
701473ef94 libc/gen/getpwent.c: plug warnings about write-only variables
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-29 17:39:50 +02:00
Konstantin Belousov
075fa5a9a8 libc/gen/getgrent.c: plug warnings about write-only variables
The variables clang13 complains about take the results of var_arg() calls.
I decided to kept variables around, annotating their definitions with
__unused, to keep clear expected types of the varargs.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2021-11-29 17:39:50 +02:00
Mateusz Piotrowski
5d21348dfd rc.subr.8: Document changes to load_rc_config
Since e27961a496, load_rc_config does not
require a service name as its first argument. This change was documented
in the rc.subr script in 0b9c2e7ac5. Let's
update the manual page as well.

MFC after:	3 days
2021-11-29 16:09:02 +01:00
Mateusz Piotrowski
aa798fc2f1 apic.4: Fix a typo
MFC after:	3 days
2021-11-29 16:09:02 +01:00
Michael Tuexen
147bf5e930 tcp: Don't try to upgrade a read lock just for logging
Reviewed by:		glebius, lstewart, rrs
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D33098
2021-11-29 13:48:40 +01:00
Alfredo Dal'Ava Junior
e671037b3c powerpc64le: add LINT64LE kernel config
Add configuration file to be used by "FreeBSD-<branch>-powerpc64le-LINT"
CI/Jenkins job

Reviewed by:	lwhsu
MFC after:	2 days
Sponsored by:	Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D33136
2021-11-29 12:08:26 -03:00
Alan Somers
d109559ddb fusefs: fix 32-bit build of the tests after 91972cfcdd
MFC after:	2 weeks
MFC with:	91972cfcdd
2021-11-28 20:35:42 -07:00
Alexander Motin
cfb0e4d76c xhci: Add PCI IDs for Thunderbolt 3/4 USB controllers.
MFC after:	2 weeks
2021-11-28 21:29:26 -05:00
Alan Somers
91972cfcdd fusefs: update atime on reads when using cached attributes
When using cached attributes, whether or not the data cache is enabled,
fusefs must update a file's atime whenever it reads from it, so long as
it wasn't mounted with -o noatime.  Update it in-kernel, and flush it to
the server on close or during the next setattr operation.

The downside is that close() will now frequently trigger a FUSE_SETATTR
upcall.  But if you care about performance, you should be using
-o noatime anyway.

MFC after:	2 weeks
Reviewed by:	pfg
Differential Revision: https://reviews.freebsd.org/D33145
2021-11-28 18:53:31 -07:00
Alan Somers
65d70b3bae fusefs: fix copy_file_range when extending a file
When copy_file_range extends a file, it must update the cached file
size.

MFC after:	2 weeks
Reviewed by:	rmacklem, pfg
Differential Revision: https://reviews.freebsd.org/D33151
2021-11-28 18:35:58 -07:00
Rick Macklem
638b90a191 nfs: Quiet a few "unused" warnings
For most of these warnings, the variable is loaded
with data parsed out of an RPC messages.  In case
the data is useful in the future, I just marked
these with __unused.
2021-11-28 15:48:51 -08:00
Alan Somers
8fbae6c7bd fusefs: delete a redundant getnanouptime
It's been redundant since SVN r346060 added another getnanouptime just
above.

MFC after:	2 weeks
2021-11-28 16:05:30 -07:00
Danilo G. Baio
ec80eab8a1 motd: Fix Questions List address
Following mailing lists migration from Mailman to Mlmmj.

https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
-->
https://lists.freebsd.org/subscription/freebsd-questions

Adding a short link (as we already have for Faq and Handbook), so all
links can be indented the same way.

Reviewed by:	imp (earlier version)
Approved by:	lwhsu
Differential Revision: https://reviews.freebsd.org/D33101
2021-11-28 18:15:04 -03:00
Ed Maste
28dcccc129 x86 GENERIC/MINIMAL: group sc(4) devices together
The vga and splash devices are part of the sc(4) system console. vt(4)
uses the vt_vga driver instead, and has some limited splash support
directly in vt_core.c.  Leave the sc(4) options in GENERIC/MINIMAL (for
now) but group them together under an sc(4) comment.

Sponsored by:	The FreeBSD Foundation
2021-11-28 14:38:41 -05:00
Ed Maste
777526ed83 Remove options VESA from x86 MINIMAL
Followup to b8cf1c5c30, remove from MINIMAL in addition to GENERIC.

options VESA / vesa.ko provides VESA Bios Extensions (VBE) support for
the legacy sc(4) console.  It is not used by the default console, vt(4).

PR:		253733
Fixes:		b8cf1c5c30 ("Remove options VESA from x86 GENERIC")
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2021-11-28 14:37:46 -05:00
Bjoern A. Zeeb
bfcc09ddd4 iwlwifi: import Intel's iwlwifi/mvm driver.
Over the past few months we published multiple snapshots for this
Linux derived driver and it has become fairly stable in terms of
minimal local changes needed for new updates.

The current version is based on iwlwifi-next update at
cbaa6aeedee5f92dafa5982eceea2a1f98ce4f7d with the addition of
a hand full of files replaced for FreeBSD.

Given the lack of full license texts on non-local files this is
imported under the draft policy for handling SPDX files (D29226). [1]

Do not yet hook this to the build until the remaining compat code
is all in.  Along with the firmware import this will make publishing
the last bits and final testing a lot easier.

Sponsored by:   The FreeBSD Foundation
Approved by:    core (imp) [1]
MFC after:      10 days
2021-11-28 19:17:04 +00:00
Bjoern A. Zeeb
f4c129f5fb iwlwifi: import firmware for Intel iwlwifi/mvm supported chipsets.
Import the most recent versions of the firmware images for iwlwifi
chipsets supported by the "mvm" sub-driver.
This is based on linux-firmware at f5d519563ac9d2d1f382a817aae5ec5473811ac8.
The license of the firmware matches the previous iwnfw(4) and
iwmfw(4) firmware files and you can find a copy in
sys/contrib/dev/iwlwififw/LICENCE.iwlwifi_firmware .

Add build infrastructure to create the .ko files but do not yet hook
it up to the build until all parts are in the tree.
There is an open issue concerning kldxref that we need to resolve
(D32383).

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2021-11-28 19:17:03 +00:00
Mateusz Guzik
b6c8c7b99a pf: add pf_bcmp_state_key
Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33131
2021-11-28 20:15:45 +01:00
Ed Maste
0179739a00 OptionalObsoleteFiles: remove ping with INET & INET6 disabled
Reported by:	kevans
Fixes:		a4ef9e58bc ("sbin: build ping if at least one of...")
Sponsored by:	The FreeBSD Foundation
2021-11-28 13:23:29 -05:00
Ed Maste
a4ef9e58bc sbin: build ping if at least one of INET & INET6 is enabled
It does not build (and serves no purpose) if neither is true (i.e.,
building WITHOUT_INET and WITHOUT_INET6).  Also add an explicit error
in ping to make this case clear.

PR:		260082
Sponsored by:	The FreeBSD Foundation
2021-11-28 13:05:39 -05:00
Ed Maste
b8cf1c5c30 Remove options VESA from x86 GENERIC
options VESA / vesa.ko provides VESA Bios Extensions (VBE) support for
the legacy sc(4) console.  It is not used by the default console, vt(4).

There is a report[1] of an incompatibility between VESA and the Nvidia
driver breaking suspend/resume.  Since VESA is not used by the default
configuration anyway, just remove options VESA from GENERIC.  The kernel
module is still available and may be loaded by sc(4) users who want to
select a VBE mode.

(Note that vt(4) does not support selecting a VBE mode.  The loader can
set a VBE mode and vt(4) will use it via the vt_vbefb driver.)

[1] https://lists.freebsd.org/archives/freebsd-hackers/2021-November/000469.html

PR:		253733
Reported by:	Stefan Blachmann [1]
Reviewed by:	imp, manu, tsoome
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33141
2021-11-28 11:29:17 -05:00
Konstantin Belousov
4f924a786a linker_kldload_busy(): allow recursion
Some drivers recursively loads modules by explicit calls to kldload
during initialization, which might occur during kldload.

PR:	259748
Reported and tested by:	thj
Reviewed by:	markj
Sponsored by:	Nvidia networking
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D32972
2021-11-28 10:36:09 +02:00
Li-Wen Hsu
dad71022bd
Disable flaky test lib.libc.sys.setrlimit_test.setrlimit_stack
PR:		259969
Sponsored by:	The FreeBSD Foundation
2021-11-28 14:58:21 +08:00
Rick Macklem
c3134a6af0 nfscl: Disable use of the LookupOpen RPC
The LookupOpen RPC reduces the number of Open RPCs
needed.  Unfortunately, it breaks certain software
builds over NFS, so disable it until this is fixed.

The LookupOpen RPC is only used for NFSv4.1/4.2
mounts when the "oneopenown" mount option is
specified, so this should not affect many users.
2021-11-27 15:34:45 -08:00
Mateusz Guzik
e511bd1406 vfs: fully lockless v_writecount adjustment
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D33128
2021-11-27 23:07:26 +00:00
Mateusz Guzik
4dcdf3987c vfs: replace the MNTK_TEXT_REFS flag with VIRF_TEXT_REF
This allows to stop maintaing the VI_TEXT_REF flag and consequently
opens up fully lockless v_writecount adjustment.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D33127
2021-11-27 23:07:25 +00:00
Rick Macklem
1c15c8c0e9 nfscl: Sanity check the Sequence slotid in reply
The slotid in the Sequence reply must be the same as
in the request.  Check that it is the same and log
a console message if it is not, plus set it to the
correct value.

Reported by:	rtm@lcs.mit.edu
Tested by:	rtm@lcs.mit.edu
PR:	260071
MFC after:	2 weeks
2021-11-27 15:02:04 -08:00
Ed Maste
228e020a3b Correct syscons description in i386 and amd64 configs
Commit 2d6f6d6373 switched to vt(4) as the default console.

Sponsored by:	The FreeBSD Foundation
2021-11-27 16:22:42 -05:00
Peter Holm
7184e8c211 Keep running fsck_ffs as long as "WAS MODIFIED" is reported 2021-11-27 10:54:53 +00:00
Wei Hu
75412a521f Hyper-V: vPCI: Prepopulate device bars
In recent Hyper-V releases on Windows Server 2022, vPCI code does not
initialize the last 4 bit of device bar registers. This behavior change
could result weird problems cuasing PCI code failure when configuring
bars.

Just write all 1's to those bars whose probed values are not the same
as current read ones. This seems to make Hyper-V vPCI and
pci_write_bar() to cooperate correctly on these releases.

Reported by:	khng@freebsd.org
Tested by:	khng@freebsd.org
MFC after:	2 weeks
Sponsored by:	Microsoft
2021-11-27 06:42:34 +00:00
Alexander Motin
83d7b2f335 xhci: Add PCI IDs from recent Intel CPUs.
MFC after:	2 weeks
2021-11-26 20:35:12 -05:00
Rick Macklem
5b430a1323 nfsd: Sanity check the len argument for ListXattr
The check for the original len being >= retlen needs to
be done before the "if (nd->nd_repstat == 0)" code, so
that it can be reported as too small.

Reported by:	rtm@lcs.mit.edu
Tested by:	rtm@lcs.mit.edu
PR:	260046
MFC after:	2 weeks
2021-11-26 15:56:29 -08:00
Rick Macklem
bdd57cbb1b nfsd: Add checks for layout errors in LayoutReturn
For a LayoutReturn when using the Flexible File Layout,
error reports may be provided in the request.
Sanity check the size of these error reports and
check that they exist before calling nfsrv_flexlayouterr().

Reported by:	rtm@lcs.mit.edu
Tested by:	rtm@lcs.mit.edu
PR:	260012
MFC after:	2 weeks
2021-11-26 15:42:32 -08:00
Rick Macklem
22f7bcb523 nfscl: Sanity check irdcnt in nfsrpc_createsession
Reported by:	rtm@lcs.mit.edu
Tested by:	rtm@lcs.mit.edu
PR:	259996
MFC after:	2 weeks
2021-11-26 15:28:40 -08:00
Mateusz Guzik
1879021942 tmpfs: add vop_stdadd_writecount_nomsync to fifo vnode ops
Reported by:	yasu
Fixes: 3ffcfa599e ("vfs: add vop_stdadd_writecount_nomsync")
2021-11-26 19:32:35 +00:00
Warner Losh
f89842a71a src.conf: regenerate 2021-11-26 12:22:56 -07:00
Warner Losh
4318dc9d13 MK_NAND: this option was retired some time ago
Remove the now-bogus WITH_NAND and WITHOUT_NAND flags.

Sponsored by:		Netflix
2021-11-26 12:22:56 -07:00
Andrew Turner
ae92ace05f Per-thread stack canary on arm64
With the update to llvm 13 we are able to tell the compiler it can find
the SSP canary relative to the register that holds the userspace stack
pointer. As this is unused in most of the kernel it can be used here
to point to a per-thread SSP canary.

As the kernel could be built with an old toolchain, e.g. when upgrading
from 13, add a warning that the options was enabled but the compiler
doesn't support it to both the build and kernel boot.

Discussed with:	emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D33079
2021-11-26 14:44:00 +00:00
Mark Johnston
7b3642da21 Hoist cddl prebuild lib dependency definitions out of a MK_ZFS block
The compilation of several libraries under cddl/lib is not conditional
on MK_ZFS = "yes", so their dependency on libspl is not conditional
either.  Unbreak buildworld when WITHOUT_ZFS is set.

Reported by:	bz
Fixes:		9e9c651cac ("cddl: fix missing ZFS library dependencies")
MFC after:	1 week
2021-11-26 09:39:09 -05:00
Andriy Gapon
ff1e858180 twsi: support more message combinations in transfers
Most prominently, add support for a transfer where a write with no-stop
flag is followed by a write with no-start flag.  Logically, it's a
single larger write, but consumers may want to split it like that
because one part can be a register ID and the other part can be data to
be written to (or starting at) that register.

Such a transfer can be created by i2c tool and iic(4) driver, e.g., for
an EEPROM write at specific offset:
    i2c -m tr -a 0x50 -d w -w 16 -o 0 -c 8 -v < /dev/random

This should be fixed by new code that handles the end of data transfer
for both reads and writes.  It handles two existing conditions and one
new.  Namely:
- the last message has been completed -- end of transfer;
- a message has been completed and the next one requires the start
  condition;
- a message has been completed and the next one should be sent without
  the start condition.

In the last case we simply switch to the next message and start sending
its data.  Reads without the start condition are not supported yet,
though.  That's because we NACK the last byte of the previous message,
so the device stops sending data.  To fix this we will need to add a
look-ahead at the next message when handling the penultimate byte of the
current one.

This change also fixed a bug where msg_idx was not incremented after a
read message.  Apparently, typically a read message is a last message in
a transfer, so the bug did not cause much trouble.

PR:		258994
MFC after:	3 weeks
2021-11-26 16:20:27 +02:00
Andriy Gapon
00c07d9559 twsi: make data receiving code safer
Assert that we are not receiving data beyond the requested length.
Assert that we have not NACK-ed incoming data prematurely.
Abort the current transfer if the incoming data is NACK-ed or not
NACK-ed unexpectedly.

Add debug logging of received data to complement logging of sent data.

MFC after:	3 weeks
2021-11-26 16:18:51 +02:00
Andriy Gapon
aeacf172fd twsi: remove redundant write of control register
The write at the end of twsi_intr() already handles all cases, no need
to have another write for TWSI_STATUS_START / TWSI_STATUS_RPTD_START.

MFC after:	3 weeks
2021-11-26 16:18:30 +02:00
Andriy Gapon
04622a7f21 twsi: move handling of TWSI_CONTROL_ACK into the state machine
Previously the code set TWSI_CONTROL_ACK in twsi_transfer() based on
whether the first message had a length of one.  That was done regardless
of whether the message was a read or write and what kind of messages
followed it.
Now the bit is set or cleared while handling TWSI_STATUS_ADDR_R_ACK
state transition based on the current (read) message.

The old code did not correctly work in a scenario where a single byte
was read from an EEPROM device with two byte addressing.
For example:
    i2c -m tr -a 0x50 -d r -w 16 -o 0 -c 1 -v
The reason is that the first message (a write) has two bytes, so
TWSI_CONTROL_ACK was set and never cleared.
Since the controller did not send NACK the EEPROM sent more data resulting
in a buffer overrun.

While working on TWSI_STATUS_ADDR_R_ACK I also added support for
the zero-length read access and then I did the same for zero-length write
access.
While rare, those types of I2C transactions are completely valid and are
used by some devices.

PR:		258994
MFC after:	3 weeks
2021-11-26 16:17:24 +02:00
Andriy Gapon
a4fe892208 twsi: unify error handling, explicitly handle more conditions
twsi_error() is a new function that stops the current transfer and sets
up softc when an error condition is detected.
TWSI_STATUS_DATA_WR_NACK, TWSI_STATUS_BUS_ERROR and
TWSI_STATUS_ARBITRATION_LOST are now handled explicitly rather than
via the catch-all unknown status.

Also, twsi_intr() now calls wakeup() in a single place when the
transfer is finished.

MFC after:	2 weeks
2021-11-26 16:16:21 +02:00