Commit Graph

141805 Commits

Author SHA1 Message Date
Hans Petter Selasky
fc99316ef9 ibcore: Fix multiple includes of same header file.
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-03 12:51:20 +01:00
Hans Petter Selasky
fcca9fd98c usbhid(4): Be more restrictive about what requests are allowed from user-space.
MFC after:	1 month
Sponsored by:	NVIDIA Networking
2022-03-03 10:24:43 +01:00
Hans Petter Selasky
8ed5bb59e9 usb(4): Factor out the usb_check_request() function.
No functional change.

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-03 10:24:24 +01:00
Ed Maste
f266082f11 vt_vga: fix colour in pixel blocks with more than 4 colours
VGA hardware provides many different graphics and data access modes,
each with different capabilities and limitations.

VGA vt(4) graphics mode operates on blocks of pixels at a time.  When a
given pixel block contains only two colours the vt_vga driver uses write
mode 3.  When the block contains more than two colours it uses write
mode 0.  This is done because two-colour write mode 3 is much more
efficient.

In practice write mode 3 is used most of the time, as there is often a
single foreground colour and single background colour across the entire
console.  One common exception requiring the use of mode 0 is when the
mouse cursor is drawn over a background other than black, as we need
black and white for the cursor in addition to the background colour.

VGA's default 16-colour palette provides the same set of colours as the
system console, but in a different order.  Previously we configured a
non-default VGA palette that had the same colours at the same indexes.
However, this caused anything drawn before the kernel started (drawn by
the loader, for instance) to change colours once the kernel configured
the new, non-default palette.

In 5e251aec86 we switched to leaving the default VGA palette in place,
translating console colour indexes to VGA colour indexes as necessary.
This translation was missed for the write mode 0 case for pixel blocks
with more than two colours.

PR:		261751
Reviewed by:	adrian
MFC after:	1 week
Fixes:		5e251aec86 ("vt(4): Use default VGA palette")
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34412
2022-03-02 19:07:20 -05:00
Vladimir Kondratyev
42e2a173c7 hms(4): Change probe priority to BUS_PROBE_GENERIC
to give ietp(4) and bcm5974(4) drivers precedence over hms(4).

MFC after:	2 month
2022-03-03 02:35:24 +03:00
Vladimir Kondratyev
d5add41d4d ietp(4): Driver for Elantech I2C touchpad
MFC after:	2 month
Tested by:	Matt Daw <matt.daw_AT_gmail_DOT_com>
2022-03-03 02:35:24 +03:00
Vladimir Kondratyev
34e051c45c iichid(4): Add support for ASUS C300 chromebook.
Some chromebooks e.g. ASUS C300 have no valid _CID and _DSM ACPI
objects required for device identification and HID descriptor address
detection. Add quirk to allow required data to be hardcoded in to
driver.

MFC after:	2 month
2022-03-03 02:35:23 +03:00
Vladimir Kondratyev
6b1da3d223 iichid(4): Implement I2CRDWR command in hid_ioctl method
This command is intended to be compatible with I2CRDWR ioctl.
It is required to perform arbitrary I2C transfers by device
drivers which can switch between HID and native non-HID modes.

MFC after:	2 month
2022-03-03 02:35:23 +03:00
Vladimir Kondratyev
5aa839c9e2 bcm5974: wsp(4) driver version with HID attachment.
MFC after:	2 month
Tested by:	Greg V (Type 4 touchpads)
2022-03-03 02:35:23 +03:00
Vladimir Kondratyev
82e38b012c usbhid(4): Implement USB_REQUEST command in hid_ioctl method
This command is intended to be compatible with USB_REQUEST ioctl.
It is required to perform arbitrary control endpoint requests by device
drivers which can switch between HID and native non-HID modes.

MFC after:	2 month
2022-03-03 02:35:23 +03:00
Vladimir Kondratyev
5f47c5a3a3 hid: Add hid_ioctl method to HID interface
hid_ioctl method executes arbitrary transport backend command.
Format of the command is defined by hardware transport driver.

It is intended to assist HID device drivers to execute non-HID commands
on hybrid devices like Elan and Apple touchpads which can be switched
between HID and proprietary modes.

