Commit Graph

140275 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Andriy Gapon
578707ed4e twsi: improve a handful of debug messages
- use 0x prefix for hex values
- print indexes and counts as decimals
- break too long lines

MFC after:	2 weeks
2021-11-26 16:16:01 +02:00
Andriy Gapon
cb167e1ae9 twsi: do not attempt transfer if bus is not idle
MFC after:	2 weeks
2021-11-26 16:15:43 +02:00
Andriy Gapon
bc02583c4d twsi: remove redundant enabling of the controller
MFC after:	2 weeks
2021-11-26 16:15:21 +02:00
Andriy Gapon
69cfa60ddd twsi: protect interaction between twsi_transfer and twsi_intr
All accesses to softc are now done under a mutex to prevent data races
between the open context and the interrupt handler.
Additionally, the wait time in twsi_transfer is bounded now.
Previously we could get stuck there forever if an interrupt got lost.

MFC after:	2 weeks
2021-11-26 16:14:28 +02:00
Andriy Gapon
a2793d6182 twsi: compile in support for debug messages, disabled by default
Debug messages can now be enabled per driver instance via a new sysctl.
Also, debug messages in TWSI_READ and TWSI_WRITE require debug level
greater than 1 as they are mostly redundant because callers of those
functions already log most interesting results.

NB: the twsi drivers call their device iichb, so the new sysctl will
appear under dev.iichb.N.

MFC after:	1 week
2021-11-26 16:04:23 +02:00
Andriy Gapon
f00bc54f62 twsi: remove write-only softc field
MFC after:	1 week
2021-11-26 16:04:14 +02:00
Andriy Gapon
de86f339cd twsi: add more of status definitions
For completeness and for future use.

MFC after:	1 week
2021-11-26 16:03:38 +02:00
Andriy Gapon
26559dd177 twsi: sort headers, remove unneeded
MFC after:	1 week
2021-11-26 16:03:38 +02:00
Michael Tuexen
3c1ba6f394 sctp: improve consistency, no functional change intended 2021-11-26 12:53:43 +01:00
Mateusz Guzik
054f5815c5 vfs: plug a set-but-not-used var in kern_alternate_path
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-26 12:22:09 +00:00
Mateusz Guzik
3ffcfa599e vfs: add vop_stdadd_writecount_nomsync
This avoids needing to inspect the mount point every time.

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D33125
2021-11-26 12:06:08 +00:00
Michael Tuexen
0906362646 sctp: add some asserts, no functional changes intended
This might help in narrowing down
https://syzkaller.appspot.com/bug?id=fbd79abaec55f5aede63937182f4247006ea883b
2021-11-26 12:19:33 +01:00
Alexander Motin
913c07a049 hwpmc: Add IDs for Intel Comet/Ice/Tiger/Rocketlake CPUs.
MFC after:	1 month
2021-11-25 19:26:04 -05:00
Mateusz Guzik
7e1d3eefd4 vfs: remove the unused thread argument from NDINIT*
See b4a58fbf64 ("vfs: remove cn_thread")

Bump __FreeBSD_version to 1400043.
2021-11-25 22:50:42 +00:00
Mateusz Guzik
c40fee6f7d vfs: drop the always curthread argument from kern_alternate_path 2021-11-25 22:50:42 +00:00
Mateusz Guzik
af4051d250 linux: remove the always curthread argument from lconvpath 2021-11-25 22:50:42 +00:00
Mark Johnston
b11e6fd75b link_elf_obj: Process global ifunc relocs after other global relocs
This is needed to ensure that resolvers that reference global symbols
return correct results.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33120
2021-11-25 16:53:27 -05:00
Andriy Gapon
8c12ee5021 rk_spi: declare support for rk3328
Tested on Rock64 using the onboard SPI flash.

MFC after:	1 week
2021-11-25 23:28:58 +02:00
Leandro Lupori
e141b62d20 powerpc64le: fix boot when using QEMU PowerNV
When using QEMU PowerNV with latest op-build release (v2.7), its
kexec transfers control to FreeBSD kernel in BE mode, causing an
instant exception on LE kernels. Make kboot able to detect and
swap endian to fix this.

