]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 months agog_raid concat: Fail requests to read beyond the end of the volume
John Baldwin [Fri, 4 Aug 2023 23:41:05 +0000 (16:41 -0700)]
g_raid concat: Fail requests to read beyond the end of the volume

Previously a debug kernel would trigger an assertion failure if an I/O
request attempted to read off the end of a concat volume, but a
non-debug kernel would use an invalid sub-disk to try to complete the
request eventually resulting in some sort of fault in the kernel.

Instead, turn the assertions into explicit checks that fail requests
beyond the end of the volume with EIO.  For requests which run over
the end of the volume, return a short request.

PR: 257838
Reported by: Robert Morris <rtm@lcs.mit.edu>
Reviewed by: emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41222

13 months agoudf: Reject read requests with an invalid length
John Baldwin [Fri, 4 Aug 2023 23:40:19 +0000 (16:40 -0700)]
udf: Reject read requests with an invalid length

- If the size is negative or if rounding it up to a multiple of
  the block size overflows, fail the read request with ERANGE.

- While here, add a sanity check that the ICB length for the root
  directory is at least as long as a minimum-sized file entry.

PR: 257768
Reported by: Robert Morris <rtm@lcs.mit.edu>
MFC after: 1 week
Sponsored by: FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41220

13 months agoudf: reject invalid block sizes from lvd
Konstantin Belousov [Fri, 4 Aug 2023 22:47:09 +0000 (01:47 +0300)]
udf: reject invalid block sizes from lvd

PR: 272893
Reported by: Robert Morris <rtm@lcs.mit.edu>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

13 months agosctp: improve consistency of acc and ccc handling in snd buffer
Michael Tuexen [Fri, 4 Aug 2023 06:32:25 +0000 (08:32 +0200)]
sctp: improve consistency of acc and ccc handling in snd buffer

Don't clear the counters for the socket snd buffer when
shutdown(..., SHUT_WR) or shutdown(..., SHUT_RDWR) is called.
This was causing the system to panic() when SCTP pf tests were
running.

Reported by: dchagin, kp
MFC after: 1 week

13 months agovm_phys_enq_range: no alignment assert for npages==0
Doug Moore [Fri, 4 Aug 2023 18:41:59 +0000 (13:41 -0500)]
vm_phys_enq_range: no alignment assert for npages==0

Do not assume that when vm_phys_enq_range is passed npages==0 that the
vm_page argument is valid in any way, much less that it has a
page-aligned address. Just don't look at it. Assert nothing about it.

Reported by: karels
Differential Revision: https://reviews.freebsd.org/D41317

13 months agoLimit the number of CPUs in the gicv1/2 driver
Andrew Turner [Fri, 4 Aug 2023 15:06:44 +0000 (16:06 +0100)]
Limit the number of CPUs in the gicv1/2 driver

The GICv2 can only send IPIs to 8 CPUs. Because of this it should only
be in machines with no more than 8 cores.

Create a new macro to hold this limit to reduce the size of the softc.

Reviewed by: emaste
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D41322

13 months agoopenssh: retire HPN option handling
Ed Maste [Wed, 2 Aug 2023 14:37:12 +0000 (10:37 -0400)]
openssh: retire HPN option handling

The HPN patch set was removed from base system SSH in January 2016, in
commit 60c59fad8806.  We retained the option parsing (using OpenSSH's
support for deprecated options) to avoid breaking existing installations
upon upgrade, but sufficient time has now passed that we can remove this
special case.

Approved by: des
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41291

13 months agoamd64: Increase sanitizers' static shadow memory reservation
Mark Johnston [Fri, 4 Aug 2023 16:25:50 +0000 (12:25 -0400)]
amd64: Increase sanitizers' static shadow memory reservation

Because KASAN shadows the kernel image itself (KMSAN currently does
not), a shadow mapping of the boot stack must be created very early
during boot.  pmap_san_enter() reserves a fixed number of pages for the
purpose of creating and mapping this shadow region.

After commit 789df254cc9e ("amd64: Use a larger boot stack"), it could
happen that this reservation is insufficient; this happens when
bootstack crosses a PAGE_SHIFT + KASAN_SHADOW_SCALE_SHIFT boundary.
Update the calculation to take into account the new size of the boot
stack.

Fixes: 789df254cc9e ("amd64: Use a larger boot stack")
Sponsored by: The FreeBSD Foundation

13 months agopam_krb5: Rename a variable.
Dag-Erling Smørgrav [Fri, 4 Aug 2023 16:08:28 +0000 (16:08 +0000)]
pam_krb5: Rename a variable.

Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D41300

13 months agopam_krb5: Clarify a loop condition.
Dag-Erling Smørgrav [Fri, 4 Aug 2023 16:08:21 +0000 (16:08 +0000)]
pam_krb5: Clarify a loop condition.

The closing parenthesis was in the wrong location, so instead of assigning the return value to krbret and then comparing it to zero, we were assigning the result of the comparison to krbret and then comparing that to zero.  This has no practical significance since the value is not used after the loop terminates.

PR: 229719
Reviewed by: cy
Differential Revision: https://reviews.freebsd.org/D41299

13 months agonctgpio: Enable all the 9 groups for NCT6116D and remove FIXMEs
Stéphane Rochoy [Tue, 4 Jul 2023 13:57:08 +0000 (15:57 +0200)]
nctgpio: Enable all the 9 groups for NCT6116D and remove FIXMEs

Reviewed by: emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/810

13 months agoncthwm: Use `sysctl_handle_16` to match CTLTYPE_U16
Stéphane Rochoy [Fri, 4 Aug 2023 09:31:33 +0000 (11:31 +0200)]
ncthwm: Use `sysctl_handle_16` to match CTLTYPE_U16

Pull Request: https://github.com/freebsd/freebsd-src/pull/810

13 months agopf: test rules evaluation in the face of multiple IPv6 fragment headers
Kristof Provost [Thu, 13 Jul 2023 06:34:54 +0000 (08:34 +0200)]
pf: test rules evaluation in the face of multiple IPv6 fragment headers

Send an ICMPv6 echo request packet with multiple IPv6 fragment headers.
Set rules to pass all packets, except for ICMPv6 echo requests.

