Commit graph

290069 commits

Author SHA1 Message Date
Sumit Saxena 835b12a5f9 mrsas: don't reference the removed physical disk of RAID1 during IO submission
When a physical disk(PD) [belonging to a RAID1 Virtual disk(VD)] is
removed, driver may still use the reference to the removed PD while submitting
IO to the controller. Controller firmware faults upon receipt of such IO.
This patch fixes this issue by not using any reference to the removed PD.

Reviewed by:	imp
Approved by:	imp
Sponsored by:	Broadcom Inc
Differential Revision:	https://reviews.freebsd.org/D44282
2024-03-12 09:51:48 +00:00
Warner Losh 7a0a6b276c libc: Move tzset.3 to stdtime
This really belongs in stddime, since it documents interfaces
implemented in stdtime.

Suggested by:	brooks
Sponsored by:	Netflix
2024-03-11 22:19:31 -06:00
Warner Losh a34940a975 timezone: Move to the XSI/POSIX definition for timezone.
The old timezone(3) function has long since been obsolete and has a
fatally flawed interface. Retain this function for compatibility
purposes, but shift to providing the offset from UTC in the timezone
variable, whether or not the timezone observes summer time in the
'daylight' variable. Document the tzname variable that's already been
set. Also make _tztab() static. It's not used in libc (or anywhere in
the tree) and it's not exported as a public dynamic symbol.

Sponsored by:		Netflix
Reviewed by:		brooks, kib
Differential Revision:	https://reviews.freebsd.org/D44281
2024-03-11 22:19:31 -06:00
Gleb Smirnoff 7b133b34f8 vmm: fix standalone module build 2024-03-11 17:59:03 -07:00
Warner Losh 462af7676b kboot: kbootfdt: fix error handling
If we are able to open /sys/firmware/fdt, but aren't able to read it,
fall back to /proc/device-tree. Remove comment that's not really true,
it turns out.

Sponsored by:		Netflix
2024-03-11 15:21:52 -06:00
Warner Losh d75524b3fe kboot: Use is_linux_error to check mmap return error
Rather than checking against the (incorrect) -511, use the
is_linux_error() function to check to see if host_mmap failed.

Sponsored by:		Netflix
2024-03-11 15:21:52 -06:00
Warner Losh a9cd3b675e kboot: Print UEFI memory map
If we can read the UEFI memory map, go ahead and print the memory map.
While the kernel prints this with bootverbose, having it at this stage
is useful for debugging other problems.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D44287
2024-03-11 15:21:52 -06:00
Warner Losh d650c3efb6 kboot: hostfs -- check for llseek failure correctly
The host_* syscalls are all raw Linux system calls, not the POSIX
wrappers that glibc / musl create. So we have to ranage change the
return value of host_llseek correctly to use the negative value hack
that all Linux system calls use.

This fixes a false positive error detection when we do something like
lseek(fd, 0xf1234567, ...); This returns 0xf1234567, which is a negative
value which used to trigger the error path.  Instead, we check using the
is_linux_error() and store the return value in a long. Translate that
errno to a host errno and set the global errno to that and return
-1. lseek can't otherwise return a negative number, since it's the
offset after seeking into the file, which by definition is positive.

This kept the 'read the UEFI memory map out of physical memory' from
working on aarch64 (whose boot loader falls back to reading it since
there are restrictive kernel options that can also prevent it), since
the physical address the memory map was at on my platform was like
0xfa008018.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D44286
2024-03-11 15:21:51 -06:00
Warner Losh 8b1925f29c kboot: Avoid UB in signed shift
offset is signed. Copy it to the unsigned res before shifting. This
avoids any possible undefined behavior for right shifting signed
numbers. No functional change intended (and the code generated is the
nearly same for aarch64).

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D44285
2024-03-11 15:21:51 -06:00
Warner Losh 3ae18fdfbc kboot: Create function for error checking.
Linux has the convention of returning -ERRNO to flag errors from its
system calls. Sometimes other negative values are returned that are
success...  However, only values -1 to -4096 (inclusive) are really
errors. The rest are either truncated values that only look negative (so
use long instead of int), or are things like addresses or legal unsigned
file offsets or similar that are successful returns. Filter out the
latter.