MFC after:	2 month
2022-03-03 02:35:23 +03:00
Vladimir Kondratyev
166f2cb40d ig4(4): Add PNP info for ACPI attachment
MFC after:	2 month
2022-03-03 02:35:23 +03:00
Vladimir Kondratyev
1ef67193ba hid: Add missed dependency on usbdevs.h for static builds
MFC after:	2 month
2022-03-03 02:35:23 +03:00
John Baldwin
2753997438 cxgbe: Move page pods KTR traces under VERBOSE_TRACES. 2022-03-02 15:32:21 -08:00
Navdeep Parhar
13a0d225be cxgbe(4): Enable the hardware TCP Offload Module (t4_tom) on aarch64.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2022-03-02 15:13:21 -08:00
Brett Gutstein
edafb5b859 hwpmc_arm64_md.c: Correct architecture name in assertions.
Obtained from:	CheriBSD
2022-03-02 14:57:40 -08:00
Navdeep Parhar
17f564a784 cxgbe(4): Dump some more debug registers in cim_dump_regs.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2022-03-02 11:11:08 -08:00
Kristof Provost
b590f17a11 pf: support masking mac addresses
When filtering Ethernet packets allow rules to specify a mac address
with a mask. This indicates which bits of the specified address are
significant. This allows users to do things like filter based on device
manufacturer.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-03-02 17:00:08 +01:00
Kristof Provost
c5131afee3 pf: add anchor support for ether rules
Support anchors in ether rules.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32482
2022-03-02 17:00:07 +01:00
Kristof Provost
fb330f3931 pf: support dummynet on L2 rules
Allow packets to be tagged with dummynet information. Note that we do
not apply dummynet shaping on the L2 traffic, but instead mark it for
dummynet processing in the L3 code. This is the same approach as we take
for ALTQ.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D32222
2022-03-02 17:00:06 +01:00
Kristof Provost
30087aa2e0 pf: Support clearing ether counters
Allow the evaluations/packets/bytes counters on Ethernet rules to be
cleared.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31748
2022-03-02 17:00:05 +01:00
Kristof Provost
6b7c268003 pf: Only hook the Ethernet pfil hook when we have rules
Avoid the overhead of the Ethernet pfil hooks if we don't have any
Ethernet rules.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31742
2022-03-02 17:00:04 +01:00
Kristof Provost
5c75dfdf60 pf: SDTs for ether rule matching
Add static DTrace probe points to allow debugging of ether rule
matching.

Reviewed by:	mjg
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31741
2022-03-02 17:00:04 +01:00
Kristof Provost
20c4899a8e pf: Do not hold PF_RULES_RLOCK while processing Ethernet rules
Avoid the overhead of acquiring a (read) RULES lock when processing the
Ethernet rules.
We can get away with that because when rules are modified they're staged
in V_pf_keth_inactive. We take care to ensure the swap to V_pf_keth is
atomic, so that pf_test_eth_rule() always sees either the old rules, or
the new ruleset.

We need to take care not to delete the old ruleset until we're sure no
pf_test_eth_rule() is still running with those. We accomplish that by
using NET_EPOCH_CALL() to actually free the old rules.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31739
2022-03-02 17:00:03 +01:00
Kristof Provost
e732e742b3 pf: Initial Ethernet level filtering code
This is the kernel side of stateless Ethernel level filtering for pf.

The primary use case for this is to enable captive portal functionality
to allow/deny access by MAC address, rather than per IP address.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D31737
2022-03-02 17:00:03 +01:00
Ed Maste
731a929ac9 vt_vga: Correct "plane" spelling
I suspect the variable names and comments were accidentally French.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-03-02 10:56:40 -05:00
Warner Losh
369216b039 ath: fix older clang build.
Define NO_WUNUSED_BUT_SET_VARIABLE for newer clang, and use it in ATH_C
to account for different clang versions. Use it in Makefiles as well.

Sponsored by:		Netflix
Reviewed by:		kevans, jhb
Differential Revision:	https://reviews.freebsd.org/D34408
2022-03-01 22:55:34 -07:00
Warner Losh
7dda139e6d ath: missed a chance to use ${ATH_C}
Fixes:		8881d206f4 (reviewed by scottl, markj in D34401)
Noticed by:	markj
Sponsored by:	Netflix
2022-03-01 14:00:14 -07:00
Mark Johnston
879b0604a8 proc: Remove assertion that P_WEXIT is not set in proc_rwmem()
exit1() sets P_WEXIT before waiting for holding threads to finish,
rather than after, so this assertion is racy.