pf ought to drop the echo request, but doesn't because it reassembles
the packet, and then doesn't handle the second fragment header. In other
words: it fails to detect the ICMPv6 echo header.

Reported by: Enrico Bassetti bassetti@di.uniroma1.it (NetSecurityLab @ Sapienza University of Rome)
MFC after: instant
Sponsored by: Rubicon Communications, LLC ("Netgate")

13 months agopf: handle multiple IPv6 fragment headers
Kristof Provost [Thu, 13 Jul 2023 08:25:49 +0000 (10:25 +0200)]
pf: handle multiple IPv6 fragment headers

With 'scrub fragment reassemble' if a packet contains multiple IPv6
fragment headers we would reassemble the packet and immediately
continue processing it.

That is, we'd remove the first fragment header and expect the next
header to be a final header (i.e. TCP, UDP, ICMPv6, ...). However, if
it's another fragment header we'd not treat the packet correctly.
That is, we'd fail to recognise the payload and treat it as if it were
an IPv6 fragment rather than as its actual payload.

Fix this by restarting the normalisation on the reassembled packet.
If there are multiple fragment headers drop the packet.

Reported by: Enrico Bassetti bassetti@di.uniroma1.it (NetSecurityLab @ Sapienza University of Rome)
MFC after: instant
Sponsored by: Rubicon Communications, LLC ("Netgate")

13 months agolinux(4): Add a dedicated ioprio system calls
Dmitry Chagin [Fri, 4 Aug 2023 13:03:57 +0000 (16:03 +0300)]
linux(4): Add a dedicated ioprio system calls

On Linux these system calls have an effect only when used in conjuction
with an I/O scheduler that supports I/O priorities. If no I/O scheduler
has been set for a thread, then by defaut the I/O priority will follow
the CPU nice value. Due to FreeBSD lack of I/O scheduler facilities, the
default Linux behavior is implemented.

Ubuntu 23.04 debootstrap requires Linux ionice which depends on these
syscalls.

Differential Revision: https://reviews.freebsd.org/D41153
MFC after: 1 month

13 months agolinux(4): Regen for ioprio syscalls
Dmitry Chagin [Fri, 4 Aug 2023 13:03:57 +0000 (16:03 +0300)]
linux(4): Regen for ioprio syscalls

MFC after: 1 month

13 months agolinux(4): Modify ioprio syscalls to match Linux
Dmitry Chagin [Fri, 4 Aug 2023 13:03:55 +0000 (16:03 +0300)]
linux(4): Modify ioprio syscalls to match Linux

MFC after: 1 month

13 months agoarm64-iommu: Fix a typo in a kernel message
Gordon Bergling [Fri, 4 Aug 2023 11:52:36 +0000 (13:52 +0200)]
arm64-iommu: Fix a typo in a kernel message

- s/endianess/endianness/

MFC after: 5 days

13 months agoi2c.8: Fix a typo in the manual page
Gordon Bergling [Fri, 4 Aug 2023 11:50:48 +0000 (13:50 +0200)]
i2c.8: Fix a typo in the manual page

- s/endianess/endianness/

MFC after: 5 days

13 months agounzip: swtich to bsdunzip from libarchive
Martin Matuska [Mon, 31 Jul 2023 11:54:58 +0000 (13:54 +0200)]
unzip: swtich to bsdunzip from libarchive

Unzip from FreeBSD has been ported to libarchive.
Change usr.bin/unzip to use bsdunzip from libarchive.

Differential Revision: https://reviews.freebsd.org/D41239
PR: 272845 (exp-run)
MFC after: 1 month

13 months agoOptionalObsoleteFiles: add missed keymaps for sycons
Yuri Pankov [Fri, 4 Aug 2023 10:04:17 +0000 (12:04 +0200)]
OptionalObsoleteFiles: add missed keymaps for sycons

13 months agoRemove MAXCPUS from the gicv3 driver
Andrew Turner [Fri, 4 Aug 2023 09:14:16 +0000 (10:14 +0100)]
Remove MAXCPUS from the gicv3 driver

We create a static array of pointers to per-CPU data. Because the cpuid
space on arm64 is not sparse there is no need to add an extra level of
indirection. Move to use mallocarray to allocate the redistributors as
a single array.

Sponsored by: Arm Ltd

13 months agoarm64: Make dpcpu static
Andrew Turner [Thu, 3 Aug 2023 20:32:57 +0000 (21:32 +0100)]
arm64: Make dpcpu static

We don't use this directly outside this file so it can be static.

Sponsored by: Arm Ltd

13 months agolocale: update to CLDR 43 and Unicode 15
Yuri Pankov [Thu, 3 Aug 2023 23:47:16 +0000 (01:47 +0200)]
locale: update to CLDR 43 and Unicode 15

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D41151

13 months agoopensm libopensm: remove non-existent symbols from the version map
Konstantin Belousov [Thu, 3 Aug 2023 08:52:06 +0000 (11:52 +0300)]
opensm libopensm: remove non-existent symbols from the version map

Sponsored by: NVidia networking
MFC after: 1 week

13 months agoopensm libvendor: remove non-existent symbols from the version map
Konstantin Belousov [Thu, 3 Aug 2023 08:44:19 +0000 (11:44 +0300)]
opensm libvendor: remove non-existent symbols from the version map

Sponsored by: NVidia networking
MFC after: 1 week

13 months agoopensm libosmcomp: remove non-existent symbols from the version map
Konstantin Belousov [Thu, 3 Aug 2023 08:29:31 +0000 (11:29 +0300)]
opensm libosmcomp: remove non-existent symbols from the version map

Sponsored by: NVidia networking
MFC after: 1 week

13 months agolibrmdacm: rdma_get_local_addr and rdma_get_peer_addr are not exported
Konstantin Belousov [Thu, 3 Aug 2023 08:08:32 +0000 (11:08 +0300)]
librmdacm: rdma_get_local_addr and rdma_get_peer_addr are not exported

they are static inline, remove them from the version script.

Sponsored by: NVidia networking
MFC after: 1 week