Reviewed by:		imp
Sponsored by:		Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D33104
2021-11-25 16:41:46 -03:00
Leandro Lupori
b9f3b63ab2 vt: export RGB offsets with FBIO_GETRGBOFFS
Add a new ioctl to vt to make it possible to export RGB offsets
set by vt drivers. This is needed to fix colors on X and Mesa
on some machines, especially on modern PowerPC64 BE ones.

With the appropriate changes in SCFB, to use this ioctl to find
out the correct RGB offsets, this fixes wrong colors on Talos II
and Blackbird, when used with their built-in video cards.

Reviewed by:		alfredo
Sponsored by:		Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:	https://reviews.freebsd.org/D29000
2021-11-25 16:39:25 -03:00
Konstantin Belousov
b19740f4ce swap_pager: lock vnode in swapdev_strategy()
VOP_STRATEGY() requires locked vnode.  Note that we lock the swap vnode
while pages are busy, but this would only cause real LoR if pages belong
to the swap vnode, which must not be the case for correct use.

Reported and tested by:	peterj
Reviewed by:	markj
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33119
2021-11-25 21:34:50 +02:00
Konstantin Belousov
6ddf41faa6 swapon: extend the region where the swap vnode is locked
to cover VOP_GETATTR() call in sys_swapon().  Move locking from inside
swapongeom() and swaponvp() into sys_swapon().

Reported by and tested by:	peterj
Reviewed by:	markj
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33119
2021-11-25 21:34:44 +02:00
Konstantin Belousov
a6d04f34a4 swap pager: lock vnode around VOP_CLOSE()
Reported and tested by:	peterj
Reviewed by:	markj
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D33119
2021-11-25 21:34:39 +02:00
Mark Johnston
437ea82ce7 agp: Handle multiple devices more gracefully
Currently agp(4) effectively assumes that only one driver instance
exists, as the generic attach routine attempts to create /dev/agpgart
and triggers a panic if it already exists.  Instead, handle this
situation by creating /dev/agpgart<unit> and making /dev/agpgart an
alias of /dev/agpgart0 for compatibility.

PR:		187015
Reviewed by:	imp, kib
Tested by:	Yoshihiro Ota <ota@j.email.ne.jp> (earlier version)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33068
2021-11-25 11:36:33 -05:00
Hans Petter Selasky
0229172a65 usb/u3g: Add support for Quectel EM05.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/565
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-11-25 15:29:47 +01:00
Mateusz Guzik
2ef1cfd2ef mmc: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-25 12:10:27 +00:00
Mateusz Guzik
b74fdaaf1c geom_multipath: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-25 11:31:50 +00:00
Mateusz Guzik
b6f387fdb7 fdc: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-25 11:25:11 +00:00
Kornel Duleba
68cbe189fd pci: Don't try to read cfg registers of non-existing devices
Instead of returning 0xffs some controllers, such as Layerscape generate
an external exception when someone attempts to read any register
of config space of a non-existing device other than PCIR_VENDOR.
This causes a kernel panic.
Fix it by bailing during device enumeration if a device vendor register
returns invalid value. (0xffff)
Use this opportunity to replace some hardcoded values with a macro.

I believe that this change won't have any unintended side-effects since
it is safe to assume that vendor == 0xffff -> hdr_type == 0xffff.

Sponsored by:		Alstom
Obtained from:		Semihalf
Reviewed by:		jhb
MFC after:		2 weeks
Differential revision:	https://reviews.freebsd.org/D33059
2021-11-25 09:53:40 +01:00
Warner Losh
8722e05ae1 twa: Remove
Belatedly remove twa(4). It was supposed to go before 13.0, but was
overlooked.

Sponsored by:		Netflix
Relnotes:		yes
Reviewed by:		scottl
Differential Revision:	https://reviews.freebsd.org/D33114
2021-11-25 00:45:13 -07:00
Warner Losh
0d5935af8f esp: Remove
Belatedly remove esp(4). It was tagged as gone in 13, but was overlooked
until now.