Sponsored by:		Netflix
2024-03-11 15:21:51 -06:00
Brooks Davis c112243f6b Revert "Update to bring the rack stack with all its fixes in."
This commit was incomplete and breaks LINT kernels.  The tree has been
broken for 8+ hours.

This reverts commit f6d489f402.
2024-03-11 20:28:24 +00:00
Marek Zarychta 16f8d88294 netlink: fix route protocol constant values to match Linux
Although these particular constants aren't supported, the incorrect
values break bird 2.15 operation.

PR:		277618
Reported by:	Ondrej Zajicek <santiago@crfreenet.org>
2024-03-11 08:50:46 -07:00
Gleb Smirnoff 55951611e4 tests/unix_seqpacket: mk_pair_of_sockets() requires a valid argument
All callers do it right.  Don't be overprotective against a stupid
caller and thus don't look like a code that leaks a resource.

Reported by:	Coverity Scan
CID:		1539210
2024-03-11 07:50:29 -07:00
Dag-Erling Smørgrav 59c8e88e72 Add 'contrib/libdiff/' from commit '9eb461aa4b61ab47855b2cee9e5b626a76888b5e'
git-subtree-dir: contrib/libdiff
git-subtree-mainline: f6d489f402
git-subtree-split: 9eb461aa4b

Reviewed by:	imp
Sponsored by:	Klara, Inc.
2024-03-11 14:48:08 +01:00
Randall Stewart f6d489f402 Update to bring the rack stack with all its fixes in.
This brings the rack stack up to the current level used at NF. Many fixes
and improvements have been added. I also add in a fix to BBR to deal with
the changes that have been in hpts for a while i.e. only one call no matter
if mbuf queue or tcp_output.

Note there is a new file that I can't figure out how to get in rack_pcm.c

It basically does little except BBlogs and is a placemark for future work on
doing path capacity measurements.

Reviewed by: tuexen, glebius
Sponsored by: Netflix Inc.
Differential Revision:https://reviews.freebsd.org/D43986
2024-03-11 07:36:54 -04:00
Dimitry Andric 96c567f972 Add space before 20240211 entry in ObsoleteFiles.inc 2024-03-10 12:36:28 +01:00
Jason A. Harmening 6c8ded0015 unionfs: accommodate underlying FS calls that may re-lock
Since non-doomed unionfs vnodes always share their primary lock with
either the lower or upper vnode, any forwarded call to the base FS
which transiently drops that upper or lower vnode lock may result in
the unionfs vnode becoming completely unlocked during that transient
window.  The unionfs vnode may then become doomed by a concurrent
forced unmount, which can lead to either or both of the following:

--Complete loss of the unionfs lock: in the process of being
  doomed, the unionfs vnode switches back to the default vnode lock,
  so even if the base FS VOP reacquires the upper/lower vnode lock,
  that no longer translates into the unionfs vnode being relocked.
  This will then violate that caller's locking assumptions as well
  as various assertions that are enabled with DEBUG_VFS_LOCKS.

--Complete less of reference on the upper/lower vnode: the caller
  normally holds a reference on the unionfs vnode, while the unionfs
  vnode in turn holds references on the upper/lower vnodes.  But in
  the course of being doomed, the unionfs vnode will drop the latter
  set of references, which can effectively lead to the base FS VOP
  executing with no references at all on its vnode, violating the
  assumption that vnodes can't be recycled during these calls and
  (if lucky) violating various assertions in the base FS.

Fix this by adding two new functions, unionfs_forward_vop_start_pair()
and unionfs_forward_vop_finish_pair(), which are intended to bookend
any forwarded VOP which may transiently unlock the relevant vnode(s).
These functions are currently only applied to VOPs that modify file
state (and require vnode reference and lock state to be identical at
call entry and exit), as the common reason for transiently dropping
locks is to update filesystem metadata.

Reviewed by:	olce
Tested by:	pho
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D44076
2024-03-09 19:54:04 -06:00
Jason A. Harmening d56c175ac9 uipc_bindat(): Explicitly specify exclusive locking for the new vnode
When calling VOP_CREATE(), uipc_bindat() reuses the componentname
object from the preceding lookup operation, which is likely to specify
LK_SHARED.  Furthermore, the VOP_CREATE() interface technically only
requires the newly-created vnode to be returned with a shared lock.
However, the socket layer requires the new vnode to be locked exclusive
and asserts to that effect.