13 months agolibrdmacm: remove rsocket symbols from the map file
Konstantin Belousov [Thu, 3 Aug 2023 07:54:09 +0000 (10:54 +0300)]
librdmacm: remove rsocket symbols from the map file

rsocket support was never compiled on FreeBSD at all.

Sponsored by: NVidia networking
MFC after: 1 week

13 months agolibibverbs: remove nonexistent symbols from the linker map
Konstantin Belousov [Tue, 1 Aug 2023 22:56:40 +0000 (01:56 +0300)]
libibverbs: remove nonexistent symbols from the linker map

The function ibv_query_device_ex is static inline, it is not exported
from the dso. With lld 16, which is much more picky about versioning and
undefined symbols, this becomes an error.

The ibv_register_driver driver symbol is explicitly versioned in
sources, it is non-existent in un-versioned object files.

Sponsored by: NVidia networking
MFC after: 1 week

13 months agolibarchive: merge from vendor branch
Martin Matuska [Thu, 3 Aug 2023 23:04:14 +0000 (01:04 +0200)]
libarchive: merge from vendor branch

Changes to not yet connected unzip only.

MFC after: 1 week

13 months agoUpdate vendor/libarchive to libarchive/libarchive@5c5a9f2b7
Martin Matuska [Thu, 3 Aug 2023 22:59:05 +0000 (00:59 +0200)]
Update vendor/libarchive to libarchive/libarchive@5c5a9f2b7

Changes to not yet connected unzip command only.

Obtained from: libarchive
Libarchive commit: 5c5a9f2b76ed51f060752b356c9e96ef3aee1baf

13 months agoshare/man/man7: document libc simd usage in new man page simd(7)
Robert Clausecker [Thu, 3 Aug 2023 22:51:31 +0000 (01:51 +0300)]
share/man/man7: document libc simd usage in new man page simd(7)

This documents SIMD usage in libc for all architectures with
specific details on the new amd64 SIMD dispatch framework.

Sponsored by: The FreeBSD Foundation
Approved by: kib
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40693

13 months agolib/libc/amd64/string/strlen.S: add amd64 baseline kernel
Robert Clausecker [Thu, 3 Aug 2023 22:48:32 +0000 (01:48 +0300)]
lib/libc/amd64/string/strlen.S: add amd64 baseline kernel

This performs very well.  x86-64-v3 and x86-64-v4 kernels were written,
too, but performed worse than the baseline kernel on short strings.
These may be added at a future point in time if the performance issues
can be fixed.

os: FreeBSD
arch: amd64
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
        │ strlen_scalar.out │          strlen_baseline.out          │
        │        B/s        │     B/s       vs base                 │
Short          1.667Gi ± 1%   2.676Gi ± 1%   +60.55% (p=0.000 n=20)
Mid            5.459Gi ± 1%   8.756Gi ± 1%   +60.39% (p=0.000 n=20)
Long           15.34Gi ± 0%   52.27Gi ± 0%  +240.64% (p=0.000 n=20)
geomean        5.188Gi        10.70Gi       +106.24%

Sponsored by: The FreeBSD Foundation
Approved by: kib
Reviewed by: mjg jrtc27
Differential Revision: https://reviews.freebsd.org/D40693

13 months agolib/libc/amd64: add archlevel-based simd dispatch framework
Robert Clausecker [Thu, 3 Aug 2023 22:47:31 +0000 (01:47 +0300)]
lib/libc/amd64: add archlevel-based simd dispatch framework

Add a framework for selecting from one of multiple implementations
of a function based on amd64 architecture level (cf. amd64 SysV
ABI supplement).

Sponsored by: The FreeBSD Foundation
Approved by: kib
Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D40693

13 months agoe1000: Enable TSO for lem(4) and em(4)
Kevin Bowling [Thu, 3 Aug 2023 20:49:15 +0000 (13:49 -0700)]
e1000: Enable TSO for lem(4) and em(4)

Most em(4) devices now enjoy TSO and TSO6, matching NetBSD and Linux
defaults.

A prior commit automasks TSO on 10/100 Ethernet due to errata and other
bugs for IPv6 were fixed recently allowing this.

Mike Karels identified a performance anomaly on Intel 82574L devices.
These are multiqueue enabled on FreeBSD since the conversion to
iflib.  I am investigating whether this can be fixed, in the mean time
MSI-X with checksum offloads remain default.

i219 SPT devices have an errata that downclocks the DMA engine, which
results in TSO not being able to acheive line rate.  Therefore, it is
disabled on:
* Intel(R) I219-LM and I219-V SPT
* Intel(R) I219-LM and I219-V SPT-H (2)
* Intel(R) I219-LM and I219-V LBG (3)
* Intel(R) I219-LM and I219-V SPT (4)
* Intel(R) I219-LM and I219-V SPT (5)

Many lem(4) devices enjoy TSO, exceptions being 82542, 82543, 82547.
TSO6 may be possible for some chipsets but I am still working through
my testing matrix and that is hidden behind hw.em.unsupported_tso.

If you encounter issues, you may disable TSO with for example:
ifconfig em0 -tso -tso6.
I ask to be informed of any deviations from normal operation requiring
this.

Thanks to cc@ for access to emulab.net.

On a sample I219 system it saves about 16% CPU on IPv4 and 19% on IPv6.

iperf3 -Vc reported numbers:
total% user% system%

IPv4 TSO
21.3 7 14.4
21.4 6 15.4
21.5 6 15.5

IPv4 no TSO
36.8 5.4 31.4
38.5 5.1 33.5
38.2 5.7 32.6

IPv4 no TSO no TXCSUM
45.1 5.8 39.3
46 6.3 39.7
46.2 5.9 40.4

IPv6 TSO6
21.7 5.4 16.3
21.6 5.1 16.5
21.9 5.6 16.3

IPv6 no TSO6
41.2 5.2 36
41 5.1 36
40.8 5.2 35.7

IPv6 no TSO6 no TXCSUM6
49 5.9 43.1
48.8 4.9 43.9
49 5.6 43.4

Tested by: cc (lem(4)), karels (82574L)
MFC after: 3 months
Relnotes: yes
Sponsored by: BBOX.io
Differential Revision: https://reviews.freebsd.org/D41170