Sponsored by:		Netflix
Reviewed by:		scottl
Differential Revision:	https://reviews.freebsd.org/D33115
2021-11-25 00:45:12 -07:00
Warner Losh
60de2867c9 amr: remove
Belatedly remove amr(4). It was slated to depart before 13.0 but was
overlooked until now.

Sponsored by:		Netflix
Relnotes:		yes
Reviewed by:		scottl
Differential Revision:	https://reviews.freebsd.org/D33113
2021-11-25 00:45:12 -07:00
Warner Losh
399188a2c6 iir: Remove
Belatedly remove iir(4). It was slated to go before 13, but was
overlooked.

Sponsored by:		Netflix
Relnotes:		yes
Reviewed by:		scottl
Differential Revision:	https://reviews.freebsd.org/D33112
2021-11-25 00:45:12 -07:00
Warner Losh
a9620045a5 mly: Remove.
We'd said this was going away in 13, but was overlooked. Belatedly
remove.

Sponsored by:		Netflix
Relnotes:		yes
Reviewed by:		scottl
Differential Revision:	https://reviews.freebsd.org/D33111
2021-11-25 00:45:12 -07:00
Alexander Motin
ba83762a62 APEI: Fix Generic Error Data Entry revision 3.0 handling.
Since revision 3.0 this structure grown another field, breaking access
to the following data structures.  This change fixes the PCIe errors
decoding on newer systems.

MFC after:	2 weeks
2021-11-24 23:18:44 -05:00
Scott Long
79ed7cb3df Fix "set but not used" warnings in the ciss driver. 2021-11-25 03:33:39 +00:00
Scott Long
61f17c5fd6 Fix "set but not used" warnings in the mpr driver. This fixes a minor
bug in error handling.
2021-11-25 03:28:29 +00:00
Scott Long
bcce9c5bed Fix "set but not used" warnings in the mps driver. 2021-11-25 03:23:02 +00:00
Scott Long
c154feacc4 Fix "set but not used" warnings in CAM. 2021-11-25 03:17:54 +00:00
Scott Long
6ef1ad0dcf Fix "set but not used" warnings in mfi. The one in mfi.c:mfi_data_cb()
was a hidden but likely harmless mistake.  The rest were just old code
that was OBE.
2021-11-25 02:41:18 +00:00
Alexander Motin
e8e8d2290e ig4: Add PCI IDs for Intel Alder Lake I2C controller.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks
2021-11-24 20:15:02 -05:00
Mateusz Guzik
40dd1c9c06 ext2: plug set-but-not-used vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 23:02:26 +00:00
Bjoern A. Zeeb
943df073a3 LinuxKPI: USB return possible error from suspend/resume
USB suspend/resume cannot fail so we never returned the error which
resulted in a -Wunused-but-set-variable warning.
Initialize the return variable and return a possible error possibly
triggering a printf upstream to at least have a trace of the problem.
This also fixes the warning.

Suggested by:	hselasky
Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D33107
2021-11-24 21:32:38 +00:00
Bjoern A. Zeeb
7043359ce3 LinuxKPI: fix -Wunused-but-set-variable warnings
Handle write-only variables by removing the unused return value from void
functions or removing the unused variables entirely.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D33107
2021-11-24 21:32:38 +00:00
Mateusz Guzik
873606999f unionfs: plug a set-but-not-unused var
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 21:31:35 +00:00
Mateusz Guzik
2cedfc3f7e if_epair: ifdef vars only used with ALTQ
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 21:28:54 +00:00
Mateusz Guzik
35b12b8711 fdescfs: plug a set-but-not-unused var
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 21:25:24 +00:00
Mateusz Guzik
cb2bfd3ecb geom_journal: plug set-but-not-unused vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 21:21:59 +00:00
Mateusz Guzik
ae3d955404 linprocfs: plug set-but-not-unused vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 21:18:36 +00:00
Mateusz Guzik
74a0e24f07 linux: plug set-but-not-unused vars
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 21:16:03 +00:00
Eric Joyner
409b36ad91
ixl(4): Remove iavf(4) source files
Since iavf(4) no longer shares code with ixl(4) as of commit
f2fbd56a8d07665bc0a5e8b7e40026b50a591e2a and now has its own directory,
remove these now-unused iavf(4)-only files.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Sponsored by: Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D28638
2021-11-24 11:54:08 -08:00
Eric Joyner
ca853dee3b
iavf(4): Split source and update to 3.0.26-k
The iavf(4) driver now uses a different source base from ixl(4), since
it will be the standard VF driver for new Intel Ethernet products going
forward, including ice(4). It continues to use the iflib framework
for network drivers.

