1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00
Commit Graph

274917 Commits

Author SHA1 Message Date
John Baldwin
43ac2b6d7c Remove isab_devclass from ISA bridge drivers. 2022-05-06 15:39:28 -07:00
John Baldwin
b69ec7a6bc aacraid: Remove unused devclass argument to DRIVER_MODULE. 2022-05-06 15:39:28 -07:00
John Baldwin
5a2ae6d050 aac: Remove unused devclass argument to DRIVER_MODULE. 2022-05-06 15:39:27 -07:00
John Baldwin
d5a7306c75 ata: Remove ata_devclass from DRIVER_MODULE invocations.
Keep the global variable for its uses in ata-pci.c and
chipsets/ata-fsl.c but initialize it in the existing
ata_module_event_handler.  Move the module event handler a bit earlier
to ensure the variable is set before any devices are attached.
2022-05-06 15:36:10 -07:00
John Baldwin
216ca4cee1 nvdimm_e820: Use driver->name in identify method.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D35077
2022-05-06 14:42:02 -07:00
John Baldwin
45dc8e3c2c nvdimm: Use devclass_lookup to find devclasses.
To avoid hardcoding the nvdimm driver name, move nvdimm_find_by_handle
below the definition of nvdimm_driver.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D35062
2022-05-06 14:41:42 -07:00
Rick Macklem
d71c9f1468 rpc.tlsservd: Add logging of TLS version and cipher used
This patch adds logging of the version of TLS and cipher
negotiated successfully by the TLS handshake for each client,
if the "-v" command line option has been specified.

This information may be useful for monitoring and debugging
NFS-over-TLS mounts.

MFC after:	2 weeks
2022-05-06 14:03:43 -07:00
Yan Ka Chiu
3cdfaefa4b bhyve: Fix virtio-console legacy configuration parsing
virtio-console is currently missing .pe_legacy_config, which prevents any
portN configuration from being parsed, and therefore no sockets will be
created.

Reviewed by:	khng
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D35142
2022-05-06 15:34:17 -04:00
Mitchell Horne
ff1c8af8c3 vt: use TERMINAL_DECLARE_EARLY() macro
It simplifies the declaration of the driver structures a little. There
are no current consumers of this macro, in fact it looks like it was
added for exactly this purpose.

This decreases the scope of some variables, so rework the initialization
in vt_init_logos() such that it doesn't require them.

No functional change intended.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D34820
2022-05-06 14:24:01 -03:00
Ruslan Bukin
0c0bfa0f6f Fix ofw_bus_iommu_map() since there is no limit on amount of maps
described in "iommu-map" DTS property.

Pointed out by:	rpokala
Sponsored by:	UKRI
2022-05-06 18:09:42 +01:00
Dmitry Chagin
3245a2ecea linux(4): Implement semtimedop syscalls.
On i386 are two semtimedop. The old one is called via multiplexor and
uses 32-bit timespec, and new semtimedop_tim64, which is uses 64-bit
timespec.

MFC after:		2 weeks
2022-05-06 20:02:59 +03:00
Dmitry Chagin
430460d717 linux(4): Regen for semtimedop syscalls.
MFC after:		2 weeks
2022-05-06 20:02:16 +03:00
Dmitry Chagin
f19c4e2341 linux(4): Change semtimedop syscall definition to match Linux actual one.
MFC after:		2 weeks
2022-05-06 20:01:43 +03:00
Dmitry Chagin
f48a68874b linux(4): Retire linux_semop implementation.
In i386 Linux semop called via ipc() multiplexor, so use kern_semop
directly from multiplexor.

MFC after:		2 weeks
2022-05-06 20:00:13 +03:00
Dmitry Chagin
cd875998dc linux(4): Regen for semop syscall.
MFC after:		2 weeks
2022-05-06 19:59:33 +03:00
Dmitry Chagin
f686092664 linux(4): Call semop directly.
As the Linux semop syscall is not defined in i386, and as it is equal
to the native semop syscall, call it directly.
Fix semop definition to match Linux actual one - nsops is size_t type.

MFC after:		2 weeks
2022-05-06 19:58:53 +03:00
Dmitry Chagin
f04534f5c8 sysvsem: Add a timeout argument to the semop.
For future use in the Linux emulation layer for the semtimedop syscall
split the sys_semop syscall into two counterparts and add
struct timespec *timeout argument to the last one.

