FreeBSD/src 52b7cbcsys/netinet tcp_timer.c

tcp: improve handling of stopped timers

When a TCP timer is stopped, t_timers[] is set to SBT_MAX. Adding the
corresponding t_precisions[], if it is not zero, would result in
overflows in tcp_timer_next(). To avoid this, skip stopped timers.

The problem was identified while debugging uperf by Lukas Book and
an initial patch was provided by him. The committed patch was
suggested by glebius.

The problem can be observed by running netstat -nxptcp and looking for
negative timer values and by observing very long running timers in
some cases.

Reported by:            Lukas Book <lkbook at outlook.de>
Reviewed by:            glebius
Differential Revision:  https://reviews.freebsd.org/D58484
DeltaFile
+2-0sys/netinet/tcp_timer.c
+2-01 files

FreeBSD/src 2e259c2sys/kern kern_exit.c

kern_pdwait(): print the process pointer through pd

to avoid using uninitialized value in the KASSERT() statement on the first
iteration.

Also, do the assert under the proctree_lock, which is not critical but
satisfies the invariants.

Noted and reviewed by:  markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58505
DeltaFile
+2-2sys/kern/kern_exit.c
+2-21 files

FreeBSD/src 8cef3c9sys/kern kern_exit.c

proc_realparent(): assert that an orphaned child has real parent != parent

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D58504
DeltaFile
+3-0sys/kern/kern_exit.c
+3-01 files

FreeBSD/src ce6ab51usr.sbin/pmc Makefile cmd_pmc.h

pmc: enable the new pmc commands

This change hooks everything up to the pmc command and improves the
usage to document all functions.  There are a couple older commands that
are currently broken that I have hidden from the usage, but left in the
code for those using it.  I won't remove those until we have our
replacements upstreamed that depend on the AMD PMC multiplexing patches.

Sponsored by: Netflix
Reviewed by:    adrian, imp
Differential Revision:  https://reviews.freebsd.org/D57780
DeltaFile
+37-15usr.sbin/pmc/pmc.c
+5-2usr.sbin/pmc/cmd_pmc.h
+4-2usr.sbin/pmc/Makefile
+46-193 files

FreeBSD/src 3adde0eusr.sbin/pmc cmd_pmc_info.cc

pmc: pmc info command

Prints the log header including machine, cpu and kernel details along
with what counters were selected.

Sponsored by: Netflix
Reviewed by:    adrian, imp
Differential Revision:  https://reviews.freebsd.org/D57778
DeltaFile
+186-0usr.sbin/pmc/cmd_pmc_info.cc
+186-01 files

FreeBSD/src cc94d1busr.sbin/pmc cmd_pmc_frontend.cc

pmc: pmc frontend stall analysis based on IBS

The frontend command uses AMD IBS frontend events to analyze the major
sources of frontend stalls.  It displays a table breakind down the major
causes of front end stalls.  This is a simple demonstration of the tools
as you can use the filtering tools to limit the analysis to a subset of
the samples including filtering by fetch latencies.

Sponsored by: Netflix
Reviewed by:    adrian, imp
Differential Revision:  https://reviews.freebsd.org/D57779
DeltaFile
+242-0usr.sbin/pmc/cmd_pmc_frontend.cc
+242-01 files

FreeBSD/src a79a051usr.sbin/pmc headers.hh cmd_pmc_record.cc

pmc: pmc record command

The record command is designed around the idea of predefined studies.
While you can still select individual counters, the predefined studies
are meant to enable the best hardware options for a given generation.
It implements all of the base studies that I have built so far.

Sponsored by: Netflix
Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57777
DeltaFile
+750-0usr.sbin/pmc/cmd_pmc_record.cc
+1-0usr.sbin/pmc/headers.hh
+751-02 files

FreeBSD/src 93da997usr.sbin/pmc util.hh headers.hh

pmc: new pmc log processing framework

View is a class for building PMC log processing tools it is designed to
work with the new PMC record command that adds a header with additional
CPU information.  The new framework processes PMC logs about 2.5 times
faster and in about half the code as libpmcstat.