Fixes:	12fb39ec3e ("proc: Relax proc_rwmem()'s assertion on the process hold count")
Reported by:	Jenkins
2022-03-01 15:09:45 -05:00
Mark Johnston
3a56cfedbc fasttrap: Avoid creating WX mappings
fasttrap instruments certain instructions by overwriting them and
copying the original instruction to some per-thread scratch space which
is executed after the probe fires.  This trampoline jumps back to the
tracepoint after executing the original instruction.

The created mapping has both write and execute permissions, and so this
mechanism doesn't work when allow_wx is disabled.  Work around the
restriction by using proc_rwmem() to write to the trampoline.

Reviewed by:	vangyzen
Tested by:	Amit <akamit91@hotmail.com>
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34304
2022-03-01 12:40:35 -05:00
Mark Johnston
83958173eb fasttrap: Assert that fasttrap_fork() successfully unmaps scratch space
No functional change intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-03-01 12:40:35 -05:00
Mark Johnston
12fb39ec3e proc: Relax proc_rwmem()'s assertion on the process hold count
This reference ensures that the process and its associated vmspace will
not be destroyed while proc_rwmem() is executing.  If, however, the
calling thread belongs to the target process, then it is unnecessary to
hold the process.  In particular, fasttrap - a module which enables
userspace dtrace - may frequently call proc_rwmem(), and we'd prefer to
avoid the overhead of locking and bumping the hold count when possible.

Thus, make the assertion conditional on "p != curproc".  Also assert
that the process is not already exiting.  No functional change intended.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-03-01 12:40:35 -05:00
Warner Losh
8881d206f4 ath: Suppress set but unused warnings
The ath driver has a lot of these warnings. It's an older driver, so
just supress these warnings until they can be fixed. They are a mix of
simple dead stores, debubgging output and stuff that would require
careful study to know if its safe to remove the access or not (there are
likely very few of the latter, but if there are any they are latent bugs
that compiler could optimize away). Since I have no ath hardware to test
on anymore, take the conservative approach.

Sponsored by:		Netflix
2022-03-01 08:06:42 -07:00
Warner Losh
094f1dc40e g_part: Allow attributes to be querried
Create g_part_getattr to allow gpart geoms to have their attributes queried.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D32782
2022-03-01 08:06:42 -07:00
Warner Losh
9c750429af Add USB UEFI locator support
Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32788
2022-03-01 08:06:42 -07:00
Warner Losh
dbee7944ba acpi: Allow matching based on locators
Allow wiring of unit numbers based any of the standard locators that
match.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32787
2022-03-01 08:06:42 -07:00
Warner Losh
6837d9d7e8 acpi hints: Abstract out acpi_hint_device_matches_resources
Abstract out acpi_hint_device_matches_resources from
acpi_hint_device_unit to simplify that code. Continue matching like
we've always matched: no functional change.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32786
2022-03-01 08:06:42 -07:00
Warner Losh
3278bf9268 acpi_hint_device_unit: matches is a bool, make it one
"matches" is used as a bool and doesn't need to count anything. Convert
it to a bool.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32785
2022-03-01 08:06:42 -07:00
Warner Losh
25670e4612 pci: Add arbitrary locator support to pci.
If the pciX:Y:Z and pciW:X:Y:Z 'at' locations don't work, allow try the
LOCATOR:PATH syntax. Use dev_wired_cache to generically look them up.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32784
2022-03-01 08:06:41 -07:00
Warner Losh
b36bd3a906 bus: Create dev_wired_cache
A simple cache to cache differnet locators to the same device.