13 months agoamd64: Bump MAXCPU to 1024 (from 256)
Ed Maste [Fri, 30 Sep 2022 12:14:22 +0000 (08:14 -0400)]
amd64: Bump MAXCPU to 1024 (from 256)

Hardware with more than 256 CPU cores is currently available and will
become increasingly common over FreeBSD 14's lifetime.  Increase MAXCPU
in the amd64 GENERIC kernel configuration to 1024.

Earlier commits increased some related limits.  These prerequisite
commits include at least:

d7ed40243769 Increase MAX_APIC_ID safeguard to 0x800
d1639e43c589 cpuset: increase userland maximum size to 1024

Global and allocated arrays sized by MAXCPU result in excessive bloat
on systems with lower core counts.  In addition, some code used u_char
(8 bits) to hold a CPU index, which is not valid if MAXCPU is greater
than 256.

A number of recent commits addressed these sorts of issues, including
at least:

133935d26f20 pf: atomically increment state ids
74ac712f72cf vmm: Dynamically allocate a couple of per-CPU state save areas
78cfa762ebf2 callout: Move per-CPU callout state into the dpcpu region
42f722e721cd amd64: store pcids pmap data in pcpu zone
9801e7c275f6 smp_topo: dynamically allocate group array
9fb6718d1b18 smp: Dynamically allocate the stoppcbs array
2bb16c635249 x86: retire use of intr_bind

There are some additional allocations still to be converted and
more scalability work is required to make effective use of very high
core count systems, but this change allows us to boot on these systems
and provides a Kernel Binary Interface (KBI) for the FreeBSD 14 release
that supports these configurations.

Special thanks to AMD for providing hardware to test these changes.

PR: 269572
Reviewed by: des
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36838

13 months agoiflib(9): Remove support for cloning pseudo interfaces
Marius Strobl [Thu, 3 Aug 2023 20:23:42 +0000 (22:23 +0200)]
iflib(9): Remove support for cloning pseudo interfaces

This code was used by the first incarnation of wg(4) and is dead ever
since f187d6dfbf633665ba6740fe22742aec60ce02a2 has removed the latter
again. Moreover, this code matched iflib(4) like a square peg fits in
a round hole, was incomplete and despite some hacks still tailored to
VPC and wg(4) but not generic. In effect, this reverts the following:
09f6ff4f1a47c3009dc16fdc609a44f2341bc7ac (w/ its "ancillary changes")
9aeca21324f481f57f2ecb7009f461f4f51b62b3
1f93e931d9f0c688f43f98ef777e04636a325526
0f9544d03e89d180f94a7a84b110ec7d2b6c625a
0dd691b41276ce13d25ffb1443af27f85038aa3f

Reviewed by: erj, kbowling
Differential Revision: <https://reviews.freebsd.org/D41196>

13 months agox86: remove intr_bind
Elliott Mitchell [Fri, 7 Oct 2022 03:23:34 +0000 (20:23 -0700)]
x86: remove intr_bind

`intr_bind(u_int vector, u_char cpu);` looked suspicious since
everywhere else "cpu" is a u_int and >256 processors isn't unreasonable
now.  `intr_bind()` is not used anywhere in FreeBSD (now, after commit
bf42f3738087).  Time to remove.

Relnotes: Yes
Reviewed by: mjg
Differential Revision: https://reviews.freebsd.org/D36901

13 months agox86: retire use of intr_bind
Elliott Mitchell [Fri, 7 Oct 2022 03:23:34 +0000 (20:23 -0700)]
x86: retire use of intr_bind

`intr_bind(u_int vector, u_char cpu);` looked suspicious since
everywhere else "cpu" is a u_int and >256 processors isn't unreasonable
now.

Reviewed by: mjg
Differential Revision: https://reviews.freebsd.org/D36901

13 months agoixv: Separate VFTA table for each interface
Yuichiro Naito [Thu, 3 Aug 2023 20:36:21 +0000 (13:36 -0700)]
ixv: Separate VFTA table for each interface

The vlan setting is independent for each interface. Use VFTA table in
'struct ixgbe_softc' that is already defined.

This pull request fixes following bug scenario.

    create ixv0.10
    create ixv1.10
    destroy ixv1.10
    create ixv0.11
    ixv0.10 no longer receives vlan 10 packets.

In this case, destroying ixv1.10 affects to ixv0.

MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/774

13 months agoem(4): remove reference to CNVi
Kevin Bowling [Thu, 3 Aug 2023 20:26:28 +0000 (13:26 -0700)]
em(4): remove reference to CNVi

I misread the newer PCH datasheet, these are still refered to as PCH.

13 months agoClean up libm use of the __ieee754_ prefix
Steve Kargl [Thu, 3 Aug 2023 19:51:17 +0000 (21:51 +0200)]
Clean up libm use of the __ieee754_ prefix

This removes the __ieee754_ prefix from a number of the math functions.
msun/src/math_private.h contains the statement that

  /*
   * ieee style elementary functions
   *
   * We rename functions here to improve other sources' diffability
   * against fdlibm.
   */
   #define        __ieee754_sqrt  sqrt
   ...

Here, fdlibm refers to https://netlib.org/fdlibm. It is seen from
https://netlib.org/fdlibm/readme that this prefix was used to
differentiate between different standards:

   Wrapper functions will twist the result of the ieee754
   function to comply to the standard specified by the value
   of _LIB_VERSION
      if _LIB_VERSION = _IEEE_, return the ieee754 result;
      if _LIB_VERSION = _SVID_, return SVID result;
      if _LIB_VERSION = _XOPEN_, return XOPEN result;
      if _LIB_VERSION = _POSIX_, return POSIX/ANSI result.
   (These are macros, see fdlibm.h for their definition.)

AFAICT, FreeBSD has never supported these wrappers. In addition, as C99,
principally the long double, functions were added to libm, this
convention was not maintained. Given that only 148 of 324 files under
lib/msun contain a "Copyright (C) 1993 by Sun Microsystems" statement,
the removal of the __ieee754_ prefix provides consistency across all
source files.

