FreeBSD/src 724a437 — tests/sys/pmc Makefile

tests/sys/pmc/Makefile: whitespace

Use similar spacing on adjacent lines, for readability. No functional
change.
DeltaFile
+4-4tests/sys/pmc/Makefile
+4-41 files

FreeBSD/src 546a764 — tests/sys/pmc pmc_rapl_test.c pmc_pidtrack_test.c, tests/sys/pmc/amd pmu_event_neg_test.c pmu_mux_test.c

tests/sys/pmc: add pidtrack, callchain, pmc(8), RAPL and AMD tests

Add to the suite of ATF tests for hwpmc(4).  Vendor-neutral tests go in
tests/sys/pmc; tests that depend on AMD hardware interfaces go in
tests/sys/pmc/amd, which is only built on amd64.

tests/sys/pmc:
  pmc_pidtrack_test      process-mode PMCs follow their PID: a live
                         self-read counts the process' own work, an idle
                         process sharing the CPU with a busy one does not
                         pick up its work, and the count survives a
                         context switch
  pmc_callchain_ur_test  pmcstat -U collects user callchains through the
                         PMC_UR ring; regression test for the KASSERTs
                         fixed in rGaf3929c5152b and rG66118c3f1011
  pmc_cli_test           pmc(8): missing log, list-events, record/info
                         round trip with the "instructions" alias
  pmcstat_tsc_test       (amd64) tsc_freq in the initlog record, TSC
                         column of pmcstat -R, tsc in pmc filter -j,

    [29 lines not shown]
DeltaFile
+481-0tests/sys/pmc/amd/pmu_event_test.c
+399-0tests/sys/pmc/pmc_pidtrack_test.c
+316-0tests/sys/pmc/amd/amd_pmc_test_common.h
+280-0tests/sys/pmc/amd/pmu_mux_test.c
+260-0tests/sys/pmc/pmc_rapl_test.c
+254-0tests/sys/pmc/amd/pmu_event_neg_test.c
+1,990-09 files not shown
+2,667-315 files

FreeBSD/src 2764bc5 — sys/dev/asmc asmc.c

asmc: do not enable the sudden motion sensor on the MMIO backend

The interrupt filter reads the PIO interrupt port, but sc_ioport is NULL
under MMIO; the capability test only probed for keys, which says nothing
about the backend.

No MMIO-capable machine has a sudden motion sensor anyway. It existed to
park the heads of spinning disks.

Reviewed by:    adrian
Differential Revision:  https://reviews.freebsd.org/D61383
DeltaFile
+13-8sys/dev/asmc/asmc.c
+13-81 files

FreeBSD/src c5400dc — lib/libpmc libpmcinternal.h libpmc_pmu_util.c, lib/libpmc/pmu-events/arch/x86 mapfile.csv

libpmc: Strip leading zeros from the cpuid model

Upstream's mapfile.csv lists models without leading zeros, so entries
for models below 10h had to be fixed up by hand on every import.  Strip
them before matching and use the entries as imported.

Add tests to validate the functionality.

Reviewed by:    mhorne, Ali Mashtizadeh <ali at mashtizadeh.com>
Sponsored by:   Advanced Micro Devices, Inc.
MFC after:      1 week
Signed-off-by:  Osvaldo Janeri Filho <ojanerif at amd.com>
Differential Revision:  https://reviews.freebsd.org/D60790
DeltaFile
+76-3tests/sys/pmc/pmc_mapfile_test.c
+30-0lib/libpmc/libpmc_pmu_util.c
+4-4lib/libpmc/pmu-events/arch/x86/mapfile.csv
+1-0lib/libpmc/libpmcinternal.h
+111-74 files

FreeBSD/src a81038c — sys/kern kern_thr.c, sys/sys syscallsubr.h

thr_set_name(2): add kern_ implementation

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+10-4sys/kern/kern_thr.c
+1-0sys/sys/syscallsubr.h
+11-42 files

