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

11 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

11 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

11 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

11 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.

11 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

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

11 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

11 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)

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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)

11 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

11 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

11 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

11 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

11 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

11 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.

11 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

11 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.

11 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.

11 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

11 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

11 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

11 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

11 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

11 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.

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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

11 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.

11 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

11 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

11 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")

11 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

11 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

11 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

11 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

11 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

11 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

11 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.

11 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

11 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

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

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

11 months agodhclient tests: Serialize pcp tests
Mark Johnston [Tue, 20 Jun 2023 13:04:07 +0000 (09:04 -0400)]
dhclient tests: Serialize pcp tests

11 months agoxargs tests: Disable the test added in commit eab91d008165
Mark Johnston [Mon, 31 Jul 2023 14:44:32 +0000 (10:44 -0400)]
xargs tests: Disable the test added in commit eab91d008165

This test has been triggering OOM kills in CI runs since it triggers an
allocation of 16GB.  Temporarily disable the test until the problem is
solved one way or another.

11 months agonvme(4): detect S3X NVMe controller in 2016-2017 MacBooks
Vladimir Kondratyev [Mon, 31 Jul 2023 14:33:14 +0000 (17:33 +0300)]
nvme(4): detect S3X NVMe controller in 2016-2017 MacBooks

Adds support for detection of the S3X NVMe controller found in the
13" MacBook Pro 2017 without Touch Bar (MacBook14,1)
It is known to be used in following MacBooks:
- Retina MacBook 2016 (MacBook9,1)
- 13" MacBook Pro 2016 without Touch Bar (MacBook13,1)
- 13" MacBook Pro 2016 with Touch Bar (MacBook13,2)

11 months agointelspi(4): Add missing driver mutex unlock in NO_SLEEP mode
Vladimir Kondratyev [Mon, 31 Jul 2023 14:30:24 +0000 (17:30 +0300)]
intelspi(4): Add missing driver mutex unlock in NO_SLEEP mode

Fixes: 1f40866feb21 ("intelspi: add PCI attachment (Lynx/Wildcat/Sunrise Point)")
MFC after: 1 week

11 months agolibarchive: merge from vendor branch
Martin Matuska [Mon, 31 Jul 2023 11:13:30 +0000 (13:13 +0200)]
libarchive: merge from vendor branch

Changes to not yet connected unzip only.

MFC after: 1 week

11 months agoUpdate vendor/libarchive to libarchive/libarchive@27ca5119f
Martin Matuska [Mon, 31 Jul 2023 11:09:09 +0000 (13:09 +0200)]
Update vendor/libarchive to libarchive/libarchive@27ca5119f

Changes to not yet connected unzip command only.

Obtained from: libarchive
Libarchive commit: 27ca5119f754d2d359a3cf4ac66c6672260a74d3

11 months agostress2: Added killpg(2) scenarios
Peter Holm [Mon, 31 Jul 2023 07:07:06 +0000 (09:07 +0200)]
stress2: Added killpg(2) scenarios

11 months agoradix_tree: compute slot from keybarr
Doug Moore [Sun, 30 Jul 2023 20:12:06 +0000 (15:12 -0500)]
radix_tree: compute slot from keybarr

The computation of keybarr(), the function that determines when a
search has failed at a non-leaf node, can be done in a way that
computes the 'slot' value when keybarr() fails, which is exactly when
slot() would next be invoked. Computing things this way saves space in
search loops.

This reduces the amd64 coding of the search loop in vm_radix_lookup
from 40 bytes to 28 bytes.

Reviewed by: alc
Tested by: pho (as part of a larger change)
Differential Revision: https://reviews.freebsd.org/D41235