The last time someone compared lib/msun to fdlibm appears to be

  commit 3f70824172feb82ea3dcdb3866b54fe0eb7cd890
  Author: David Schultz <das@FreeBSD.org>
  Date:   Fri Feb 4 18:26:06 2005 +0000

  Reduce diffs against vendor source (Sun fdlibm 5.3).

The most recent fdlibm RCS string that appears in a Sun Microsystem
copyrighted file is date "95/01/18". With Oracle Corporation's
acquisition of Sun Microsystems in 2009, it is unlikely that fdlibm will
ever be updated. A search for fdlibm at https://opensource.oracle.com/
yields no hits.

Finally, OpenBSD removed the use of this prefix over 21 years ago. pSee
revision 1.6 of OpenBSD's math_private.h.

Note: this does not drop the __ieee754_ prefix from the trigonometric
argument reduction functions, e.g., __ieee754_rem_pio2. These functions
are internal to the libm and exported through Symbol.map; and thus,
reserved for the implementation.

PR: 272783
MFC after: 1 week

13 months agoem(4): correct a typo
Kevin Bowling [Thu, 3 Aug 2023 19:51:12 +0000 (12:51 -0700)]
em(4): correct a typo

13 months agoem(4): Update and expand on hardware support
Kevin Bowling [Thu, 3 Aug 2023 19:49:42 +0000 (12:49 -0700)]
em(4): Update and expand on hardware support

13 months agoem(4): add link to lem(4)
Kevin Bowling [Thu, 3 Aug 2023 19:49:12 +0000 (12:49 -0700)]
em(4): add link to lem(4)

13 months agoarm64: Comment out some ID registers
Andrew Turner [Thu, 3 Aug 2023 18:02:25 +0000 (19:02 +0100)]
arm64: Comment out some ID registers

Older toolchains don't support reading these registers. Until a fix is
added comment them out.

Reported by: jhb
Sponsored by: Arm Ltd

13 months agoBump __FreeBSD_version to 1400094 for HID KPI changes
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:51 +0000 (19:10 +0300)]
Bump __FreeBSD_version to 1400094 for HID KPI changes

13 months agospibus(4): Add support for ACPI-based children enumeration
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:50 +0000 (19:10 +0300)]
spibus(4): Add support for ACPI-based children enumeration

When spibus is attached as child of Intel SPI controller it scans all
ACPI nodes for "SPI Serial Bus Connection Resource Descriptor" described
in section 19.6.126 of ACPI specs.
If such a descriptor is found, SPI child is added to spibus, it's SPI
chip select, mode, clock, IRQ resource and ACPI handle are added to ivars.
Existing ACPI bus-hosted child is deleted afterwards.
Apple ACPI SPI extensions are supported.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41248

13 months agointelspi: Add support for ddb/kdb -compatible polled mode
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:50 +0000 (19:10 +0300)]
intelspi: Add support for ddb/kdb -compatible polled mode

Required for Apple and Microsoft -compatible HID-over-SPI drivers.

Most logic was already implemented in commit 3c0867343819
"spibus: extend API: add cs_delay ivar, KEEP_CS and NO_SLEEP flags".
It dissallowed driver sleeps in the interrupt context. This commit
extends this feature to handle ddb/kdb context with following:
- Skip driver locking if SPI functions were called from kdb/ddb.
- Reinitialize controller if kdb/ddb initiated SPI transfer has
  interrupted another already running one. Does not work very
  reliable yet.

Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41247

13 months agohidbus(4): Use generic hid methods to start and stop interrupts
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:50 +0000 (19:10 +0300)]
hidbus(4): Use generic hid methods to start and stop interrupts

13 months agohid: Add child device parameter to HID methods
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:50 +0000 (19:10 +0300)]
hid: Add child device parameter to HID methods

Some devices like Apple HID-over-SPI may contain more than one report
descriptors necessitating creation of multiple hidbus children.
Add indentificator of child devices to distinct them.
No functional changes intended.

Differential Revision: https://reviews.freebsd.org/D41246

13 months agointelspi: Release LPSS reset on Sunrise Point controllers.
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:50 +0000 (19:10 +0300)]
intelspi: Release LPSS reset on Sunrise Point controllers.

MacBookPro 14.1 SPI controller requires that to start functioning.

MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41245

13 months agointelspi: Move ACPI/PCI ids table out of header file.
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:50 +0000 (19:10 +0300)]
intelspi: Move ACPI/PCI ids table out of header file.

There is no reason to store it multiple times.

MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41244

13 months agospibus(4): Allow IRQ resource to be released
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:50 +0000 (19:10 +0300)]
spibus(4): Allow IRQ resource to be released

IRQ Resource is allocated on spibus(4). We must release it here too
rather than propagate request down the tree.

Fixes: 4dd8db62e9d3 ("Add IRQ resource to SPIBUS")

MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41243

13 months agointelspi: Add generic resource methods to bus interface
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:50 +0000 (19:10 +0300)]
intelspi: Add generic resource methods to bus interface

That allows intelspi grandchildren to allocate IRQs

MFC after: 1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41242

13 months agointelspi: don't leak spibus on detach.
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:49 +0000 (19:10 +0300)]
intelspi: don't leak spibus on detach.

MFC after:      1 week
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41241

13 months agospibus(4): Skip bus_generic_detach() on device detach
Vladimir Kondratyev [Thu, 3 Aug 2023 16:10:49 +0000 (19:10 +0300)]
spibus(4): Skip bus_generic_detach() on device detach

device_delete_children() detaches all children too.

MFC after: 1 month
Reviewed by: manu
Differential Revision: https://reviews.freebsd.org/D41240

13 months agovm_phys_enqueue_contig: handle npages==0
Doug Moore [Thu, 3 Aug 2023 14:19:48 +0000 (09:19 -0500)]
vm_phys_enqueue_contig: handle npages==0

By letting vm_phys_enqueue_contig handle the case when npages == 0,
the callers can stop checking it, and the compiler can stop
zero-checking with every call to ffs(). Letting vm_phys_enqueue_contig
call vm_phys_enqueue_contig for part of its work also saves a few
bytes.

The amd64 object code shrinks by 128 bytes.

Reviewed by: kib (previous version)
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D41154