FreeBSD/src 698ba43 — sys/kern kern_sig.c, sys/sys signal.h syscallsubr.h

sig*(2): add kern_ and user_ implementations

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+72-20sys/kern/kern_sig.c
+11-0sys/sys/syscallsubr.h
+4-0sys/sys/signal.h
+87-203 files

FreeBSD/src 3d101bb — sys/kern kern_uuid.c, sys/sys syscallsubr.h

uuidgen(2): add user_ implementation

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+9-4sys/kern/kern_uuid.c
+2-0sys/sys/syscallsubr.h
+11-42 files

FreeBSD/src 22f93ed — sys/kern kern_time.c, sys/sys syscallsubr.h

kern_time.c: add kern_ and user_ implementations

Expose user_clock_nanosleep globally.

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+22-13sys/kern/kern_time.c
+7-0sys/sys/syscallsubr.h
+29-132 files

FreeBSD/src 23abe18 — sys/kern kern_sysctl.c, sys/sys syscallsubr.h

__sysctl(2): add kern_ implementation

The flags argument will be used by compat impelementations.

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+16-8sys/kern/kern_sysctl.c
+3-0sys/sys/syscallsubr.h
+19-82 files

FreeBSD/src fe63435 — sys/net iflib.c

iflib: rate limit deferred tx ring drain

When simple_tx gives up & return ENOBUFS because the tx ring is full,
we were doing a GROUPTASK_ENQUEUE(&txq->ift_task) each time.
On a tx ring that has overflowed and is being hammered on
by a fast UDP sender, this can result in a massive increase in
context switches (I've seen over 30M ctxw/sec due to this, and
the ctxsw codepath taking roughly 50% CPU).

This change removes the GROUPTASK_ENQUEUE() and replaces it
with a call to a callout which drains the tx ring. The callout time is
determined based on the link speed, estimating how long it would take
for a large fraction of of a ring containing full-MTU packets to drain.

This removes the 30M ctxsw / sec in my test case and reduces it
to roughly a doubling of ctxsws.

Reviewed by: kbowling
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61313
DeltaFile
+54-10sys/net/iflib.c
+54-101 files

FreeBSD/src 44df82b — sys/net iflib.c

iflib: simplify TXQ_AVAIL

Simply the TXQ_AVAIL() macro to avoid using
get_inuse(txq->ift_size, txq->ift_cidx, txq->ift_pidx, txq->ift_gen)
and instead define it in terms of txq->ift_in_use.

Note that in_use is equivalent, because it is updated at the same time
as cidx/pidx and gen, and under the same serialization. The advantage
is that its cheaper due to using one read and no branches, and
safer, since unlocked reads get an atomic snapshot of availability,
but an unlocked read of multiple counters can produce inconsistent
results.

Reviewed by: kbowling, kgalazka
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D61279
DeltaFile
+7-10sys/net/iflib.c
+7-101 files

FreeBSD/src 1de9312 — usr.sbin/pw pw_user.c, usr.sbin/pw/tests pw_useradd_test.sh

pw: reject ' and ` in user/group names

pw_checkname() already refuses $ ( ) and freinds, but backtick and
single quote slipped thru, so `pw useradd 'foo`id`'` went in just
fine. Thats command substitution in any unquoted context. Add both
to badchars, plus a test.

Reported by:    Harry Sintonen (Reversec)
Sponsored by:   Entersekt
MFC after:      2 weeks
Approved by:    bapt
Differential Revision:  https://reviews.freebsd.org/D61392
DeltaFile
+16-0usr.sbin/pw/tests/pw_useradd_test.sh
+1-1usr.sbin/pw/pw_user.c
+17-12 files

FreeBSD/src 6fcdc18 — crypto/openssh myproposal.h channels.c, crypto/openssh/openbsd-compat readpassphrase.c port-uw.c

OpenSSH: Update to 10.6p2