Sponsored by: Netflix
Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D57776
DeltaFile
+960-0usr.sbin/pmc/view.cc
+411-0usr.sbin/pmc/view.hh
+82-0usr.sbin/pmc/headers.hh
+82-0usr.sbin/pmc/util.cc
+39-0usr.sbin/pmc/util.hh
+1,574-05 files

FreeBSD/src a53d2e4usr.sbin/pmc display.hh display.cc

pmc: console configuration and table rendering for new PMC tools

Initializes the terminal rendering code used by the new pmc tools.  Then
provides a table abstraction for collecting, sorting and rendering
tables.  It provides pretty printed results with typed fields that print
several types used throughout the new PMC tools.  By default the fields
are formatted in engineering notation.

Sponsored by: Netflix
Reviewed by:    adrian, imp
Differential Revision:  https://reviews.freebsd.org/D57775
DeltaFile
+571-0usr.sbin/pmc/display.cc
+105-0usr.sbin/pmc/display.hh
+676-02 files

FreeBSD/src 285c749sys/dev/e1000 igb_txrx.c em_txrx.c

e1000: report UDP RSS hash type on igb/em

{em,igb}_determine_rsstype() mapped only the TCP and bare-IP RSS descriptor
types; the UDP types returned M_HASHTYPE_NONE.
The hardware does hash UDP, but with a NONE hashtype iflib skips its
flowid-based TX queue spread, so all forwarded UDP egressed on a single queue
and serialized transmit on one core.

Add the three UDP cases (IPV4_UDP, IPV6_UDP, IPV6_UDP_EX) so egress spreads
across all TX queues.

Reviewed by:    kbowling, gallatin
Approved by:    kbowling
MFC after:      1 week
MFC to:         stable/14, stable/15
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D58513
DeltaFile
+6-0sys/dev/e1000/igb_txrx.c
+6-0sys/dev/e1000/em_txrx.c
+12-02 files

FreeBSD/src 6c4d9b9sys/dev/hwpmc hwpmc_amd.c

hwpmc: fix event allocation on pre-Zen AMD CPUs

amd_allocate_pmc() chose the pmu-events code path whenever pmc_cpuid was
non-empty, and rejected any allocation lacking PMC_F_EV_PMU.
But pmc_cpuid is set for every AMD CPU, while the pmu-events tables only cover
Zen and later.
On older families (K8, Bobcat, Jaguar/16h, Bulldozer) libpmc finds no
pmu-events entry and falls back to the legacy path, which never sets
PMC_F_EV_PMU.

Reviewed by:    mhorne
Approved by:    mhorne
MFC after:      1 week
MFC to:         stable/14, stable/15
Sponsored by:   Netflix
Differential Revision:  https://reviews.freebsd.org/D58468
DeltaFile
+2-4sys/dev/hwpmc/hwpmc_amd.c
+2-41 files

FreeBSD/src f884e82sys/netinet6 ip6_input.c in6.h

netinet6: Tear down IPv6 source address selection policies with rest of IPv6.

This may plug minor leaks which no-one has reported. The default IPv6 source
address selection policy list in FreeBSD is usually limited to 9 entries,
and can be readily inspected with ip6addrctl(8). The policy table is
however instantiated for each VNET.

The leak of a pol instance in delete_addrsel_policyent() was already
plugged by @ae in commit-id ecc5c73, so that change has not been merged.

Do not tear down the sxlocks as glebius has requested, and move the
addrsel_policyent{} declarations further up to avoid redundant forward
declarations as glebius requested for stylistic reasons.

Reviewed by:    ae, pouria
Sponsored by:   Cisco Systems, Inc.
Differential Revision: https://reviews.freebsd.org/D55599
DeltaFile
+28-16sys/netinet6/in6_src.c
+1-0sys/netinet6/ip6_input.c
+1-0sys/netinet6/in6.h
+30-163 files

FreeBSD/src f7c08d8crypto/openssh servconf.h

openssh: Move back UseBlocklist to global config

