]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
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

13 months agocam/nvme: Remove spurious newline during periph detach announcement
John Baldwin [Tue, 1 Aug 2023 22:19:50 +0000 (15:19 -0700)]
cam/nvme: Remove spurious newline during periph detach announcement

Other protocol denounce routines use a "short" variant of announce
that does not include a trailing newline.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D41176

13 months agoamdsmn(4), amdtemp(4): add support for Zen 4
Akio Morita [Tue, 1 Aug 2023 20:32:12 +0000 (22:32 +0200)]
amdsmn(4), amdtemp(4): add support for Zen 4

Zen 4 support, tested on Ryzen 9 7900

Reviewed by: imp (previous version), mhorne
Approved by: mhorne
Obtained from: http://jyurai.ddo.jp/~amorita/diary/?date=20221102#p01
Differential Revision: https://reviews.freebsd.org/D41049

13 months agobuild.7: Document several toolchain make variables.
John Baldwin [Tue, 1 Aug 2023 21:01:58 +0000 (14:01 -0700)]
build.7: Document several toolchain make variables.

Document CROSS_TOOLCHAIN, UNIVERSE_TOOLCHAIN, and USE_GCC_TOOLCHAINS.

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

13 months agoMakefile.inc1: Enable requesting the universe toolchain.
John Baldwin [Tue, 1 Aug 2023 21:01:57 +0000 (14:01 -0700)]
Makefile.inc1: Enable requesting the universe toolchain.

make universe builds a cross toolchain under HOST_OBJTMP/tmp via the
universe-toolchain target.  However, doing a plain 'make buildworld'
after a universe/tinderbox run (e.g. to reproduce a failure and test
the fix for it), will try to build a new cross toolchain under
OBJTMP/tmp which can be tedious.  This commit adds a make variable
(UNIVERSE_TOOLCHAIN) which can be used similar to CROSS_TOOLCHAIN to
request an external toolchain.  If this variable is set (value doesn't
matter), the the universe toolchain is used as an external toolchain.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D40777

13 months agocam: Log more error codes
Warner Losh [Tue, 1 Aug 2023 20:51:10 +0000 (14:51 -0600)]
cam: Log more error codes

Log CAM_DEV_NOT_THERE status CCBs because they get dropped if a drive
disappears and these requests timeout or are cancelled. It's useful to
know the outstanding commands for failure analysis. Log
CAM_NVME_STATUS_ERROR status CCBs to bring in NVMe errors (this will be
more important in future commits that expand the information logged).

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D41168

13 months agotests: Add MAP_32BIT flag test
Dmitry Chagin [Tue, 1 Aug 2023 20:23:15 +0000 (23:23 +0300)]
tests: Add MAP_32BIT flag test

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D41236
MFC after: 1 month

13 months agoSupport background fsck_ffs(8) on filesystems using journaled soft updates
Kirk McKusick [Tue, 1 Aug 2023 20:16:11 +0000 (13:16 -0700)]
Support background fsck_ffs(8) on filesystems using journaled soft updates

An earlier addition of code to fsck_ffs(8) allowed it to support
snapshots when running with journalled soft updates. Further
functionality has now been added to fsck_ffs(8) to allow it to use
snapshots to run in background on live filesystems running with
journaled soft updates. This commit enables the use of this functionality.

Tested-by: Peter Holm
Sponsored-by: The FreeBSD Foundation
MFC-after:    2 weeks

13 months agofrag6: Avoid a possible integer overflow in fragment handling
Jonathan T. Looney [Tue, 1 Aug 2023 14:58:34 +0000 (10:58 -0400)]
frag6: Avoid a possible integer overflow in fragment handling

Reviewed by: kp, markj, bz
Approved by: so
Security: FreeBSD-SA-23:06.ipv6
Security: CVE-2023-3107

13 months agobhyve: Fully reset the fwctl state machine if the guest requests a reset.
John Baldwin [Thu, 29 Jun 2023 18:27:12 +0000 (11:27 -0700)]
bhyve: Fully reset the fwctl state machine if the guest requests a reset.

If a guest tries to reset the fwctl device while a pending request was
in flight, the fwctl state machine can be left in an incomplete state.
Specifically, rinfo is not cleared.

Normally the state machine for fwctl alternates between REQ (receiving
request) and RESP (sending response) and ignores port writes while in
RESP or port reads while in REQ.  Once a guest completes the writes to
the port to send a request, the state machine transitions to RESP and
ignores future writes.