Reviewed by:		jhb, kib
Differential revision:	https://reviews.freebsd.org/D35121
MFC after:		2 weeks
2022-05-06 19:51:48 +03:00
Ruslan Bukin
0b6bacc787 Add ofw_bus_iommu_map() that maps PCI requester ID to an IOMMU
specifier based on "iommu-map" DTS property.

Sponsored by: UKRI
2022-05-06 16:48:04 +01:00
Kristof Provost
4d48dd6890 pf: don't reject dummynet-ed packets
If we pass a packet to dummynet we should indicate we've passed it (but
keep m0 == NULL). Otherwise we'll indicate to the calling layers that
the packet has been rejected.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-05-06 16:41:34 +02:00
Kristof Provost
9501fc936f pf: dummynet fix
If we don't have a pipe set we shouldn't feed packets into dummynet.
This could occur if we have a 'dnpipe (0, 100)' configuration, for
example. We do want to feed the packet to dummynet in the return
direction, but not in the forward direction. In that case
pf_pdesc_to_dnflow() should return false, rather than pass a pipe number
of 0 to dummynet.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-05-06 16:37:47 +02:00
Kristof Provost
c530c80ef2 pf: fix reverse direction dummynet
Due to a typo dnrpipe (i.e. the pipe for reverse direction traffic) was
nevern assigned, preventing it from working correctly.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-05-06 14:37:07 +02:00
Kristof Provost
868bf82153 if: avoid interface destroy race
When we destroy an interface while the jail containing it is being
destroyed we risk seeing a race between if_vmove() and the destruction
code, which results in us trying to move a destroyed interface.

Protect against this by using the ifnet_detach_sxlock to also covert
if_vmove() (and not just detach).

PR:		262829
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D34704
2022-05-06 13:55:08 +02:00
Alexander Leidinger
b29fb6cffd Improve description of the nocache option.
Discussed with:	pstef
2022-05-06 13:03:30 +02:00
Bjoern A. Zeeb
464907ce1c net80211: simplify code after STA/AP VAPs traffic hang fix
Combine the comment and double-unsetting of OACTIVE into a single case
after e8de31cace.
This saves the question of why we do it twice--once right before and
one more time right after the state change check.
Also move the XXX comment about kicking the queue up to where it seems
better suited now.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D35135
2022-05-06 09:34:16 +00:00
Dan Carpenter
e99c0c8b79 xen: Prevent buffer overflow in privcmd ioctl
The "call" variable comes from the user in privcmd_ioctl_hypercall().
It's an offset into the hypercall_page[] which has (PAGE_SIZE / 32)
elements.  We need to put an upper bound on it to prevent an out of
bounds access.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Juergen Gross <jgross@suse.com>

Obtained from: Linux
Linux commit: 42d8644bd77dd2d747e004e367cb0c895a606f39
Fixes: bf7313e3b7 ("xen: implement the privcmd user-space device")
Submitted by: Elliott Mitchell <ehem+freebsd@m5p.com>
Reviewed by: royger
2022-05-06 09:31:32 +02:00
John Baldwin
0fdf5bc531 Remove extraneous devclass argument from DRIVER_MODULE_ORDERED6.
This is the variant of DRIVER_MODULE_ORDERED that does not accept a
devclass argument.

Fixes:		2a99dd30df Deprecate the 'devclass' argument from *DRIVER_MODULE() macros.
2022-05-05 17:02:39 -07:00
Kirk McKusick
262b581d17 Properly specify the level of indirect block being looked up.
The value is used only for diagnostic purposes so no functional
change should result.
2022-05-05 16:58:03 -07:00
John Baldwin
d4fa375a0e am335x_pwm_config_ecap: Use devclass_find to lookup devclass.
Differential Revision:	https://reviews.freebsd.org/D35082
2022-05-05 16:40:43 -07:00
John Baldwin
51f481235c pbio: Add locking and remove D_NEEDGIANT.
Use a sx lock to permit uiomove directly into/out of the the per-port
buffers.  In addition, the sx lock provides a stronger guarantee that
I think this driver wants which is to single-thread read and write
calls even while paused.  Finally, replace tsleep with dummy wait
channels with calls to pause_sig to more clearly communicate the
intent.

Differential Revision:	https://reviews.freebsd.org/D35081
2022-05-05 16:40:04 -07:00
John Baldwin
4942e8df47 pbio: Return BUS_PROBE_DEFAULT from probe instead of 0.
0 should only be returned from probe in legacy drivers that need to
preserve softc state between probe and attach.