Revert UseBlocklist from SSHCFG_ALL to SSHCFG_GLOBAL (with
SSHCFG_COPY_NONE), ensuring it can only be set globally in sshd_config
rather than within conditional Match blocks, matching historical
behavior.

Reviewed by:    emaste
Fixes:          bb5c77e9d281 ("OpenSSH: Update to 10.4p1")
Differential Revision:  https://reviews.freebsd.org/D58520
DeltaFile
+1-1crypto/openssh/servconf.h
+1-11 files

FreeBSD/src e35696flib/msun Symbol.map, lib/msun/man sqrt.3

[libm] implementation of rsqrt, rsqrtf, and rsqrtl

PR:     295089

(cherry picked from commit 3085fc9d97bd83785ba3ba43e0378d7d67987d1f)
(cherry picked from commit 0093bb670537f19e99fff2d46b4831d7b9d44b4c)
DeltaFile
+203-0lib/msun/src/s_rsqrtl.c
+155-0lib/msun/src/s_rsqrtf.c
+153-0lib/msun/src/s_rsqrt.c
+83-0lib/msun/src/math_private.h
+51-4lib/msun/man/sqrt.3
+7-0lib/msun/Symbol.map
+652-42 files not shown
+658-78 files

FreeBSD/src 3cdf314lib/libc Versions.def

lib/libc: add FBSD-1.9 to Versions.def

(cherry picked from commit 969c1191957a9ad689546ddb4e8c4df2217c5052)
(cherry picked from commit 36b12ea1fbfb218806751c1befd52ac14c46b2f0)
DeltaFile
+5-1lib/libc/Versions.def
+5-11 files

FreeBSD/src 69b3aa3lib/msun/src math.h

msun: expose the C23 functions we already support in <math.h>

This is the *pi family of trigonometric functions. Quite a few C23
functions are still missing.  These seem to be:
acospi, acospif, acospil, asinpi, asinpif, asinpil, atan2pi, atan2pif,
atan2pil, atanpi, atanpif, atanpil, canonicalize, canonicalizef,
canonicalizel, compoundn, compoundnf, compoundnl, daddl, ddivl, dfmal,
dmull, dsqrtl, dsubl, exp10, exp10f, exp10l, exp10m1, exp10m1f,
exp10m1l, exp2m1, exp2m1f, exp2m1l, fadd, faddl, fdiv, fdivl, ffma,
ffmal, fmaximum, fmaximum_mag, fmaximum_mag_num, fmaximum_mag_numf,
fmaximum_mag_numl, fmaximum_magf, fmaximum_magl, fmaximum_num,
fmaximum_numf, fmaximum_numl, fmaximumf, fmaximuml, fminimum,
fminimum_mag, fminimum_mag_num, fminimum_mag_numf, fminimum_mag_numl,
fminimum_magf, fminimum_magl, fminimum_num, fminimum_numf,
fminimum_numl, fminimumf, fminimuml, fmul, fmull, fromfp, fromfpf,
fromfpl, fromfpx, fromfpxf, fromfpxl, fsqrt, fsqrtl, fsub, fsubl,
iscanonical, iseqsig, issignaling, issubnormal, iszero, nextdown,
nextdownf, nextdownl, nextup, nextupf, nextupl, pown, pownf, pownl,
powr, powrf, powrl, rootf, rootl, rootn, roundeven, roundevenf,

    [11 lines not shown]
DeltaFile
+4-1lib/msun/src/math.h
+4-11 files

FreeBSD/src 53187a3sys/dev/hwpmc pmu_dmc620.c

pmc_dmc620: drop unneeded includes

Neither of these options are checked in the file and cdefs.h should not
be included explicitly. No functional change.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+0-4sys/dev/hwpmc/pmu_dmc620.c
+0-41 files

FreeBSD/src 3fdd05clib/libpmc Makefile pmc.3

libpmc: userland support and pmc.rapl.3 for the RAPL class