In most cases, this is not a practical concern because most if not
all base-layer filesystems (certainly FFS, ZFS, and msdosfs at least)
always return the vnode locked exclusive regardless of the lock flags.
However, it is an issue for unionfs which uses cn_lkflags to determine
how the new unionfs wrapper vnode should be locked.  While it would
be easy enough to work around this issue within unionfs itself, it
seems better for the socket layer to be explicit about its locking
requirements when issuing VOP_CREATE().

Reviewed by:		kib, olce
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D44047
2024-03-09 19:48:02 -06:00
Jason A. Harmening fa26f46dc2 vn_lock_pair(): allow lkflags1/lkflags2 to be 0 if vp1/vp2 is NULL
It's a bit strange to require the caller to pass contrived lock flags
if the corresponding vnode is NULL, simply to appease the assertion
that exactly one of LK_SHARED or LK_EXCLUSIVE must be set.  On the
other hand, we still want to catch cases in which completely bogus
or corrupt flags are passed even if the corresponding vnode is NULL.
Therefore, specifically allow empty flags for lkflags1/lkflags2 iff
the respective vp1/vp2 param is NULL.

Reviewed by:		kib, olce
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D44046
2024-03-09 19:41:45 -06:00
Konstantin Belousov bdf1587a49 mount_nullfs(8): fix typo
Reported by:	mckusick
2024-03-09 23:18:39 +02:00
Mark Johnston a58813fd70 ktrace: Fix the build when options KTRACE is not configured
MFC after:	1 week
Reported by:	John Nielsen <lists@jnielsen.net>
2024-03-09 00:33:55 -05:00
Mark Johnston cce4979133 ktrace: Add __ktrace_used
This suppresses warnings about write-only variables when the KTRACE
option is disabled, akin __diagused and __witness_used.

MFC after:	1 week
2024-03-09 00:33:55 -05:00
Kyle Evans 6e2cfb24ee crunchgen: slap a dependency on the generated makefile for .lo
crunchgen generates a foo.lo for each binary it will end up crunching
into the final product.  While they have a dependency on the libs that
are used to link them, nothing will force relinking if the set of libs
needed to link them is changed.  Because of this, incremental builds may
not be possible if one builds a version of, e.g., rescue/ with a broken
set of libs specified for a project -- a subsequent fix won't be rolled
in cleanly, it will require purging the rescue/ objdir.

This is a bit crude, but the foo.mk we generate doesn't actually get
regenerated all that often in practice, so a spurious relink for the
vast majority of crunched objects won't actually happen all that often.

Reviewed by:	bapt, emaste, imp
Differential Revision:	https://reviews.freebsd.org/D43869
2024-03-08 20:01:25 -06:00
Brooks Davis a650ec0e55 lib{c,sys}: fix incremental builds
I removed lib/libsys/{aarch64,arm,riscv}/syscall.S in favor of an
idential generated version.  We need to clean out the .ddepend files to
ensure the generated version is actually generated.

The guard here is technically too strict, but should be fine in practice
and I've verified both the breakage and fix on an armv7 build.

Reported by:	imp
Fixes:		e6ffc7669a Remove pointless MD syscall(2)
Fixes:		0ee0ae2373 Remove pointless MD syscall(2)
Fixes:		7b3836c281 Remove pointless MD syscall(2)
2024-03-08 19:14:24 +00:00
Konstantin Belousov 4e8d264b00 nullfs_mount(): fix whitespace 2024-03-08 20:51:39 +02:00
Konstantin Belousov 4a2a69c447 mount_nullfs(8): document -o cache and vfs.nullfs.cache_vnodes
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-08 20:44:21 +02:00
Konstantin Belousov 8921216dbe nullfs: add -o cache
to allow overwrite global default if needed.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-08 20:44:21 +02:00
Konstantin Belousov 0724293331 nullfs_mount(): remove unneeded cast
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-03-08 20:44:21 +02:00
Mitchell Horne accda78153 simple_mfd: don't attach children twice
Trying to probe+attach the child device at the point it is added comes
before the syscon handle is set up (if relevant). It will therefore be
unavailable to the attach method which is expecting it, and the first
attempt to attach the device will fail.