Since it now uses a different source code base, this commit adds a new
sys/dev/iavf entry, but it re-uses the existing module name so no
configuration changes are necessary.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:		kbowling@
Tested by:		lukasz.szczepaniak@intel.com
Sponsored by:		Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D28636
2021-11-24 11:54:08 -08:00
Mark Johnston
d47d3a94bb vm_fault: Factor out per-object operations into vm_fault_object()
No functional change intended.

Obtained from:	jeff (object_concurrency patches)
Reviewed by:	kib
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D33018
2021-11-24 14:02:56 -05:00
Mark Johnston
f1b642c255 vm_fault: Introduce a fault_status enum for internal return types
Rather than overloading the meanings of the Mach statuses, introduce a
new set for use internally in the fault code.  This makes the control
flow easier to follow and provides some extra error checking when a
fault status variable is used in a switch statement.

vm_fault_lookup() and vm_fault_relookup() continue to use Mach statuses
for now, as there isn't much benefit to converting them and they
effectively pass through a status from vm_map_lookup().

Obtained from:	jeff (object_concurrency patches)
Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33017
2021-11-24 14:02:55 -05:00
Mark Johnston
45c09a74d6 vm_fault: Move nera into faultstate
This makes it easier to factor out pieces of vm_fault().  No functional
change intended.

Obtained from:	jeff (object_concurrency patches)
Reviewed by:	kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D33016
2021-11-24 14:02:55 -05:00
Bartlomiej Grzesik
d9ed1dcc5c acpi: Fix error code returned in acpi_bus_get_prop
ACPI implementation of device_get_property would return "-1" when
property was found, but it's type wasn't supported.
This causes device_has_property to return false in that scenario, which
arguably could be considered as incorrect.

Fix that by returning "0" in that case.

Reviewed by: bz, mw
Tested by: mw
MFC after: 2 weeks
Obtained from: Semihalf
Differential Revision: https://reviews.freebsd.org/D33103
2021-11-24 19:42:43 +01:00
Mark Johnston
60c95f3163 safexcel: Fix -Wunused-but-set-variable warnings
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2021-11-24 13:31:16 -05:00
Mark Johnston
44775b163b netinet: Remove unneeded mb_unmapped_to_ext() calls
in_cksum_skip() now handles unmapped mbufs on platforms where they're
permitted.

Reviewed by:	glebius, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33097
2021-11-24 13:31:16 -05:00
Mark Johnston
0d9c3423f5 netinet: Implement in_cksum_skip() using m_apply()
This allows it to work with unmapped mbufs.  In particular,
in_cksum_skip() calls no longer need to be preceded by calls to
mb_unmapped_to_ext() to avoid a page fault.

PR:		259645
Reviewed by:	gallatin, glebius, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33096
2021-11-24 13:31:16 -05:00
Mark Johnston
ecbbe83144 netinet: Deduplicate most in_cksum() implementations
in_cksum() and related routines are implemented separately for each
platform, but only i386 and arm have optimized versions.  Other
platforms' copies of in_cksum.c are identical except for style
differences and support for big-endian CPUs.

Deduplicate the implementations for the rest of the platforms.  This
will make it easier to implement in_cksum() for unmapped mbufs.  On arm
and i386, define HAVE_MD_IN_CKSUM to mean that the MI implementation is
not to be compiled.