Sponsored by:		Netflix
Changes Suggested by:	jhb
Differential Revision:	https://reviews.freebsd.org/D32783
2022-03-01 08:06:41 -07:00
Warner Losh
b029685a3a pci: switch logic a little
If we find a match, then assign it. Flip the logic in the if and assign
the unit rather than continuing if it doesn't match. Will make it easier
to expand to other matching schemes.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32779
2022-03-01 08:06:41 -07:00
Warner Losh
d0a20e401e Add UEFI locator for bus_get_device_path, pci acpi
Add a UEFI locator type. It prints the UEFI device names for a FreeBSD
device_t name. It works with PCI and ACPI device nodes. USB forthcoming.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32749
2022-03-01 08:06:41 -07:00
Warner Losh
cae7d9ec83 bus: Add ACPI locator support
Add support for printing ACPI paths. This is a bit of a degenerate case
for this interface since it's always just the device handle if the
device has one. But it is illustrtive of how to do this for a few nodes
in the tree.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32748
2022-03-01 08:06:41 -07:00
Warner Losh
38e942a345 devctl: Add DEV_GET_PATH
DEV_GET_PATH will get the path to a device based on different locators.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32745
2022-03-01 08:06:41 -07:00
Warner Losh
e19db70769 bus: Introduce the bus interface get_device_path
This returns the full path of a the child device requested. Since
there's different ways to recon the entire path, include a 'locator'
method. The default 'FreeBSD' method uses a filesystem-like path name
with each device to the root node separated by /. Other locators will be
UEFI, ACPI and fdt, though others are possible in the future. Make the
locator a string to allow maximum flexibility.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32744
2022-03-01 08:06:40 -07:00
Warner Losh
78408171bd devctl2: Change to 644 protections
We make sure that we check for device privs (usually meaning root or
better) for everything. To allow other functions that don't require
this, default to 644 protection.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D32863
2022-03-01 08:06:40 -07:00
Mark Johnston
31218f3209 riscv: Add support for enabling SV48 mode
This increases the size of the user map from 256GB to 128TB.  The kernel
map is left unchanged for now.

For now SV48 mode is left disabled by default, but can be enabled with a
tunable.  Note that extant hardware does not implement SV48, but QEMU
does.

- In pmap_bootstrap(), allocate a L0 page and attempt to enable SV48
  mode.  If the write to SATP doesn't take, the kernel continues to run
  in SV39 mode.
- Define VM_MAX_USER_ADDRESS to refer to the SV48 limit.  In SV39 mode,
  the region [VM_MAX_USER_ADDRESS_SV39, VM_MAX_USER_ADDRESS_SV48] is not
  mappable.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34280
2022-03-01 09:39:44 -05:00
Mark Johnston
6ce716f7c3 riscv: Add support for dynamically allocating L1 page table pages
This is required in SV48 mode.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34279
2022-03-01 09:39:44 -05:00
Mark Johnston
1321117200 riscv: Handle four-level page tables in various pmap traversal routines
Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34278
2022-03-01 09:39:44 -05:00
Mark Johnston
ceed61483c riscv: Maintain the allpmaps list only in SV39 mode
When four-level page tables are used, there is no need to distribute
updates to the top-level page to all pmaps.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34277
2022-03-01 09:39:44 -05:00
Mark Johnston
5cf3a8216e riscv: Add pmap helper functions required by four-level page tables
No functional change intended.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34276
2022-03-01 09:39:44 -05:00
Mark Johnston
4337979236 riscv: Try to improve the comments for locore's page table setup
No functional change intended.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34275
2022-03-01 09:39:44 -05:00
Mark Johnston
ecaf115434 riscv: Conditionally modify the ELF64 sysentvec for SV48
A sysinit determines whether the pmap has enabled SV48 mode and modifies
the corresponding fields which describe the user memory map.

Reviewed by:	kib, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34274
2022-03-01 09:39:43 -05:00
Mark Johnston
35d0f443cf riscv: Define a SV48 memory map
No functional change intended.

Reviewed by:	kib, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34273
2022-03-01 09:39:43 -05:00
Mark Johnston
59f192c507 riscv: Add various pmap definitions needed to support SV48 mode
No functional change intended.

Reviewed by:	jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34272
2022-03-01 09:39:43 -05:00
Mark Johnston
2e956c30ca riscv: Use generic CSR macros for writing SATP
Instead of having the one-off load_satp(), just use csr_write().  No
functional change intended.