Register PMC_CLASS_RAPL in libpmc: event table, allocator, class-table
descriptor, and the event-name/class-listing lookups, all x86-guarded
and modeled on the TSC class. Energy events are read-only and
unqualified. The class prefix (RAPL-) supplies the friendly spelling, so
pmcstat -S rapl-energy-pkg resolves to the canonical ENERGY_PKG event.

Add a pmc.rapl.3 manual page documenting the events, counter scope, the
microjoule unit and wrap handling, and the NUMA/package domain mapping;
link it from pmc.3.

Reviewed by:    mhorne
Discussed with: Ali Mashtizadeh <ali at mashtizadeh.com>
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D58029
DeltaFile
+138-0lib/libpmc/pmc.rapl.3
+35-0lib/libpmc/libpmc.c
+8-0lib/libpmc/pmc.3
+1-0lib/libpmc/Makefile
+182-04 files

FreeBSD/src a99d04fsys/dev/hwpmc hwpmc_intel.c pmc_events.h, sys/sys pmc.h

hwpmc: add RAPL energy-counter class (AMD + Intel)

Add hwpmc_rapl.c/.h implementing PMC_CLASS_RAPL, a read-only
system-scope class modeled on TSC and wired into x86 AMD and Intel MD
init. A per-vendor MSR table covers AMD/Hygon and Intel; energy is
reported in microjoules, with the Intel server 2^-16 J DRAM unit
handled and 32-bit wraps recovered into a 64-bit accumulator.

The overflow guard follows the PMC lifetime: armed on the first
allocated PMC, callout_drain()d on the last release, and each tick only
rendezvouses CPUs holding one. Per-CPU spin locks guard the accumulator
against torn reads on i386. PMC_CAP_DOMWIDE lets pmcstat(8) allocate
one counter per NUMA domain instead of per CPU.

Reviewed by:    mhorne, Ali Mashtizadeh <ali at mashtizadeh.com>
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D58028
DeltaFile
+612-0sys/dev/hwpmc/hwpmc_rapl.c
+28-0sys/dev/hwpmc/hwpmc_rapl.h
+13-4sys/dev/hwpmc/hwpmc_amd.c
+13-1sys/dev/hwpmc/pmc_events.h
+9-0sys/dev/hwpmc/hwpmc_intel.c
+4-3sys/sys/pmc.h
+679-84 files not shown
+683-810 files

FreeBSD/src 77404eesys/x86/include specialreg.h

x86: add AMD RAPL MSR definitions to specialreg.h

specialreg.h is the tree's MSR registry and already carries the Intel
RAPL group. Add the AMD RAPL package/core energy and unit MSRs here so
the hwpmc RAPL class can reference them without a private driver copy.
Use the names Linux's msr-index.h gives these registers.

Reviewed by:    mhorne, adrian, Ali Mashtizadeh <ali at mashtizadeh.com>
MFC after:      3 days
Sponsored by:   AMD
Differential Revision:  https://reviews.freebsd.org/D58027
DeltaFile
+3-0sys/x86/include/specialreg.h
+3-01 files

FreeBSD/src cac0eabsys/modules/hwpmc Makefile

sys/modules/hwpmc/Makefile: tidy up

This module has several source files, with many conditional on the
platform architecture. Make it easier to read, and better for future
diffs against these lists.

- Convert to one SRC per line
- Simplify arm/armv7 condition
- Remove now-empty header comment
- Minor formatting

MFC after:      1 week
Sponsored by:   The FreeBSD Foundation
DeltaFile
+38-27sys/modules/hwpmc/Makefile
+38-271 files

FreeBSD/src d6dcd8dlib/libsysdecode mktables

libsysdecode: fix nlm_flag regex in mktables

Some NLM_F_ definitions contain multiple underscores in their name; this
should pick them up.

Reviewed by:    kp, Ishan Agrawal <iagrawal9990 at gmail.com>
Fixes:  4c932a4d45fb ("netlink: decode netlink message flags symbolically")
Sponsored by:   The FreeBSD Foundation
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2340
DeltaFile
+1-1lib/libsysdecode/mktables
+1-11 files