No functional change intended.

Reviewed by:	kp, glebius
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33095
2021-11-24 13:31:16 -05:00
Mark Johnston
5195bcc212 netinet: Remove in_cksum.c
It does not get compiled into the kernel.  No functional change
inteneded.

Reviewed by:	kp, glebius, cy
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33094
2021-11-24 13:31:16 -05:00
Mark Johnston
09100f936b netinet: Remove in_cksum_update()
It was never implemented on powerpc or riscv and appears to have been
unused since it was added in 1998.  No functional change intended.

Reviewed by:	kp, glebius, cy
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33093
2021-11-24 13:31:15 -05:00
Warner Losh
00dbcdbe0a sys/uuid.h: Include sys/types.h
Change the include of sys/cdefs.h to sys/types.h to pick up all the
types. sys/types.h includes cdefs.h.

Sponsored by:		Netflix
2021-11-24 11:26:45 -07:00
Warner Losh
9be3985f65 sys/backlight.h: include sys/types.h
Sponsored by:		Netflix
2021-11-24 11:26:45 -07:00
Warner Losh
d69b6fa5b4 sys/ata.h: Include sys/types.h
This file needs types defined by sys/types.h, and there's no reason not
to include sys/types.h here.

Sponsored by:		Netflix
2021-11-24 11:26:45 -07:00
Warner Losh
fde1edaae7 sys/disk/*.h: Include sys/types.h
All these files use types defined by sys/types.h. Add an include of it
at the top to make them standalone.

Sponsored by:		Netflix
2021-11-24 11:26:45 -07:00
Warner Losh
242d6201a6 sys/alq.h: Kernel only file, mark as such
The alq interfaces are 100% in-kernel, so make this whole file #ifdef
_KERNEL. There's no users of this in the tree outside of the kernel, nor
does it define anything that could be useful at peeking into the state
of alq.

Sponsored by:		Netflix
2021-11-24 11:26:45 -07:00
Warner Losh
b194db9355 sys/acct.h: Add sys/types.h include
There's no harm in including sys/types.h here and acct.h needs it. This
file isn't defined by any standard, so what we do here wrt namespaces
likely doesn't matter. If it does, it will be easy enough to add the
necessary __BSD_VISIBLE guards in the future.

Sponsored by:		Netflix
2021-11-24 11:26:44 -07:00
Bjoern A. Zeeb
1c55b0ce1c std.nodebug: turn off net80211 debugging as well
Add IEEE80211_DEBUG to turn off some net80211 debbugging for
no-debug builds.

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2021-11-24 18:06:20 +00:00
Alexander Motin
f29f6b2e1f ichsmb: Add PCI IDs for Intel Alder Lake SMBus controller
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks
2021-11-24 13:07:58 -05:00
Bjoern A. Zeeb
05ea7a3e5e net80211: fix -Wunused-but-set-variable warnings
Put the offending variables under the appropriate #ifdefs
(mostly IEEE80211_DEBUG, in one case IEEE80211_SUPPORT_SUPERG, and
in two cases under __notyet__ to revisit why these had been left
there but not used).

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
2021-11-24 17:39:19 +00:00
Mateusz Guzik
e052f72691 alc: plug a set-but-not-unused var in alc_init_locked
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 16:26:57 +00:00
Mateusz Guzik
ab9d2f02a0 amd_ecc_inject: return an error instead of ignoring it in tsc_modevent
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 16:25:50 +00:00
Mateusz Guzik
cfe94aa8c1 agp: plug a set-but-not-unused var in agp_intel_gtt_map_memory
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 16:25:50 +00:00
Mateusz Guzik
3279341dc5 aesni: plug a set-but-not-unused var in aesni_newsession
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 16:25:50 +00:00
Mateusz Guzik
1caaf55585 32-bit compat: plug a set-but-not-unused var in freebsd32_copy_msg_out
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2021-11-24 16:25:50 +00:00