Reviewed by:	alc, jhb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34271
2022-03-01 09:39:43 -05:00
Mark Johnston
82f4e0d0f0 riscv: Rename struct pmap's pm_l1 field to pm_top
In SV48 mode, the top-level page will be an L0 page rather than an L1
page.  Rename the field accordingly.  No functional change intended.

Reviewed by:	alc, jhb
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34270
2022-03-01 09:39:43 -05:00
Mark Johnston
9f70c04da4 rip: Fix a -Wunused-but-set-variable warning
Fixes:		81728a538d ("Split rtinit() into multiple functions.")
Reviewed by:	imp, melifaro
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34395
2022-03-01 09:39:43 -05:00
Mark Johnston
84369dd523 x86: Probe the TSC frequency earlier
This lets us use the TSC to implement early DELAY, limiting the use of
the sometimes-unreliable 8254 PIT.

PR:		262155
Reviewed by:	emaste
Tested by:	emaste, mike tancsa <mike@sentex.net>, Stefan Hegnauer <stefan.hegnauer@gmx.ch>
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34367
2022-03-01 09:39:35 -05:00
Mark Johnston
c3d830cf7c i386: Call clock_init() after finishidentcpu()
In a subsequent commit clock_init() will attempt to determine the TSC
frequency, and this requires that CPU identification is finalized.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2022-03-01 09:38:45 -05:00
Mark Johnston
89ae8eb74e rmlock: Add required compiler barriers to _rm_runlock()
Also remove excessive whitespace in _rm_rlock().

Reviewed by:	jah, mjg
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34381
2022-03-01 09:38:45 -05:00
Kirk McKusick
3cf2f812f5 Add casts to printf statements to keep armv6, armv7, and powerpc
builds happy.
2022-02-28 19:28:02 -08:00
Kirk McKusick
c7996ddf80 Create a new GEOM utility, gunion(8).
The gunion(8) utility is used to track changes to a read-only disk on
a writable disk. Logically, a writable disk is placed over a read-only
disk. Write requests are intercepted and stored on the writable
disk. Read requests are first checked to see if they have been
written on the top (writable disk) and if found are returned. If
they have not been written on the top disk, then they are read from
the lower disk.

The gunion(8) utility can be especially useful if you have a large
disk with a corrupted filesystem that you are unsure of how to
repair. You can use gunion(8) to place another disk over the corrupted
disk and then attempt to repair the filesystem. If the repair fails,
you can revert all the changes in the upper disk and be back to the
unchanged state of the lower disk thus allowing you to try another
approach to repairing it. If the repair is successful you can commit
all the writes recorded on the top disk to the lower disk.

Another use of the gunion(8) utility is to try out upgrades to your
system. Place the upper disk over the disk holding your filesystem
that is to be upgraded and then run the upgrade on it. If it works,
commit it; if it fails, revert the upgrade.

Further details can be found in the gunion(8) manual page.

Reviewed by: Chuck Silvers, kib (earlier version)
tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D32697
2022-02-28 16:36:08 -08:00
Robert Wing
2062ce996d vmm: fix "set but not used" warnings 2022-02-28 15:09:32 -09:00
Robert Wing
39d87a0235 vmm: fix "set but not used" warnings 2022-02-28 14:55:37 -09:00
Robert Wing
73505a1076 vmm: fix "set but not used" warnings 2022-02-28 14:46:08 -09:00
Warner Losh
dbd330fc1c bwn: Remove useless variable
type is a write-only variable. Eliminate it.

Sponsored by:		Netflix
2022-02-28 10:14:34 -07:00
Warner Losh
44b4f0370f bnxt: Remove dead write to cp_ring_id
Since this is read from memory, reading it and then ignoring it is dead
code...

Sponsored by:		Netflix
2022-02-28 10:14:34 -07:00
Warner Losh
1c347de37f axgbe_setup_sysctl is a nop, remove it and the call to it.
Should we need something like this in the future, we can add it back.