Full release notes are available at
https://www.openssh.org/txt/release-10.6p2 .

Selected items from the upstream release notes:

Future deprecation notice
-------------------------

 * scp(1): begin deprecating the -R flag, which is used to perform a
   remote-to-remote copy by executing scp on a remote host. This
   option is a fragile optimisation that is difficult to use because
   it requires credentials on the remote host. It also creates
   security risks if the shell quoting rules on the remote system
   where the copy is performed differ from the client's expectations.

   From OpenSSH 10.6, this option will continue to work but will
   cause a deprecation warning to be emitted to standard error. In

    [6 lines not shown]
DeltaFile
+13-5crypto/openssh/openbsd-compat/xcrypt.c
+13-4crypto/openssh/auth-passwd.c
+8-8crypto/openssh/openbsd-compat/port-uw.c
+5-5crypto/openssh/openbsd-compat/readpassphrase.c
+3-4crypto/openssh/channels.c
+3-2crypto/openssh/myproposal.h
+45-2812 files not shown
+63-4018 files

FreeBSD/src 6dd16be — crypto/openssh misc-agent.c ed25519.sh, crypto/openssh/openbsd-compat port-linux.c port-linux-selinux.c

OpenSSH: Update to 10.6p1

This release contains security fixes and small bugfixes.

Full release notes are available at
https://www.openssh.com/txt/release-10.6 .

Selected items from the upstream release notes:

Security
========

 * ssh-agent(1): fix an interaction between agent locking and the
   session-bind at openssh.com extension that is used to identify
   forwarded agents. These binding requests were refused when the
   agent was locked, with the result that operations that were
   intended to be limited to local use only could be performed
   remotely, including the ability to add PKCS#11 tokens and make
   use of keys that had destination restrictions applied.

    [33 lines not shown]
DeltaFile
+4,598-1,983crypto/openssh/ed25519.c
+1,277-1,052crypto/openssh/ChangeLog
+256-165crypto/openssh/ed25519.sh
+191-65crypto/openssh/misc-agent.c
+243-0crypto/openssh/openbsd-compat/port-linux-selinux.c
+2-209crypto/openssh/openbsd-compat/port-linux.c
+6,567-3,474118 files not shown
+8,551-4,641124 files

FreeBSD/src 4025692 — sys/arm/allwinner axp81x.c

axp81x: Serialize the register accesses

The registers were accessed with iicbus_transfer(), which does not own
the bus.  The interrupt driven transfers of the Allwinner twsi
controller drop their mutex while they sleep waiting for the interrupt,
so two accesses can overlap, and the PMU shares its bus with other
devices, an RTC for instance.  Use iicbus_transfer_excl() so that the
accesses are arbitrated.

The regulators share the enable registers and the regulator framework
only serializes the accesses to a single regulator.  Protect the
read-modify-write of these registers with a lock, so that regulators
enabled at the same time cannot lose each other's update.

No failure was seen without this, it is there for correctness.

Tested on: A64, H6
DeltaFile
+11-2sys/arm/allwinner/axp81x.c
+11-21 files

FreeBSD/src 79fbc23 — sys/arm/allwinner axp81x.c

axp81x: Add support for the AXP805 and AXP806

The AXP805 and AXP806 are regulator only PMUs, with different registers
than the AXP803 and AXP813, and without a battery, ADC sensors or GPIO.
Add the regulators (voltage ranges from the datasheet and the Linux
driver) and the interrupts: the power key short press powers the system
off and the die temperature is sent to devd.  The battery, sensors,
thresholds, shutdown handler and GPIO bus are not set up for them.

Tested on a Pine H64 (AXP805 on the R_I2C).
DeltaFile
+201-34sys/arm/allwinner/axp81x.c
+201-341 files

FreeBSD/src 7ea71c1 — sys/arm/allwinner axp81x.c

axp81x: Do not change the voltage of a regulator in range