Just rely on the call to bus_generic_attach() at the end of the function
to perform probe+attach of dev's children.

Reviewed by:	manu
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44268
2024-03-08 10:09:36 -04:00
Mitchell Horne 08635c51d1 clkdom_dump(): improve output text
If the call to clknode_get_freq() returns an error (unlikely), report
this, rather than printing the error code as the clock frequency.

If the clock has no parent (e.g. a fixed reference clock), print "none"
rather than "(NULL)(-1)". This is a more human-legible presentation of the
same information.

Reviewed by:	manu
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44267
2024-03-08 10:09:36 -04:00
Mitchell Horne 1cb9f6f641 clk_fixed: quiet by default
We may attach several of these devices, but there is no meaningful
information added to dmesg. For example:

  ofwbus0: <Open Firmware Device Tree>
  clk_fixed0: <Fixed clock> on ofwbus0
  clk_fixed1: <Fixed clock> on ofwbus0
  clk_fixed2: <Fixed clock> on ofwbus0
  clk_fixed3: <Fixed clock> on ofwbus0
  clk_fixed4: <Fixed clock> on ofwbus0
  clk_fixed5: <Fixed clock> on ofwbus0
  clk_fixed6: <Fixed clock> on ofwbus0
  clk_fixed7: <Fixed clock> on ofwbus0
  clk_fixed8: <Fixed clock> on ofwbus0
  clk_fixed9: <Fixed clock> on ofwbus0
  clk_fixed10: <Fixed clock> on ofwbus0
  clk_fixed11: <Fixed clock> on ofwbus0

To reduce this noise, quiet the devices for by default. For verbose
boot, the message will be emitted.

Reviewed by:	manu
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44266
2024-03-08 10:09:36 -04:00
Mitchell Horne 6e66bb9fc3 clk_fixed: call clkdom_dump() for verbose boot
This is standard practice for clock drivers that register clocks
dynamically. Nothing else uses the CLK_DEBUG macro.

The result is that the name and frequency of the fixed clock is printed
for a verbose boot, which may aid in debugging.

Reviewed by:	manu
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44265
2024-03-08 10:09:36 -04:00
Wei Hu 999174ba03 Hyper-V: vPCI: fix cpu id mis-mapping in vmbus_pcib_map_msi()
The msi address contains apic id. The code in vmbus_pcib_map_msi()
treats it as cpu id, which could cause mis-configuration of msix
IRQs, leading to missing interrupts for SRIOV devices. This happens
when apic id is not the same as cpu id on certain large VM sizes
with multiple numa domains in Azure. Fix this issue by correctly
mapping apic ids to cpu ids.

On vPCI version before 1.4, it only supports up to 64 vcpus
for msi/msix interrupt. This change also adds a check and returns
error if the vcpu_id is greater than 63.

Reported by:	NetApp
Tested by:	whu
MFC after:	1 week
2024-03-08 10:16:10 +00:00
Michael Tuexen 96ad640178 TCP LRO: add dtrace probe points
Add the IP, UDP, and TCP receive static probes to the code path,
which avoids if_input.