13 months agohwpmc_armv7: plug memory leak
Mitchell Horne [Thu, 3 Aug 2023 14:10:26 +0000 (11:10 -0300)]
hwpmc_armv7: plug memory leak

Free allocated per-CPU structures in the pcpu_fini and finalize methods.

While here, add debug trace entries to these methods.

Reviewed by: jkoshy, andrew
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41269

13 months agohwpmc_arm64: plug memory leak
Mitchell Horne [Thu, 3 Aug 2023 14:09:48 +0000 (11:09 -0300)]
hwpmc_arm64: plug memory leak

Free allocated per-CPU structures in the pcpu_fini and finalize methods.

While here, add debug trace entries to these methods.

Reviewed by: jkoshy, andrew
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41268

13 months agosys/README.md: Add a section for documentation
Mitchell Horne [Thu, 3 Aug 2023 13:48:17 +0000 (10:48 -0300)]
sys/README.md: Add a section for documentation

Add web links to intro(9) and the Architecture Handbook.

Reviewed by: lwhsu, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41253

13 months agointro(9): rewrite from scratch
Mitchell Horne [Thu, 3 Aug 2023 13:48:15 +0000 (10:48 -0300)]
intro(9): rewrite from scratch

This page has existed as a placeholder since its creation in 1995. It
does not provide a useful introduction to the content in this section.

Reimagine it as a top-level overview page containing brief descriptions
and links to existing pages in section 9. It is roughly organized into
sub-sections, grouped by topic or subsystem. In other words, the page is
meant to function as a map to other content.

There is a balance to be found here between providing as many links as
possible and keeping the page concise and searchable. In general the aim
is to reference pages which provide the best entry point to a particular
topic. For example, a link is given to locking(9), but not to the
specific lock pages such as mutex(9) or rwlock(9).

NetBSD has done something similar with their intro(9), so some
inspiration has been taken from there, although their content doesn't
align that closely with what we have.

I have done a thorough review of our existing pages and formed these
subsections around them, but they are meant to evolve.

PR: 270481
Reviewed by: imp, emaste
MFC after: 3 weeks
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41104

13 months agog_bio(9): add link to bio(9)
Mitchell Horne [Thu, 3 Aug 2023 13:48:11 +0000 (10:48 -0300)]
g_bio(9): add link to bio(9)

This page documents 'struct bio', so this can be helpful with finding or
referencing it.

Reviewed by: imp, markj
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41252

13 months agonvmecontrol: fix typos
Andrius V [Thu, 3 Aug 2023 10:14:19 +0000 (12:14 +0200)]
nvmecontrol: fix typos

PR: 261911
Reviewed by: kp

13 months agoMFV: xz 5.4.4.
Xin LI [Thu, 3 Aug 2023 07:52:36 +0000 (00:52 -0700)]
MFV: xz 5.4.4.

MFC-after: 2 weeks

13 months agoVendor import of xz 5.4.4 (trimmed)
Xin LI [Thu, 3 Aug 2023 07:42:42 +0000 (00:42 -0700)]
Vendor import of xz 5.4.4 (trimmed)

13 months agoixgbe: Warn once for unsupported SFPs
Kevin Bowling [Thu, 3 Aug 2023 05:59:37 +0000 (22:59 -0700)]
ixgbe: Warn once for unsupported SFPs

The driver belabors the point about unsupported SFPs, printing multiple
times on link up. Limit it to once.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39785

13 months agoe1000: Automask TSO on lem(4)/em(4) 10/100 Ethernet
Kevin Bowling [Thu, 3 Aug 2023 05:47:15 +0000 (22:47 -0700)]
e1000: Automask TSO on lem(4)/em(4) 10/100 Ethernet

This feature masks TSO capability when a link comes up at 10 or 100mbit
due to errata on the chips.  This behavior matches previous versions of
FreeBSD as well as NetBSD and Linux.

A tunable, hw.em.unsupported_tso may be set if the admin desires to
disabling automasking and configure TSO settings manually.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41170

13 months agoFixes for bugs in sinpi/cospi/tanpi
Steve Kargl [Mon, 31 Jul 2023 22:34:48 +0000 (01:34 +0300)]
Fixes for bugs in sinpi/cospi/tanpi

patch to fix half-cycle trigonometric functions

Paul Zimmermann, a MPFR developer, contacted me about large errors in
the half-cycle trigonometric functions.  I've have investigated these
issues and developed the attached patch. The float, double, and ld80
(long double) changes have been tested.

Caveat emptor: The ld128 changes have not been compiled.  The ld128
changes have not been tested.  I do not have access to a system that
uses ld128 floating point.

Here is an itemized list of changes:

* lib/msun/src/math_private.h:
  . Add fast floor macros to compute the integer part of |x| for
    0 <= |x| 01xp(N-1), where N is the precision of the type of x.
    These macros are used in the half-cycle trigonometric functions
    (e.g., sinpi(x)).
  . The FFLOOR80 macros is used with the Intel 80-bit extended double
    functions.  This macors corrects an off-by-one error, which led to
    enormous error for |x| > 0x1p32.

* lib/msun/src/s_cospif.c:
* lib/msun/src/s_cospi.c:
* lib/msun/ld80/s_cospil.c:
  . Update Copyright years.
  . Use FFLOOR*() macro to get integer part of |x|.
  . Correct handle the range 0x1p(N-1) <= |x| < 0x1pN.  Here, one needs
    to determine if the integral value of |x| is even or odd to choose
    +1 or -1.  If |x| >= 0x1pN, always return +1.

* lib/msun/src/s_sinpif.c:
* lib/msun/src/s_sinpi.c:
* lib/msun/ld80/s_sinpil.c:
  . Update Copyright years.
  . Use FFLOOR*() macro to get integer part of |x|.

* lib/msun/src/s_tanpif.c:
* lib/msun/src/s_tanpi.c:
* lib/msun/ld80/s_tanpil.c:
  . Update Copyright years.
  . For +-0.5, return +-inf.  Previously, tanpi[fl]() returned an NaN.
  . Use FFLOOR*() to get integer part of |x|.  Need to determine if the
    integer part is even or odd.  This is used to set +-0 for |x|