FreeBSD/src 031d15dsys/conf files, sys/modules Makefile

aq(4): Add build infrastructure

Reviewed by:    adrian
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53839

(cherry picked from commit 75177aebf0397af36b1f28f6b6e64207ec3d8188)
(cherry picked from commit 7f3da1f800f77150fab2a07ce9cafdca41b29ee9)
DeltaFile
+12-0sys/modules/aq/Makefile
+11-0sys/conf/files
+2-0sys/modules/Makefile
+25-03 files

FreeBSD/src 08dbff5share/man/man4 Makefile aq.4

aq(4): Add man page

Reviewed by:    ziaee
Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53840

(cherry picked from commit fb1994e03c88cf087e61f7aa608dd82531e3a4e8)
DeltaFile
+56-0share/man/man4/aq.4
+1-0share/man/man4/Makefile
+57-02 files

FreeBSD/src 15671c2sys/dev/usb usbdevs

usbdevs: Add Microchip 10BASE-T1S eval board

USB vendor:product 184f:0051

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56794

(cherry picked from commit 707ee7ff952c5aa50884f96f7ed26f756c9723b5)
DeltaFile
+4-0sys/dev/usb/usbdevs
+4-01 files

FreeBSD/src 4702384. ObsoleteFiles.inc

Revert "Add a few missed files to ObsoleteFiles.inc"

This reverts commit 33175a5059970bf9e888a799d3578e2902d765af, because
some of the directories and files are still being installed.
DeltaFile
+0-9ObsoleteFiles.inc
+0-91 files

FreeBSD/src d4b36d6. ObsoleteFiles.inc

Revert "Add a few missed files to ObsoleteFiles.inc"

This reverts commit 2e089a89812b56329741cd8dc2d272405a6e73ff, because
some of the directories and files are still being installed.
DeltaFile
+0-9ObsoleteFiles.inc
+0-91 files

FreeBSD/src 744cc51sys/sys mbuf.h

mbuf: Parenthesize macro arguments

MFC after:      1 week
Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
DeltaFile
+1-1sys/sys/mbuf.h
+1-11 files

FreeBSD/src 70509d1contrib/llvm-project/libunwind/src UnwindRegistersSave.S

Merge commit 6b0a46958c56 from llvm-project (by Piotr Kubaj):

  [libunwind][PPC64] Fix unw_getcontext corrupting callee-saved VSX registers on LE (#198371)

  This is the first of two independent fixes for libunwind on ppc64le
  (ELFv2 ABI, little-endian), where two separate bugs together cause
  SIGSEGV during backtracing. This commit addresses the VSX register
  corruption; the TOC-restore fault is handled in a follow-up. Both
  were discovered while debugging lang/rust build failures with
  RUST_BACKTRACE=1 on FreeBSD/powerpc64le (IBM POWER9).

  On ppc64le, `unw_getcontext` saves each VS register with an in-place
  `xxswapd n, n` followed by `stxvd2x`. The swap is needed because
  `stxvd2x` stores doublewords in the wrong order on LE. However, the
  macro never applies a second `xxswapd` to restore the register after
  the store, so all 64 VS registers are permanently corrupted on return
  from `unw_getcontext`.

  This affects every callee-saved VSX register: f14-f31 (VSR14-VSR31)

    [11 lines not shown]
DeltaFile
+4-0contrib/llvm-project/libunwind/src/UnwindRegistersSave.S
+4-01 files

FreeBSD/src c6f5d8fsys/arm64/arm64 trap.c

arm64: Use the fault handler when one is provided

In align_abort() and tag_check_abort(), if we got a fault while in kernel,
do not panic if a fault handler has been provided. We may get such a fault
when trying to read or write userland data, it can at least happen with
_umtx_op() if an unaligned pointer is provided. Instead, just let the
fault handler deal with it.

MFC After: 1 week
Approved by: andrew
Differential Revision: https://reviews.freebsd.org/D58426
DeltaFile
+19-0sys/arm64/arm64/trap.c
+19-01 files