axp8xx_regnode_init() set every regulator described in the FDT to its
minimum voltage, even if the firmware had already set a voltage in the
range. For a regulator that is in use, like the one of the CPU, this can
make the system crash. Only set the voltage when the current one is out
of the range.

Tested on: A64, H6
DeltaFile
+10-1sys/arm/allwinner/axp81x.c
+10-11 files

FreeBSD/src 4c50147 — sys/arm/allwinner axp81x.c

axp81x: Skip the regulators that have no name in the FDT

A regulator that is not used is described in the FDT by a node without
regulator-name, and regulator_parse_ofw_stdparam() fails for it, which
printed two errors at every boot.  Skip these nodes, and only tell about
it when booting verbose.
DeltaFile
+8-0sys/arm/allwinner/axp81x.c
+8-01 files

FreeBSD/src 5ca0386 — sys/arm/allwinner axp81x.c

axp81x: Get the voltage of the regulators with a single range

axp8xx_regnode_get_voltage() failed when the regulator has no second
step, which is the case of the ones with a single range. Only the first
step is mandatory, as in axp8xx_regnode_set_voltage().

Tested on: A64, H6
DeltaFile
+1-1sys/arm/allwinner/axp81x.c
+1-11 files

FreeBSD/src e412077 — sys/arm/allwinner axp81x.c

axp81x: Check the errors of the register accesses

axp8xx_regnode_enable() wrote back a value computed from a register it
failed to read, which clears the enable bits of all the other
regulators of that register.  Return an error instead, and do the same
in the other regnode methods, which used an uninitialised value when an
access failed.

Also initialise udelay in axp8xx_regnode_init(), as
axp8xx_regnode_set_voltage() can now fail before setting it.

Tested on: A64, H6
DeltaFile
+16-5sys/arm/allwinner/axp81x.c
+16-51 files

FreeBSD/src 07448cd — sys/arm/allwinner axp81x.c

axp81x: Fix the register accesses

The register pointer was written without IIC_M_NOSTOP, so the controller
sends a STOP before the read message. On the Allwinner H6 (twsi) this
makes the reads return garbage without any error.

Set IIC_M_NOSTOP on it, and send the register and its value in a single
write message, like the other PMIC drivers do.

Tested on: A64, H6
DeltaFile
+10-11sys/arm/allwinner/axp81x.c
+10-111 files

FreeBSD/src d0fb805 — sys/arm/allwinner axp81x.c

axp81x: Add a function to get the regulator definition

Move the lookup of the regulator definitions out of axp8xx_attach().
This also fixes an off-by-one: the test was i <= nitems(common), so the
first regulator of the per-chip table (dc1sw or dcdc7) was never
registered and one entry past the end of the common table was read.

Tested on: A64
DeltaFile
+24-22sys/arm/allwinner/axp81x.c
+24-221 files

FreeBSD/src 5e62bf3 — sys/dev/iicbus/controller/twsi twsi.c

twsi: Do not clear the interrupt flag when changing the control bits

twsi_control_set() and twsi_control_clear() read the control register,
change some bits and write it back.  On the controllers where the
interrupt flag is cleared by writing a 1 to it (iflag_w1c), this clears
it as the flag is read as set.

In the polled mode this breaks the repeated start: START is set with
the flag cleared by the write, the hardware sends the repeated start at
once, and the flag is then cleared a second time, which loses the event
and leaves the controller with the status of the previous transfer.
Transfers with a repeated start fail with IIC_ESTATUS on an Allwinner
H6 until the controller works with interrupts.

Mask the flag out of the value that is written back, unless the caller
asks for it.

Tested on: H6
DeltaFile
+6-0sys/dev/iicbus/controller/twsi/twsi.c
+6-01 files

FreeBSD/src 3e9384b — sys/arm/allwinner axp81x.c

axp81x: Move the interrupt setup out of attach

Add axp8xx_setup_intr() which enables the interrupts and installs the
handler.