Differential Revision:	https://reviews.freebsd.org/D35080
2022-05-05 16:39:19 -07:00
John Baldwin
bb81a138c3 pbio: Axe bus_space tag/handle using bus_read/write_1 instead.
Differential Revision:	https://reviews.freebsd.org/D35079
2022-05-05 16:38:51 -07:00
John Baldwin
0db65574bb pbio: Store softc in si_drv1 for character devices.
The port number is still stored in the unit (si_drv0) but is the
entire unit value now.

While here, removed checks for NULL softc since those can never happen
from cdevsw routines.  This also resulted in the close method becoming
a no-op, so it has been removed.

Differential Revision:	https://reviews.freebsd.org/D35078
2022-05-05 16:38:25 -07:00
John Baldwin
e4ec982c75 tdfx: Initialize tdfx_devclass via a module event handler.
Differential Revision:	https://reviews.freebsd.org/D35065
2022-05-05 16:37:38 -07:00
John Baldwin
5ad42f8055 smapi: Use devclass_find to lookup smapi devclass in unload handler.
Move smapi_modevent below the declaration of smapi_driver so that
smapi_driver's name member can be used rather than hardcoding the
device class name.

Differential Revision:	https://reviews.freebsd.org/D35064
2022-05-05 16:35:40 -07:00
John Baldwin
d4f988e188 smapi: Store softc pointer in si_drv1 of cdev.
Rather than fetching the softc using the device's unit number as an
index into the devclass.

Differential Revision:	https://reviews.freebsd.org/D35063
2022-05-05 16:35:19 -07:00
John Baldwin
ac56d90a49 ipmi: Use devclass_find to lookup ipmi devclass in ipmi_unload.
Differential Revision:	https://reviews.freebsd.org/D35061
2022-05-05 16:34:33 -07:00
John Baldwin
58d8316109 bhnd: Use devclass_find to lookup devclass for bhnd.
Differential Revision:	https://reviews.freebsd.org/D35058
2022-05-05 16:34:02 -07:00
John Baldwin
b483b6b256 cxgbe tom: Force unsigned modulus for queue indices.
The final transmit and receive queue indices need to be positive
values.  However, since txq_idx and rxq_idx are signed (to permit
using -1 to as a marker for uninitialized values), using %= with
another integer type (vi->nofld[tr]xq) yielded a sign-extended modulus
value.  This resulted in negative queue indices and a buffer underrun
when arc4random() returned a value with the sign bit set.  Use a
temporary unsigned variable to hold the "raw" queue index to force
unsigned modulus.

This worked previously because the modulus was previously applied
directly to the return value of arc4random() which is unsigned before
the result was assigned to txq_idx and rxq_idx.

Discussed with:	np
Fixes:		db28d4a0cd cxgbe/t4_tom: Support for round-robin selection of offload queues.
Sponsored by:	Chelsio Communications
2022-05-05 16:30:14 -07:00
Rick Macklem
15881823b9 rpc.tlsclntd, rpc.tlsservd: Fix getopt_long argument
The "C" option in the argument to getopt_long() was
missing a ":" for both rpc.tlsclntd.c and rpc.tlsservd.c.
This patch fixes this.

MFC after:	2 weeks
2022-05-05 16:22:12 -07:00
Rick Macklem
712aac1389 rpc.tlsservd: Add a -C command line option for preferred_ciphers
rpc.tlsclntd has a -C command line option for setting
preferred_ciphers.  Testing at a recent IETF NFSv4 testing
event showed that setting preferred_ciphers is not normally
needed for the rpc.tlsservd.

This patch modifies rpc.tlsservd to not specify preferred_ciphers
by default, but provides the same -C option as rpc.tlsclntd to
set preferred_ciphers, in case it is needed.

The man page update will be done as a separate commit.

MFC after:	2 weeks
2022-05-05 15:54:14 -07:00
Bjoern A. Zeeb
0881eb9665 rtw88: update man page for loader tunable for >4GB of main memory
Mention the loader tunable from 6a50157090
that needs to be set for system with more than 4GB of physical memory.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-05-05 21:17:40 +00:00
Bjoern A. Zeeb
6a50157090 LinuxKPI: skbuff: add memlimit tunable for 64bit systems
Some drivers, such as Realtek's rtw88, require 32bit DMA in
a single segment.  busdma(9) has a hard time providing this
currently for 3-ish pages at large quantities
(see lkpi_pci_nseg1_fail in linux_pci.c e86707418c).
Work around this for now by allowing a tunable to enforce
physical addresses allocation limits on 64bit platforms (ignoring PAE)
using "old-school" contigmalloc(9) to avoid bouncing.