Sponsored by:		Netflix
2022-02-28 10:14:33 -07:00
Mark Johnston
ceb246c7b2 cdce: Fix a -Wunused-but-set-variable warning
MFC after:	1 week
2022-02-28 11:08:55 -05:00
Mark Johnston
f4a5d1f6c4 axe: Fix a -Wunused-but-set-variable warning
MFC after:	1 week
2022-02-28 11:07:19 -05:00
Mark Johnston
4db93fb278 pci: Fix a -Wunused-but-set-variable warning
MFC after:	1 week
2022-02-28 10:54:42 -05:00
Mark Johnston
9218449b98 axge: Fix a -Wunused-but-set-variable warning
MFC after:	1 week
2022-02-28 10:54:32 -05:00
Mark Johnston
1db163b825 bhnd: Fix some -Wunused-but-set-variable warnings
MFC after:	1 week
2022-02-28 10:54:25 -05:00
Mark Johnston
1dc8ed06f3 iwm: Fix -Wunused-but-set-variable warnings
MFC after:	1 week
2022-02-28 10:54:15 -05:00
Xin LI
561524cfb0 Remove prototype of x86emu_init_default.
It's removed in 3219f535d9 (r198251) as part of code refactor.

MFC after:	2 weeks
2022-02-27 15:11:17 -08:00
Marco Devesas Campos
5f702d6d9a vchiq: Add compat string for rpi4
The RPi 4 has a newer vchiq compatible device, add it to the list.

Reviewed by: imp
2022-02-27 09:46:49 -07:00
Warner Losh
9891cb1e76 Eliminate curlen, it's set but never used
Sponsored by:		Netflix
2022-02-27 09:02:45 -07:00
Scott Long
6f3c0d2764 Default to always accepting the PHY that's present. Linux did
something similar a while back, and there are devices in the wild
that otherwise won't attach.  This patch is temporary until the
PHY code is further cleared up.

Obtained from: grehan
2022-02-26 18:29:08 -07:00
Scott Long
66b86c8a76 Fix "set but not used" in the mrsas driver. Remove dead code. 2022-02-26 12:21:11 -07:00
Scott Long
c61dc85428 Fix "set but not used" in the mvs driver. Remove dead code. 2022-02-26 12:18:42 -07:00
Scott Long
0fd7b4c74d Fix "set but not used" in the bfe driver. Remove dead code. 2022-02-26 12:14:22 -07:00
Scott Long
887ae1953f Fix "set but not used" in the siis driver. 2022-02-26 11:46:53 -07:00
Scott Long
4b22ce0730 The TWE driver should have been marked with gone_in for FreeBSD 13.x,
but was missed.  Mark it for gone_in 14.0.  The hardware hasn't been
produced or supported in over 20 years, and even back then it was
known to be electrically unreliable and prone to catastrophic failure.
2022-02-26 11:40:17 -07:00
Scott Long
b6ac753a88 Fix "set but not used" in twe. 2022-02-26 11:16:31 -07:00
Scott Long
fa911920b1 Fix "set but not used" for real in the ciss driver. 2022-02-26 11:07:05 -07:00
Scott Long
55339af296 Expand __diagused to include the KTR kernel diagnostic option. 2022-02-26 11:01:54 -07:00
Scott Long
dec703c7e0 Fix "set but not used" in the ips driver. Dead code. 2022-02-26 10:35:51 -07:00
Scott Long
f94066c8aa Fix "set but not used" in aic7xxx/aic79xx. The variables were dead
code.
2022-02-26 10:33:31 -07:00
Scott Long
e28289ca83 Fix "set but not used" in smartpqi. The PCI_MEM macros don't require a
physical/absolute address in FreeBSD, but it looks like the calling
code might be somewhat portable to other OS's that do require this.
Therefore, set the variables to __unused instead of removing the code
entirely.
2022-02-26 10:25:43 -07:00
Richard Scheffenegger
2ff07d9220 tcp: Restore correct ECT marking behavior on SACK retransmissions
While coalescing all ECN-related code into new common source files,
the flag to deal with SACK retransmissions was skipped. This leads
to non-compliant ECT-marking of SACK retransmissions, as well as
the premature sending of other TCP ECN flags (CWR).

Reviewed By: rrs, #transport
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34376
2022-02-25 20:05:32 +01:00
Mark Johnston
c84bb8cd77 rmlock: Micro-optimize read locking
Use get_pcpu() instead of an open-coded pcpu_find(td->td_oncpu).  This
eliminates some memory accesses and results in a shorter instruction
sequence.  Note that get_pcpu() didn't exist when rmlocks were added.