However, if a guest writes a full request and then resets the fwctl
device, the state would transition to REQ without draining the pending
response or discarding the received request.  Instead, additional
port writes after the reset were treated as new payload bytes, but
were appended to the previously-received request and could overflow
the fget_str buffer.

To fix, fully reset the fwctl state machine if the guest requests a
reset.

admbugs: 998
Approved by: so
Reviewed by: markj
Reported by: Omri Ben Bassat <t-benbassato@microsoft.com>
Security: FreeBSD-SA-23:07.bhyve
Security: CVE-2023-3494

13 months agodtrace: remove dead code for PR_REQUESTED
Eric van Gyzen [Thu, 27 Jul 2023 22:06:33 +0000 (17:06 -0500)]
dtrace: remove dead code for PR_REQUESTED

libproc's PR_REQUESTED is not implemented on FreeBSD.  Remove dead code
in dtrace that would handle it.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D41225

13 months agoproc_detach: use ptrace(PT_KILL) to kill the tracee
Eric van Gyzen [Tue, 25 Jul 2023 16:58:11 +0000 (11:58 -0500)]
proc_detach: use ptrace(PT_KILL) to kill the tracee

When MFC'ing commit dad11f990e2 to stable/12, the child would dump core
when dtrace exited.  It was getting SIGTRAP, even though proc_detach
sent a SIGKILL.  I could not find the reason for this difference in
behavior from main (and stable/13).  The present change, however, works
as expected, probably due the proc_wkilled special case in kern_ptrace.
It also seems like a more obvious approach.

While I'm here, fix two other issues in the previous code:

It would SIGKILL a tracee even in read-only mode.

It would SIGSTOP/SIGCONT the tracee if ptrace succeeded but errno happened
to be EBUSY for some other reason.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D41122

13 months agodtrace: do not overload libproc flags
Eric van Gyzen [Tue, 25 Jul 2023 16:59:07 +0000 (11:59 -0500)]
dtrace: do not overload libproc flags

dtrace stored its PR_RLC and PR_KLC flags in the proc_handle's flags,
where they collided with PATTACH_FORCE and PATTACH_RDONLY, respectively.
Thus, Psetflags(PR_KLC) effectively also set the PATTACH_RDONLY flag.

Since the flags are private to dtrace (at least on FreeBSD), store them in
dtrace's own dt_proc structure instead.

On FreeBSD, either PR_RLC or PR_KLC was always set, so remove code that
would handle the case where neither was set.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D41121

13 months agodtrace: remove illumos code from dt_proc.c
Eric van Gyzen [Tue, 25 Jul 2023 16:58:47 +0000 (11:58 -0500)]
dtrace: remove illumos code from dt_proc.c

The illumos #ifdef's in this file make it harder to read and maintain.
There is little change upstream, and increasing changes for FreeBSD.
Remove the illumos code with `unifdef`.  The only manual changes here
are the #includes and #defines at the top, and removing blank lines.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D41173

13 months agoinet.3: remove mention of VAX endianness
Ed Maste [Tue, 1 Aug 2023 17:20:12 +0000 (13:20 -0400)]
inet.3: remove mention of VAX endianness

Machine endianness is not very important in understanding the inet*
functions; the endianness of the VAX is especially so.

PR: 272728
Sponsored by: The FreeBSD Foundation

13 months agodtrace: Revert the addition of WITH_DTRACE_ASAN
Mark Johnston [Tue, 1 Aug 2023 17:01:37 +0000 (13:01 -0400)]
dtrace: Revert the addition of WITH_DTRACE_ASAN

The follow-up fix triggers a lib32 build failure, revert everything
until the problem is addressed.

13 months agosrc.conf.5: regen after armv6 demotion
Ed Maste [Tue, 1 Aug 2023 15:19:37 +0000 (11:19 -0400)]
src.conf.5: regen after armv6 demotion

Fixes: 98d03dca9ac8 ("universe: Demote armv6 to an extra architecture.")
Sponsored by: The FreeBSD Foundation

13 months agofilemon(4): Better error checking in code example
Pau Amma [Tue, 1 Aug 2023 14:24:44 +0000 (11:24 -0300)]
filemon(4): Better error checking in code example

Discussed with: dim
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38367