integral
    and +-inf for (n+1/2).
  . For 0x1p(N-1) <= |x| < 0x1pN need to determine if x is an even or
odd
    integer to select +0 or -0.  For |x| >= 0x1pN, it is always an even
    integer, select 0.
  . Note, tanpi[fl](x) is an odd function, so one needs to consider
    tanpi[fl](-|x|) = - tanpi[fl](|x|).

* lib/msun/ld128/s_cospil.c:
* lib/msun/ld128/s_sinpil.c:
* lib/msun/ld128/s_tanpil.c:
  . Update Copyright years.
  . These routines use an FFLOOR128 macros, which likely should be
    replaced by a bit twiddling algorithm.
  . The same considerations above are applied to 0x1p112 <= |x| <
0x1p113,
    and |x| >= 0x1p113 cases.
  . Note, even and odd determination used fmodl(x,2.), which is likely
    slow.

PR: 272742
MFC after: 1 week

13 months agoCleanup debugging code in libm
Steve Kargl [Mon, 31 Jul 2023 22:32:54 +0000 (01:32 +0300)]
Cleanup debugging code in libm

David Das (das@) committed Bruce Evan's (bde's) WIP code for
expl() and logl() in git revision 25a4d6bfda29119.  That code
included instrumentation that allowed bde to generate pari
scripts used in testing/debugging.  This patch removes that
instrumentation as it is unlikely that others will ever use it.

* math/libm/msun/src/math_private.h:
  . Remove bde's macros for the generation of pari scripts.

* math/libm/msun/ld128/s_expl.c:
* math/libm/msun/ld128/s_logl.c:
* math/libm/msun/ld80/s_expl.c:
* math/libm/msun/ld80/s_logl.c:
  . Remove bde's DOPRINT_START macro.
  . Change RETURNP to RETURNF.
  . Change RETURN2P to RETURNF.  Adjust arguments as needed.
  . Change RETURNPI to RETURNI.
  . Change RETURN2PI to RETURNI.  Adjust arguments as needed.

PR: 272765
MFC after: 1 week

13 months agoman: fix `man -K` search
Ed Maste [Tue, 1 Aug 2023 18:00:48 +0000 (14:00 -0400)]
man: fix `man -K` search

Quote re arg to grep in case it has spaces, and quote [:blank:] tr arg
to avoid the shell interpreting [].

PR: 272729
Reviewed by: Mina Galić <freebsd@igalic.co>
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41282

13 months agomii: Add the Broadcom BCM54616S ID to the list
Justin Hibbits [Wed, 2 Aug 2023 14:05:21 +0000 (10:05 -0400)]
mii: Add the Broadcom BCM54616S ID to the list

Obtained from: Juniper Networks, Inc.
Sponsored by: Juniper Networks, Inc.

13 months agossh: comment deprecated option handling for retired local patches
Ed Maste [Wed, 2 Aug 2023 14:18:33 +0000 (10:18 -0400)]
ssh: comment deprecated option handling for retired local patches

Older versions of FreeBSD included the HPN patch set and provided
client-side VersionAddendum.  Both of these changes have been retired
but we've retained the option parsing for backwards compatibility to
avoid breaking upgrades.  Add comment references to the relevant
commits.

Sponsored by: The FreeBSD Foundation

13 months agoObsoleteFiles.inc: Add an entry for libdtrace.so.2 in /usr/lib
Mark Johnston [Wed, 2 Aug 2023 13:24:06 +0000 (09:24 -0400)]
ObsoleteFiles.inc: Add an entry for libdtrace.so.2 in /usr/lib

