OpenBSD cvs log

created 2023-05-27T20:14:31Z
begin 2023-05-20T00:00:00Z
end 2023-05-27T00:00:00Z
path src/sys
commits 16

date 2023-05-20T12:02:46Z
author kettenis
files src/sys/dev/acpi/acpithinkpad.c log diff annotate
message Implement battery charge control.

ok patrick@

date 2023-05-20T12:48:36Z
author mpi
files src/sys/uvm/uvm_map.c log diff annotate
src/sys/uvm/uvm_map.h log diff annotate
message Do not grab the `vmmaplk' recursively, prevent a self-deadlock.

Change the semantic of vm_map_busy() to be able to completely unlock the
`vmmaplk' instead of downgrading it to a read lock in mlock(2). This is
necessary because uvm_fault_wire() tries to re-grab the same lock.

We now keep track of the thread currently holding the vmmap busy to ensure
it can relock & unbusy the vmmap. The new pattern becomes:

....vm_map_lock(map);
....vm_map_busy(map); /* prevent other threads to grab an exclusive lock */
....vm_map_unlock(map);
....
..../*
.... * Do some stuff generally requiring a tsleep(9).
.... */
....
....vm_map_lock(map);
....vm_map_unbusy(map); /* allow other threads to make progress after unlock */
....vm_map_unlock(map);

Fix adapted from NetBSD's r1.249 of uvm/uvm_map.c. Issue reported by
Jacqueline Jolicoeur exposed by a "wallet refresh" of the Monero App.
Panic hand-copied below:

sleep_finish()
rw_enter()
uvmfault_lookup()
uvm_fault_check()
uvm_fault()
uvm_fault_wire()
uvm_map_pageable_wire()
sys_mlock()

This version skips bumping the map's timestamp if the lock is acquired by the
thread marked the VM map busy. This prevents a KASSERT() reported by bluhm@
triggered by regress/misc/posixtestsuite conformance/interfaces/mmap/18-1

ok kettenis@

date 2023-05-21T12:47:54Z
author claudio
files src/sys/kern/kern_sysctl.c log diff annotate
message In sysctl_hwchargestop() check that hw_battery_setchargestop is set
and not hw_battery_setchargestart.
OK kettenis@

date 2023-05-21T17:04:22Z
author krw
files src/sys/arch/sparc64/stand/ofwboot/ofdev.c log diff annotate
message Typo in comment. 'parititon' -> 'partition'.

date 2023-05-22T00:37:19Z
author guenther
files src/sys/lib/libkern/arch/amd64/memmove.S log diff annotate
message NENTRY() doesn't provide an endbr64, so give memmove one in
case it ever gets called through a function pointer (with retpoline
disabled)

ok deraadt@

date 2023-05-22T00:39:57Z
author guenther
files src/sys/arch/amd64/amd64/fpu.c log diff annotate
src/sys/arch/amd64/include/fpu.h log diff annotate
message The fp_ex_[st]w struct savefpu members were inherited from NetBSD where
they're used in the 32bit-compat support, which we dropped years ago.
Bye bye!

ok deraadt@

date 2023-05-22T13:23:56Z
author denis
files src/sys/dev/pci/pcidevs log diff annotate
message Add EPYC Embedded 3000 10GbE NIC

Input by sthen@
OK miod@

date 2023-05-22T16:08:34Z
author bluhm
files src/sys/netinet/ip_output.c log diff annotate
src/sys/netinet6/ip6_output.c log diff annotate
message Fix TSO for traffic to a local address on a physical interface.

When sending TCP packets with software TSO to the local address of
a physical interface, the TCP checksum was miscalculated. As the
small MSS is taken from the physical interface, but the large MTU
of the loopback interface is used, large TSO packets are generated,
but sent directly to the loopback interface. There we need the
regular pseudo header checksum and not the modified without packet
length.

To avoid this confusion, use the same decision for checksum generation
in in_proto_cksum_out() as for using hardware TSO in tcp_if_output_tso().

bug reported and tested by robert@ bket@ Hrvoje Popovski
OK claudio@ jan@

date 2023-05-23T09:16:16Z
author jan
files src/sys/dev/pci/if_ix.c log diff annotate
src/sys/netinet/tcp_usrreq.c log diff annotate
src/sys/netinet/tcp_var.h log diff annotate
message New counters for LRO packets from hardware TCP offloading.

With tweaks from patrick@ and bluhm@.

OK bluhm@

date 2023-05-23T14:10:27Z
author patrick
files src/sys/arch/arm64/conf/GENERIC log diff annotate
src/sys/arch/arm64/conf/RAMDISK log diff annotate
src/sys/dev/fdt/files.fdt log diff annotate
src/sys/dev/fdt/qcaoss.c log diff annotate
message Add qcaoss(4), a driver for the Always On Subsystem found on Qualcomm SoCs.

This subsystem typically provides an interface for clocks and regulators
not controlled via RPMH. We will use it to switch the load state of the
ADSP co-processor. Surprisingly, or maybe not, the interface uses ASCII
text that kind of looks like JSON.

ok kettenis@

date 2023-05-23T16:34:01Z
author denis
files src/sys/dev/pci/pcidevs.h log diff annotate
src/sys/dev/pci/pcidevs_data.h log diff annotate
message regen

date 2023-05-23T16:39:29Z
author denis
files src/sys/dev/ic/com.c log diff annotate
message Force comport initialization for some class of device

Some com@acpi devices will fail the comprobe1() check which can lead to
hang or reboot of the machine.

Input from deraadt@ kettenis@
OK miod@

date 2023-05-25T07:45:33Z
author claudio
files src/sys/kern/vfs_sync.c log diff annotate
message Do not use wakeup_proc() outside of the sleep machinery. Just use
wakeup_one().
OK mpi@

date 2023-05-25T19:32:34Z
author kurt
files src/sys/arch/sparc64/conf/GENERIC.MP log diff annotate
src/sys/kern/subr_witness.c log diff annotate
message Work around sparc64 WITNESS kernel failing to load by moving large witness
data structures from bss to be allocated in witness_initialize().

Tested on sparc64, amd64, arm64, i386, octeon. okay miod@

date 2023-05-25T19:35:58Z
author kurt
files src/sys/dev/ic/mfi.c log diff annotate
src/sys/dev/ic/mpi.c log diff annotate
src/sys/dev/pci/mfii.c log diff annotate
src/sys/dev/pci/mpii.c log diff annotate
src/sys/scsi/scsi_base.c log diff annotate
message Disable witness for mutexes created on the stack which allows
the ddb command 'show witness' to succeed without panicking.
Leaving witness enabled on these mutexes saves a pointer to
struct lock_type on the stack which gets clobbered resulting
in a panic in witness_ddb_display_descendants().

okay miod@

date 2023-05-26T12:13:26Z
author kn
files src/sys/net/if_pfsync.c log diff annotate
src/sys/net/pf_ioctl.c log diff annotate
src/sys/net/pfvar.h log diff annotate
message Remove net lock from DIOC{S,G}ETLIMIT

Grab the pf lock for pf_pool_limits[] in pfsync such that all access is
covered by the pf lock; document accordingly.

Hard memory pool limits don't need the net lock for protection, pool(9)s
have their own internal lock and the pf lock fully covers limit values.

(pf_pool_limits[] access in DIOCXCOMMIT remains under pf *and net* lock
until the rest in there gets pulled out of the net lock.)

OK sashan