No functional change.
DeltaFile
+41-26sys/arm/allwinner/axp81x.c
+41-261 files

FreeBSD/src 09624da — sys/arm/allwinner aw_rsb.c

aw_rsb: Accept a write in a single message

The driver only took a write as two messages, the offset and then the
data.  A write on an I2C bus is a single message that starts with the
register, which is how a driver that can be on I2C or on RSB, like
axp81x, does it.  Split such a message into the two the controller
needs.

Tested on: A64
DeltaFile
+21-1sys/arm/allwinner/aw_rsb.c
+21-11 files

FreeBSD/src 5065335 — sys/arm/allwinner axp81x.c

axp81x: Move the sensors, sysctls and thresholds out of attach

Add one function for each of them: axp8xx_add_sensors(),
axp8xx_add_sysctls() and axp8xx_get_thresholds().

No functional change. This is a preparation to support PMUs without a
battery, like the AXP805, with this driver.
DeltaFile
+61-36sys/arm/allwinner/axp81x.c
+61-361 files

FreeBSD/src 5d2e81f — sys/netipsec xform_ipcomp.c xform_ah.c

netipsec: Release the SA inside the vnet context in AH and IPComp callbacks

The error paths of ah_input_cb(), ah_output_cb(), ipcomp_input_cb() and
ipcomp_output_cb() called CURVNET_RESTORE() before key_freesav() and
key_freesp().  When the callback runs on a crypto return thread, no
vnet is set after the restore, and key_freesav() panics with "vnet is
not set" on INVARIANTS kernels.  Without INVARIANTS, the last reference
would be released without a vnet.

Restore the vnet last, as the ESP callbacks do.

Reviewed by:            mjg
Fixes:                  8a9269edd71a ("ipsec: sprinkle CURVNET_ASSERT_SET")
MFC after:              1 week
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61386
DeltaFile
+2-2sys/netipsec/xform_ipcomp.c
+2-2sys/netipsec/xform_ah.c
+4-42 files

FreeBSD/src 8910f9e — sys/arm/include platformvar.h, sys/dev/usb usb_hub_acpi.c

kobj: Make the containers of pointers to base classes constant

The containers (arrays) will not be modified during runtime.

Reviewed by:    kib, imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D61297
DeltaFile
+4-4sys/sys/kobj.h
+3-3sys/kern/subr_kobj.c
+1-1sys/dev/usb/usb_hub_acpi.c
+1-1sys/arm/include/platformvar.h
+9-94 files

FreeBSD/src 88b7b85 — sys/dev/ixgbe if_ix.c

ixgbe: Attach the MDIO bus after iflib drops the context lock

ixgbe_mdio_attach() ran from ixgbe_if_attach_post(), which iflib calls
with the context lock held.  Attaching the MDIO bus there also probes
and attaches the devices on it, and their register accesses go through
ixgbe_mdio_readreg_c22() and ixgbe_mdio_writereg_c22(), which take the
same lock.  A driver on the bus that was in the kernel or loaded by
loader(8) therefore recursed on the non-recursive iflib sx lock as soon
as it touched a register: INVARIANTS kernels panic in _sx_xlock_hard(),
others recurse silently.

Wrap iflib_device_attach() and attach the MDIO bus once it has
returned, so the children take the context lock like any later MDIO
access does.

Reviewed by:            kbowling
Fixes:                  cfec995c87f3 ("ixgbe: add MDIO bus support")
Sponsored by:           Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D61199
DeltaFile
+20-4sys/dev/ixgbe/if_ix.c
+20-41 files

FreeBSD/src 52830cb — sys/kern kern_rctl.c, sys/sys syscallsubr.h

rctl_*(2): add kern_ implementations

Effort:         CHERI upstreaming
Sponsored by:   Innovate UK
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2284
DeltaFile
+47-10sys/kern/kern_rctl.c
+10-0sys/sys/syscallsubr.h
+57-102 files