There was a window between commits 4ae699122810 ("dtrace: Add
WITH_DTRACE_ASAN") and 848ff9bc1b97 ("libdtrace: Explicitly set SHLIBDIR
and SHLIB_MAJOR") where libdtrace.so.2 was being installed to /usr/lib
instead of /lib.

13 months agodtrace: Add WITH_DTRACE_ASAN
Domagoj Stolfa [Wed, 2 Aug 2023 00:10:46 +0000 (20:10 -0400)]
dtrace: Add WITH_DTRACE_ASAN

See commit 4ae6991228105eb34989c870194ae7b0a1e23be4.  This version of
the commit avoids inadvertently changing SHLIBDIR for libdtrace.so.

13 months agokdb: Permit a NULL thread credential in kdb_backend_permitted()
Mark Johnston [Tue, 1 Aug 2023 21:58:42 +0000 (17:58 -0400)]
kdb: Permit a NULL thread credential in kdb_backend_permitted()

Early during boot, thread0 runs with td->td_ucred == NULL.  This is
fixed up in proc0_init() at SI_SUB_INTRINSIC.  If a panic occurs before
then, rather than dereference a NULL pointer, simply allow the thread to
enter KDB.

Reported by: stevek
Reviewed by: mhorne, stevek
MFC after: 1 week
Fixes: cab1056105e3 ("kdb: Modify securelevel policy")
Differential Revision: https://reviews.freebsd.org/D41280

13 months agolinux(4): Fix two typos in source code comments
Gordon Bergling [Wed, 2 Aug 2023 09:55:30 +0000 (11:55 +0200)]
linux(4): Fix two typos in source code comments

- s/decriptors/descriptors/

MFC after: 3 days

13 months agoelf(3): Fix a typo in a source code comment
Gordon Bergling [Wed, 2 Aug 2023 09:51:56 +0000 (11:51 +0200)]
elf(3): Fix a typo in a source code comment

- s/speciaal/special/

MFC after: 3 days

13 months agoisp(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 2 Aug 2023 09:48:46 +0000 (11:48 +0200)]
isp(4): Fix a typo in a source code comment

- s/Constatns/Constants/

Obtained from: NetBSD
MFC after: 3 days

13 months agokboot: Fix a typo in a source code comment
Gordon Bergling [Wed, 2 Aug 2023 09:35:50 +0000 (11:35 +0200)]
kboot: Fix a typo in a source code comment

- s/descriptoin/description/

MFC after: 3 days

13 months agoRevert "vm_phys_enqueue_contig: handle npages==0"
Doug Moore [Wed, 2 Aug 2023 09:32:08 +0000 (04:32 -0500)]
Revert "vm_phys_enqueue_contig: handle npages==0"

This reverts commit 1a7fcf6d51eb67ee3e05fdbb806f7e68f9f53c9c.

Peter Holm reported a problem, so I'm reverting now and looking for
the problem later.

13 months agonfsserver: Fix a typo in a source code comment
Gordon Bergling [Wed, 2 Aug 2023 09:27:30 +0000 (11:27 +0200)]
nfsserver: Fix a typo in a source code comment

- s/restared/restarted/

MFC after: 3 days

13 months agocam(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 2 Aug 2023 09:14:53 +0000 (11:14 +0200)]
cam(4): Fix a typo in a source code comment

- s/uppper/upper/

MFC after: 3 days

13 months agousb(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 2 Aug 2023 09:04:24 +0000 (11:04 +0200)]
usb(4): Fix a typo in a source code comment

- s/determin/determine/

MFC after: 3 days

13 months agoarm64: enable kern.conftxt
Kristof Provost [Tue, 1 Aug 2023 15:22:52 +0000 (17:22 +0200)]
arm64: enable kern.conftxt

Match other platforms, include the kernel config in the build.

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

13 months agonetpfil: Fix a typo in a source code comment
Gordon Bergling [Wed, 2 Aug 2023 07:41:29 +0000 (09:41 +0200)]
netpfil: Fix a typo in a source code comment

- s/interprted/interpreted/

MFC after: 3 days

13 months agovnic: Fix a typo in a source code comment
Gordon Bergling [Wed, 2 Aug 2023 07:33:35 +0000 (09:33 +0200)]
vnic: Fix a typo in a source code comment

- s/Enabele/Enable/

MFC after: 3 days

13 months agoaic7xxx: Fix two typos in source code comments
Gordon Bergling [Wed, 2 Aug 2023 07:20:17 +0000 (09:20 +0200)]
aic7xxx: Fix two typos in source code comments

- s/reslection/reselection/

MFC after: 3 days

13 months agopsm(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 2 Aug 2023 07:14:04 +0000 (09:14 +0200)]
psm(4): Fix a typo in a source code comment

- s/diable/disable/

MFC after: 3 days

13 months agoet(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 2 Aug 2023 07:09:56 +0000 (09:09 +0200)]
et(4): Fix a typo in a source code comment

- s/diabled/disabled/

MFC after: 3 days

13 months agovm_phys_enqueue_contig: handle npages==0
Doug Moore [Wed, 2 Aug 2023 03:12:00 +0000 (22:12 -0500)]
vm_phys_enqueue_contig: handle npages==0

By letting vm_phys_enqueue_contig handle the case when npages == 0,
the callers can stop checking it, and the compiler can stop
zero-checking with every call to ffs(). Letting vm_phys_enqueue_contig
call vm_phys_enqueue_contig for part of its work also saves a few
bytes.

The amd64 object code shrinks by 80 bytes.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D41154

13 months agoretire SHARED_TOOLCHAIN knob
Ed Maste [Tue, 1 Aug 2023 12:48:02 +0000 (08:48 -0400)]
retire SHARED_TOOLCHAIN knob

Toolchain components were historically statically linked.  They became
normal dynamically linked executables in commit 6ab18ea64d19.  There is
no need to keep a special case build option for the toolchain; users who
want statically linked toolchain (or any other) components can use the
existing NO_SHARED knob.

Reviewed by: dim, sjg
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41266

13 months agommc_xpt: Update function name in debug trace
John Baldwin [Tue, 1 Aug 2023 23:14:58 +0000 (16:14 -0700)]
mmc_xpt: Update function name in debug trace

Reported by: mav
Fixes: 7eb538974c49 cam mmc_xpt/nvme_xpt: Add _sbuf variants of {an,de}nounce xport and proto ops

13 months agocam: Remove non-sbuf announce/denounce proto and xport ops
John Baldwin [Tue, 1 Aug 2023 22:25:38 +0000 (15:25 -0700)]
cam: Remove non-sbuf announce/denounce proto and xport ops

Reviewed by: mav, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41264

13 months agocam_xpt: Reimplement xpt_*nounce_periph in terms of the _sbuf versions
John Baldwin [Tue, 1 Aug 2023 22:24:36 +0000 (15:24 -0700)]
cam_xpt: Reimplement xpt_*nounce_periph in terms of the _sbuf versions

Use an sbuf that drains to printf to avoid duplicating code in the two
versions of each function.

Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41263

13 months agocam_xpt: Remove fallbacks for non-sbuf protocol methods
John Baldwin [Tue, 1 Aug 2023 22:24:10 +0000 (15:24 -0700)]
cam_xpt: Remove fallbacks for non-sbuf protocol methods

This includes removing the kern.cam.announce_nosbuf sysctl.

Reviewed by: mav, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41262

13 months agocam mmc_xpt/nvme_xpt: Add _sbuf variants of {an,de}nounce xport and proto ops
John Baldwin [Tue, 1 Aug 2023 22:23:25 +0000 (15:23 -0700)]
cam mmc_xpt/nvme_xpt: Add _sbuf variants of {an,de}nounce xport and proto ops

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41261

13 months agommc_xpt: Remove dubious end of mmc_print_ident
John Baldwin [Tue, 1 Aug 2023 22:20:53 +0000 (15:20 -0700)]
mmc_xpt: Remove dubious end of mmc_print_ident

The end of this function finishes the passed in sbuf, calls printf
manually on the contents, and then clears it.  The caller then tries
to print the resulting sbuf.  This works currently but will not work
for future callers that pass in an external sbuf to be appended to.

Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41260

13 months agocam xpt_*nounce_periph*: Various fixes for periphs without a protocol
John Baldwin [Tue, 1 Aug 2023 22:20:25 +0000 (15:20 -0700)]
cam xpt_*nounce_periph*: Various fixes for periphs without a protocol

If the periph doesn't have a valid protocol, these routines emit
fallback messages.  However, the fallback messages duplicated the
periph name and unit number, and in the case of *denounce* included a
spurious newline.

Reviewed by: mav, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41177