Reviewed by:	jah, mjg
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34377
2022-02-25 13:55:24 -05:00
Marvin Ma
1517b8d5a7 vfs_unregister: fix error handling
Due to misplaced braces, an error from vfs_uninit() in the VFCF_SBDRY
case was ignored.

Reported by:	Anton Rang <rang@acm.org>
Reviewed by:	Anton Rang <rang@acm.org>, markj
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34375
2022-02-25 12:19:14 -06:00
Alexander Motin
f00ced06da CTL: Rework 05c3e8e871 using %zu format.
MFC after:	2 days
2022-02-25 11:53:53 -05:00
Rick Macklem
1cedb4ea1a nfscl: Fix a use after free in nfscl_cleanupkext()
ler@, markj@ reported a use after free in nfscl_cleanupkext().
They also provided two possible causes:
- In nfscl_cleanup_common(), "own" is the owner string
  owp->nfsow_owner.  If we free that particular
  owner structure, than in subsequent comparisons
  "own" will point to freed memory.
- nfscl_cleanup_common() can free more than one owner, so the use
  of LIST_FOREACH_SAFE() in nfscl_cleanupkext() is not sufficient.

I also believe there is a 3rd:
- If nfscl_freeopenowner() or nfscl_freelockowner() is called
  without the NFSCLSTATE mutex held, this could race with
  nfscl_cleanupkext().
  This could happen when the exclusive lock is held
  on the client, such as when delegations are being returned
  or when recovering from NFSERR_EXPIRED.

This patch fixes them as follows:
1 - Copy the owner string to a local variable before the
    nfscl_cleanup_common() call.
2 - Modify nfscl_cleanup_common() so that it will never free more
    than the first matching element.  Normally there should only
    be one element in each list with a matching open/lock owner
    anyhow (but there might be a bug that results in a duplicate).
    This should guarantee that the FOREACH_SAFE loops in
    nfscl_cleanupkext() are adequate.
3 - Acquire the NFSCLSTATE mutex in nfscl_freeopenowner()
    and nfscl_freelockowner(), if it is not already held.
    This serializes all of these calls with the ones done in
    nfscl_cleanup_common().

Reported by:	ler
Reviewed by:	markj
Tested by:	cy
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34334
2022-02-25 07:27:03 -08:00
Richard Scheffenegger
bd6bb49397 iscsi: per-session timeouts and rapid teardown of session on reconnect
Add per-Session configurable ping (SCSI NOP) and login timeouts.

Remove the torn down, old iSCSI session quickly, when performing a reconnect.

Reviewed By: trasz
Sponsored by:        NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D34198
2022-02-25 10:35:47 +01:00
Alexander Motin
05c3e8e871 Fix 32-bit build after 530d274c15.
MFC after:	3 days
2022-02-24 18:11:36 -05:00
Bjoern A. Zeeb
062103fc93 iwlwifi: update firmware
Update to the latest firmware based on
linux-firmware at c53073d4e1485ac9f7cb065db466793c495aead7
and update firmware module Makefiles accordingly.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-02-24 21:42:02 +00:00
Bjoern A. Zeeb
51152e5e61 iwlwifi: enhance debug information
Add a string of the debug type to the output of the debug message so it
is easier to search for specific events in a trace with lots of debugging
on.  While here remove superflous ().

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-02-24 21:42:01 +00:00
Bjoern A. Zeeb
d9836fb4b9 iwlwifi: update from iwlwifi-next
Import new code from iwlwifi-next at cb0a1fb7fd86b0062692b5056ca8552906509512
(matching tag: iwlwifi-next-for-kalle-2022-02-18).

Also add files not previously imported because we are not yet compiling
them to ease updating and having them when needed.

This adds MEI (Management Engine) support upstream which we cannot import
(currently GPL-only) so we have stub functions for the missing bits.

This also reduces the diff to upstream.  Changes submitted to avoid
problems with const and  with void * arithmetics were merged.

In the module build Makefile disable CONFIG_IWLWIFI_OPMODE_MODULAR
as we are building iwlwifi as a single module.

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
2022-02-24 21:42:01 +00:00