13 months agolibdtrace: Explicitly set SHLIBDIR and SHLIB_MAJOR
Mark Johnston [Tue, 1 Aug 2023 14:11:23 +0000 (10:11 -0400)]
libdtrace: Explicitly set SHLIBDIR and SHLIB_MAJOR

They were previously being defined by cddl/lib/Makefile.inc, and as of
commit 4ae699122810 were being overridden by defaults in bsd.own.mk,
which changed SHLIBDIR to /usr/lib.

Reported by: Domagoj Stolfa <ds815@cam.ac.uk>
Fixes: 4ae699122810 ("dtrace: Add WITH_DTRACE_ASAN")

13 months agovm_map: Add a macro to fetch a map entry's split boundary index
Mark Johnston [Tue, 9 May 2023 14:07:15 +0000 (10:07 -0400)]
vm_map: Add a macro to fetch a map entry's split boundary index

The resulting code is a bit more concise.  No functional change
intended.

Reviewed by: alc, dougm, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41249

13 months agosk(4): Fix a typo in a source code comment
Gordon Bergling [Tue, 1 Aug 2023 05:50:45 +0000 (07:50 +0200)]
sk(4): Fix a typo in a source code comment

- s/nomral/normal/

MFC after: 3 days

13 months agoisa_common: find next bit faster
Doug Moore [Tue, 1 Aug 2023 02:02:56 +0000 (21:02 -0500)]
isa_common: find next bit faster

Since ffs is no longer implemented with a linear search, find_next_bit
can work in constant time, with masking.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D41251

13 months agocd9660: do not leak buffers in cd9660_rrip_loop()
Konstantin Belousov [Mon, 31 Jul 2023 22:55:13 +0000 (01:55 +0300)]
cd9660: do not leak buffers in cd9660_rrip_loop()

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

13 months agomemdesc: Add routines for copying data to/from memory descriptors
John Baldwin [Mon, 31 Jul 2023 20:24:44 +0000 (13:24 -0700)]
memdesc: Add routines for copying data to/from memory descriptors

These are modeled on the API used for m_copydata/m_copyback and the
crypto buffer APIs.  One day it might be nice to reduce the
proliferation of these by adding cursors and using memdesc directly
for crypto request buffers.

Reviewed by: markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D40615

13 months agogsb_crc32: Fix a warning when compiled in userland.
John Baldwin [Mon, 31 Jul 2023 20:24:18 +0000 (13:24 -0700)]
gsb_crc32: Fix a warning when compiled in userland.

crc32_tab[] is only exposed as a global in <sys/gsb_crc32.h> for the
kernel, not for userland.

Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D40614

13 months agoDelete i386 support since I dont have a i386 system to rescue and test.
Michael Reifenberger [Mon, 31 Jul 2023 18:26:14 +0000 (20:26 +0200)]
Delete i386 support since I dont have a i386 system to rescue and test.

13 months agotools/build: Work around broken Clang FreeBSD resource dir logic pre-13
Jessica Clarke [Mon, 31 Jul 2023 17:28:08 +0000 (18:28 +0100)]
tools/build: Work around broken Clang FreeBSD resource dir logic pre-13

Prior to Clang 13 (e.g. in the Clang 11 present in 13.0-RELEASE), the
resource directory logic for FreeBSD was broken and would not resolve
symlinks, meaning symlinks would only work if in a directory next to the
containing lib directory. Therefore we cannot even use a symlink for
worldtmp, we have to make a wrapper script that execs the real binary
via an absolute path.

Reported by: markj
Reviewed by: markj
Fixes: 65f28f63a73d ("tools/build: Create toolchain symlinks for non-absolute compiler/linker")
Differential Revision: https://reviews.freebsd.org/D41238

13 months agoe1000: Fix lem(4)/em(4) TSO6
Kevin Bowling [Mon, 31 Jul 2023 15:16:24 +0000 (08:16 -0700)]
e1000: Fix lem(4)/em(4) TSO6

* Fix TSO6 by specializing IP checksum insertion and following Intel SDM
  values for IPv6.
* Remove unnecessary 82544 IP-bit handling
* Remove TSO6 from lem(4) capabilitities

Reviewed by: erj (earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41170

13 months agoggate tests: Serialize
Mark Johnston [Tue, 20 Jun 2023 13:09:52 +0000 (09:09 -0400)]
ggate tests: Serialize

13 months agogmirror tests: Serialize
Mark Johnston [Tue, 20 Jun 2023 13:05:53 +0000 (09:05 -0400)]
gmirror tests: Serialize