Reviewed by:		rrs, markj
MFC after:		1 week`
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43727
2024-03-08 10:21:09 +01:00
Michael Tuexen d1ce01214a TCP LRO: disable mbuf queuing when packet filter hooks are in place
When doing mbuf queueing, the packet filter hooks in ether_demux(),
ip_input(), and ip6_input() are by-passed. This means that the packet
filters don't process incoming packets, which might result in
connection failures. For example bypassing the TCP sequence number
validation will result in dropping valid packets.
Please note that this patch is only disabling mbuf queueing, not LRO.

Reported by:		Herbert J. Skuhra
Reviewed by:		glebius, rrs, rscheff
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D43769
2024-03-08 10:03:43 +01:00
Warner Losh 4f9fbde5ee ObsoleteFiles.inc: add the awk tests I just remvoed
These files were bogusly added when I imported awk 2nd edition.

Sponsored by:		Netflix
2024-03-07 23:03:41 -07:00
Warner Losh ba7b7f94c2 awk: Fix the tests
I'd forgotten that we have to adjust the stderr tests from
upstream. Remove the OK files. Also remove system-status.*.  These
restore the fixes I made in 517e52b6c2 which were lost when I imported
the last version of awk.

Also, force LANG to be C.UTF-8 when testing to ensure that stray lang
settings don't fail tests.

Sponsored by:		Netflix
2024-03-07 22:52:56 -07:00
Brooks Davis 32c7350beb libc/i386: don't attempt to export alloca
The assembly implementation was removed in 2006 (commit 3c03c7095e).

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44242
2024-03-07 20:14:55 +00:00
Brooks Davis 6e6cd03c91 libc/quad: narrow list of symbols exposed on i386
These symbols aren't present on i386 so don't try to expose them.

Given the structure of quad/Makefile.inc, it might make more sense to
have per-arch symbol maps here, but this is sufficent to build with
WITHOUT_UNDEFINED_VERSION on i386.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44243
2024-03-07 20:12:22 +00:00
Brooks Davis 8c8882ce96 libc/iconv: don't export nonexistant symbols
It's unclear to me that any of these symbols ever existed.  The ones
I've spot checked are only mentioned in the initial Citrus iconv import
(commit ad30f8e79b) and this code hasn't changed much over time.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D44183
2024-03-07 20:12:22 +00:00
Sumit Saxena 72ecb165a2 amend! if_bnxt: Integrate AOC Cable Support into Current 40G PHY Speed
if_bnxt: Integrate AOC Cable Support into Current 40G PHY Speed

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42956
2024-03-07 19:34:12 +00:00
Chandrakanth Patil 770e7ba3eb if_bnxt: Set 1G/10G baseT force speed as auto speeds
The firmware lacks support for manually setting 1G and 10G baseT speeds.
However, the driver can enable auto speed masks to achieve automatic configuration
at these speeds.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42960
2024-03-07 19:26:34 +00:00
Chandrakanth Patil c63d67e137 if_bnxt: 50G, 100G and 200G PAM4 support
Add support for 50G, 100G and 200G PAM4 support

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42959
2024-03-07 19:16:39 +00:00
Sumit Saxena 3320f0f69f if_bnxt: Pluggable Module Display Support
This update enables the display of pluggable module information
to users via the ifconfig utility.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42958
2024-03-07 19:16:39 +00:00
Chandrakanth Patil d36b36621a if_bnxt: Implementation of Extended Port Hardware Stats Support for THOR Controller
The newly added port extended hardware statistics are now accessible to
users through the sysctl interface. Also, Few obsolete stats are removed
and few stats are renamed.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42957
2024-03-07 19:16:39 +00:00
Chandrakanth Patil 816abba22e if_bnxt: Integrate AOC Cable Support into Current 40G PHY Speed
Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D429506
2024-03-07 19:16:39 +00:00
Chandrakanth Patil 25f38d0990 if_bnxt: Update Firmware Header to Latest Version 1.10.2.136
Update Firmware Header to Latest Version 1.10.2.136.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42955
2024-03-07 19:16:39 +00:00
Chandrakanth Patil 8a3aab53e3 if_bnxt: Update Maximum Configurable MTU from 9000 to 9600
Increasing the maximum configurable MTU from 9000 to 9600 to
align with the firmware's capability of handling an MTU up to 9600.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42954
2024-03-07 19:16:39 +00:00
Chandrakanth Patil 0f8d1a9e0c if_bnxt: Enabled support for 1G SX, CX, and LX forced speed settings
Enabled User Configuration of 1G Speed on Wh+ SFP28 Port with AOC
cable.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42953
2024-03-07 19:16:38 +00:00
Chandrakanth Patil c5108e37fb if_bnxt: Incorrect Labeling of Supported Medium in ifconfig -m <inf> Command
The 1G speed on DAC medium is incorrectly labeled as 1000baseT, it
should be 1000baseCX. Updated the label accordingly.

Reviewed by:            imp
Approved by:            imp
Differential revision:  https://reviews.freebsd.org/D42952
2024-03-07 19:09:13 +00:00