A patch needing a custom kernel compiled was tested in the last weeks
by rtw88 users providing the 32bit limit only hardcoded.  The 36bit
limit can be found in iwlwifi so is added as a testing option along.

This is put in as a bandaid for now, so people no longer need to patch
and compile their own kernels to use rtw88 and to allow us to MFC the
driver as well before the amounts of commits to track increases by
much more.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2022-05-05 20:54:44 +00:00
Ed Maste
adbe6e6435 Reenable vnet tests in CI
After restoring the associated commits the tests can be enabled again.

This reverts commit 711524d961.
This reverts commit c4585b938a.

PR:		263767
2022-05-05 14:38:08 -04:00
Kristof Provost
613acc6483 mbuf: do not restore dying interfaces
When we remove an interface it is first removed from the interface list
V_ifnet (by if_unlink_ifnet()) and marked as IFF_DYING. We then wait for
any possible references to stop being used (i.e.
epoch_wait/epoch_drain_callbacks) before we tear it fully down.

However, the index in ifindex_table is not removed, so m_rcvif_restore()
can still find the (now dying) interface.

This results in panics, for example when dummynet restores the rcvif
pointer and passes a packet to ip6_input() we can panic because the
AF_INET6 domain has already been removed (so we end up dereferencing a
NULL pointer there).

Check that the interface is not dying before we restore it, which is
equivalent to checking its presence in V_ifnet, and thus ensures that
future accesses (while in NET_EPOCH) are safe.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34076

(cherry picked from commit 703e533da5)
2022-05-05 14:38:08 -04:00
Gleb Smirnoff
51f798e761 netisr: serialize/restore m_pkthdr.rcvif when queueing mbufs
Reviewed by:		kp
Differential revision:	https://reviews.freebsd.org/D33268

(cherry picked from commit 6871de9363)
2022-05-05 14:38:07 -04:00
Gleb Smirnoff
8ef7beb29e dummynet: use m_rcvif_serialize/restore when queueing packets
This fixed panic with interface being removed while packet
was sitting on a queue.  This allows to pass all dummynet
tests including forthcoming dummynet:ipfw_interface_removal
and dummynet:pf_interface_removal and demonstrates use of
m_rcvif_serialize() and m_rcvif_restore().

Reviewed by:		kp
Differential revision:	https://reviews.freebsd.org/D33267

(cherry picked from commit 165746f4e4)
2022-05-05 14:38:07 -04:00
Gleb Smirnoff
4d7a1361ef ifnet/mbuf: provide KPI to serialize/restore m->m_pkthdr.rcvif
Supplement ifindex table with generation count and use it to
serialize & restore an ifnet pointer.

Reviewed by:		kp
Differential revision:	https://reviews.freebsd.org/D33266
Fun note:		git show e6abef0918

(cherry picked from commit e1882428dc)
2022-05-05 14:38:07 -04:00
Gleb Smirnoff
80e60e236d ifnet: make if_index global
Now that ifindex is static to if.c we can unvirtualize it.  For lifetime
of an ifnet its index never changes.  To avoid leaking foreign interfaces
the net.link.generic.system.ifcount sysctl and the ifnet_byindex() KPI
filter their returned value on curvnet.  Since if_vmove() no longer
changes the if_index, inline ifindex_alloc() and ifindex_free() into
if_alloc() and if_free() respectively.

API wise the only change is that now minimum interface index can be
greater than 1.  The holes in interface indexes were always allowed.

Reviewed by:		kp
Differential revision:	https://reviews.freebsd.org/D33672

(cherry picked from commit 91f44749c6)
2022-05-05 14:38:07 -04:00
Jessica Clarke
c080688399 release: Use full window size for installer over serial lines
When running over a serial line we end up defaulting to 80x24, which is
rather cramped for many dialog boxes and occupies very little screen
space for most modern terminals. Thus, run resizewin -z to set the
terminal size if not already known before starting the installer, just
as we do for csh and sh login shells already in their default dotfiles.

Reviewed by:	jhb, gjb
Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D34414
2022-05-05 19:07:54 +01:00
Gordon Bergling
4b7f35db44 libc: Add HISTORY sections to the manual pages
There are some sections which could be improved
and work to do so is on going. The work will be
covered via 'X-MFC-WITH' commits.

Obtained from:	OpenBSD
MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D34759
2022-05-05 18:46:32 +02:00