OpenBSD cvs log

created 2022-03-17T10:00:51Z
begin 2021-12-22T00:00:00Z
end 2021-12-29T00:00:00Z
path src/sys
commits 47

date 2021-12-22T01:38:36Z
author jsg
files src/sys/dev/pci/drm/amd/amdgpu/amdgpu_gem.c log diff annotate
src/sys/dev/pci/drm/amd/amdgpu/amdgpu_uvd.c log diff annotate
src/sys/dev/pci/drm/amd/amdgpu/amdgpu_vce.c log diff annotate
src/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c log diff annotate
message %Lx -> %llx kernel printf does not support %Lx

date 2021-12-22T12:30:38Z
author jsg
files src/sys/dev/pci/drm/amd/pm/swsmu/smu12/smu_v12_0.c log diff annotate
message drm/amd/pm: fix a potential gpu_metrics_table memory leak

From Lang Yu
222cebd995cdf11fe0d502749560f65e64990e55 in linux 5.10.y/5.10.88
aa464957f7e660abd554f2546a588f6533720e21 in mainline linux

date 2021-12-22T12:33:02Z
author jsg
files src/sys/dev/pci/drm/amd/amdgpu/gfx_v9_0.c log diff annotate
message drm/amdgpu: correct register access for RLC_JUMP_TABLE_RESTORE

From Le Ma
aec5897b277b13acd8f913d777654d4d092a24f1 in linux 5.10.y/5.10.88
f3a8076eb28cae1553958c629aecec479394bbe2 in mainline linux

date 2021-12-22T13:37:46Z
author tobhe
files src/sys/netinet/ipsec_input.c log diff annotate
message Consolidate enc_getif() lookups in IPsec input path to save one lookup
per packet and improve readability.

ok bluhm@

date 2021-12-22T19:37:33Z
author tobhe
files src/sys/dev/ic/bwfm.c log diff annotate
message Disable minimum power consumption in hostap mode. This improves connection
reliability when bwfm is used as an access point.

ok patrick@

date 2021-12-22T22:20:13Z
author bluhm
files src/sys/kern/kern_sysctl.c log diff annotate
src/sys/kern/subr_disk.c log diff annotate
message While malloc sleeps, the disk list could change during sysctl. Then
allocated memory could be too short for the list of disks. Retry
allocating enough space until it did not change.
The disk list and duid memory are protected by kernel lock. Use
asserts to mark this explicitly.
Reported-by: [email protected]
OK anton@ mpi@

date 2021-12-23T01:39:44Z
author jsg
files src/sys/dev/pci/if_et.c log diff annotate
message give et_setmulti() more chance of working
ok claudio@

date 2021-12-23T02:12:52Z
author jsg
files src/sys/msdosfs/direntry.h log diff annotate
message make array bounds in unix2dosfn() prototype match function
missed when unix2dosfn() was changed with msdosfs_conv.c rev 1.15 in 2012

date 2021-12-23T10:04:14Z
author bluhm
files src/sys/conf/GENERIC log diff annotate
message Template for option WITNESS is in the architecture GENERIC.MP file
if it is supported. Remove it from the global GENERIC config.
OK visa@ claudio@

date 2021-12-23T10:09:16Z
author bluhm
files src/sys/dev/vnd.c log diff annotate
message Disk lock was held when returning to userland. Add a missing unlock
in vnd ioctl error path.
Reported-by: [email protected]
OK jsg@ anton@

date 2021-12-23T10:17:01Z
author bluhm
files src/sys/kern/kern_sysctl.c log diff annotate
message Use TAILQ_FOREACH to traverse the disk list in sysctl_diskinit().
OK anton@

date 2021-12-23T12:14:15Z
author anton
files src/sys/dev/usb/uhidpp.c log diff annotate
message Get rid of unused next battery level argument.

date 2021-12-23T12:21:48Z
author bluhm
files src/sys/net/if_bridge.c log diff annotate
src/sys/netinet/ip_ah.c log diff annotate
src/sys/netinet/ip_esp.c log diff annotate
src/sys/netinet/ip_ipcomp.c log diff annotate
src/sys/netinet/ip_output.c log diff annotate
src/sys/netinet/ipsec_input.c log diff annotate
src/sys/netinet/ipsec_output.c log diff annotate
src/sys/netinet6/ip6_output.c log diff annotate
message IPsec is not MP safe yet. To allow forwarding in parallel without
dirty hacks, it is better to protect IPsec input and output with
kernel lock. Not much is lost as crypto needs the kernel lock
anyway. From here we can refine the lock later.
Note that there is no kernel lock in the SPD lockup path. Goal is
to keep that lock free to allow fast forwarding with non IPsec
traffic.
tested by Hrvoje Popovski; OK tobhe@

date 2021-12-23T18:50:31Z
author guenther
files src/sys/kern/syscalls.master log diff annotate
src/sys/kern/vfs_syscalls.c log diff annotate
message Roll the syscalls that have an off_t argument to remove the explicit padding.
Switch libc and ld.so to the generic stubs for these calls.
WARNING: reboot to updated kernel before installing libc or ld.so!

Time for a story...

When gcc (back in 1.x days) first implemented long long, it didn't (always)
pass 64bit arguments in 'aligned' registers/stack slots, with the result that
argument offsets didn't match structure offsets. This affected the nine system
calls that pass off_t arguments:
ftruncate lseek mmap mquery pread preadv pwrite pwritev truncate

To avoid having to do custom ASM wrappers for those, BSD put an explicit pad
argument in so that the off_t argument would always start on a even slot and
thus be naturally aligned. Thus those odd wrappers in lib/libc/sys/ that use
__syscall() and pass an extra '0' argument.

The ABIs for different CPUs eventually settled how things should be passed on
each and gcc 2.x followed them. The only arch now where it helps is landisk,
which needs to skip the last argument register if it would be the first half of
a 64bit argument. So: add new syscalls without the pad argument and on landisk
do that skipping directly in the syscall handler in the kernel. Keep compat
support for the existing syscalls long enough for the transition.

ok deraadt@

date 2021-12-23T18:50:32Z
author guenther
files src/sys/arch/hppa/hppa/trap.c log diff annotate
src/sys/arch/sh/sh/trap.c log diff annotate
src/sys/kern/kern_ktrace.c log diff annotate
src/sys/kern/kern_pledge.c log diff annotate
src/sys/uvm/uvm_mmap.c log diff annotate
message Roll the syscalls that have an off_t argument to remove the explicit padding.
Switch libc and ld.so to the generic stubs for these calls.
WARNING: reboot to updated kernel before installing libc or ld.so!

Time for a story...

When gcc (back in 1.x days) first implemented long long, it didn't (always)
pass 64bit arguments in 'aligned' registers/stack slots, with the result that
argument offsets didn't match structure offsets. This affected the nine system
calls that pass off_t arguments:
ftruncate lseek mmap mquery pread preadv pwrite pwritev truncate

To avoid having to do custom ASM wrappers for those, BSD put an explicit pad
argument in so that the off_t argument would always start on a even slot and
thus be naturally aligned. Thus those odd wrappers in lib/libc/sys/ that use
__syscall() and pass an extra '0' argument.

The ABIs for different CPUs eventually settled how things should be passed on
each and gcc 2.x followed them. The only arch now where it helps is landisk,
which needs to skip the last argument register if it would be the first half of
a 64bit argument. So: add new syscalls without the pad argument and on landisk
do that skipping directly in the syscall handler in the kernel. Keep compat
support for the existing syscalls long enough for the transition.

ok deraadt@

date 2021-12-23T18:50:59Z
author guenther
files src/sys/kern/init_sysent.c log diff annotate
src/sys/kern/syscalls.c log diff annotate
src/sys/sys/syscall.h log diff annotate
src/sys/sys/syscallargs.h log diff annotate
message sync

date 2021-12-23T20:48:24Z
author patrick
files src/sys/arch/arm64/dev/aplpinctrl.c log diff annotate
message Fix endless loop in the interrupt handler. When iterating over each
GPIO base register we must not replace the iterator variable with the
index of the pin inside the register.

ok kettenis@

date 2021-12-23T22:35:11Z
author bluhm
files src/sys/netinet/ip_ah.c log diff annotate
src/sys/netinet/ip_esp.c log diff annotate
message Remove unused variables and assignments in ah and esp output.
found by clang 13; OK tobhe@

date 2021-12-24T00:01:39Z
author patrick
files src/sys/arch/arm64/conf/GENERIC log diff annotate
src/sys/arch/arm64/conf/RAMDISK log diff annotate
src/sys/arch/arm64/conf/files.arm64 log diff annotate
src/sys/arch/arm64/dev/apliic.c log diff annotate
message Add apliic(4), a driver for the I2C controller found on various Apple SoCs.

ok kettenis@

date 2021-12-24T06:18:11Z
author hastings
files src/sys/dev/usb/usbdevs log diff annotate
message Add some more mtw(4) devices.
ASUS USB-N10 v2, D-Link DWA-127 rev B1, Edimax EW-7711UAn v2,
various Ralink/MediaTek ids.

ok stsp@

date 2021-12-24T06:19:24Z
author hastings
files src/sys/dev/usb/usbdevs.h log diff annotate
src/sys/dev/usb/usbdevs_data.h log diff annotate
message regen

date 2021-12-24T06:50:16Z
author visa
files src/sys/kern/uipc_socket.c log diff annotate
message Make poll/select version of filt_solisten() more similar to soo_poll().

OK mpi@

date 2021-12-24T06:53:18Z
author hastings
files src/sys/dev/usb/if_mtw.c log diff annotate
message Support more mtw(4) devices.
ASUS USB-N10 v2, D-Link DWA-127 rev B1, Edimax EW-7711UAn v2,
various Ralink/MediaTek ids.

ok stsp@

date 2021-12-25T01:25:51Z
author guenther
files src/sys/sys/exec_elf.h log diff annotate
message Sync DF_1_* flag definitions with llvm 13, including support in
readelf -d for displaying them.
(lld 13 sets DF_1_PIE on most our binaries)

ok jsg@

date 2021-12-25T11:04:58Z
author visa
files src/sys/kern/kern_event.c log diff annotate
message kqueue: Invalidate revoked vnodes' knotes on the fly

When a tty device is revoked, the associated knotes should be
invalidated. Otherwise the user processes can keep on receiving
events from the device.

It appears tricky to do the invalidation as part of revocation
in a way that does not allow unwanted event registration or clutter
the tty code. For now, make the knotes invalid lazily before delivery.

OK mpi@

date 2021-12-25T13:35:17Z
author bluhm
files src/sys/netinet6/ip6_input.c log diff annotate
message For a long time ip_ours() and ip6_ours() are calling ip_deliver()
without kernel lock. Unlock the two callers in ip6_input_if() that
have been forgotten.
OK mvs@ kn@

date 2021-12-26T01:00:32Z
author sashan
files src/sys/net/if.c log diff annotate
src/sys/net/pf_if.c log diff annotate
src/sys/net/pf_ioctl.c log diff annotate
src/sys/net/pfvar.h log diff annotate
message make 'set skip on ...' in pf.conf dynamic

This is an old issue in pf(4): whenever new interface appears
in IP stack, we must reload pf.conf to apply 'set skip on ...'
to newly plumbed network interfaces. Time has come to fix it.
The idea is to also create pfi_kif for interfaces, which are
referred by 'set skip on ...'. Such pfi_kif instances are
created/destroyed by pfi_set_flags()/pfi_clear_flags().

claudio@ dragged my attention to this in Gouveia. Also his
feedback helped me to put change into shape.

OK claudio@

date 2021-12-26T13:55:36Z
author kettenis
files src/sys/arch/amd64/conf/GENERIC log diff annotate
src/sys/arch/amd64/conf/RAMDISK log diff annotate
src/sys/arch/amd64/conf/RAMDISK_CD log diff annotate
src/sys/dev/acpi/acpivar.h log diff annotate
src/sys/dev/acpi/com_acpi.c log diff annotate
src/sys/dev/acpi/files.acpi log diff annotate
message Add address locators for the ACPI "bus" and use these to fix the order of
the com(4) devices to match the traditional order one the ISA bus.

ok patrick@, anton@

date 2021-12-26T14:04:29Z
author sashan
files src/sys/net/pf_ioctl.c log diff annotate
message DIOCHANGERRULE ioctl must set pointer to ruleset in rule it inserts.

Reported-by: [email protected]

OK bluhm@, OK jmatthew@

date 2021-12-26T20:50:17Z
author patrick
files src/sys/dev/ic/bwfm.c log diff annotate
src/sys/dev/ic/bwfmreg.h log diff annotate
src/sys/dev/ic/bwfmvar.h log diff annotate
message Add information about TCM rambase and how to check the SR capability for
a few more chips.

date 2021-12-26T23:41:41Z
author mvs
files src/sys/kern/uipc_usrreq.c log diff annotate
src/sys/sys/unpcb.h log diff annotate
message Rework garbage collector for unix(4) sockets.

This time unix(4) sockets garbage collector always destroys any socket
with positive "fp->f_count == unp->unp_msgcount" equation. This is wrong
because unix(4) sockets within SCM_RIGHTS message but closed on sender
side also have this equation positive. Such sockets are not in the loop,
and if garbage collector kill them before they are received, we get
kernel panic.

FreeBSD already has garbage collector reworked to fix this issue [1]. The
logic is pretty simple so import it to our garbage collector.

1. https://reviews.freebsd.org/D23142

ok bluhm@

date 2021-12-27T10:56:55Z
author patrick
files src/sys/dev/pci/if_bwfm_pci.c log diff annotate
message Bump rxpost and rxcomplete ring size to 1024 for newer chips.

date 2021-12-27T10:59:20Z
author patrick
files src/sys/dev/ic/bwfm.c log diff annotate
src/sys/dev/ic/bwfmreg.h log diff annotate
message Handle trailing odd-sized 1024 byte blocks when calculating TCM RAM size.

date 2021-12-27T12:03:59Z
author patrick
files src/sys/dev/pci/if_bwfm_pci.c log diff annotate
message Switch module codename retrieval to use the newly proposed device tree
bindings.

date 2021-12-27T13:54:39Z
author patrick
files src/sys/dev/ic/bwfm.c log diff annotate
src/sys/dev/ic/bwfmvar.h log diff annotate
src/sys/dev/pci/if_bwfm_pci.c log diff annotate
message Send TxCap and WiFi calibration blobs to the chip.

date 2021-12-27T14:28:13Z
author patrick
files src/sys/dev/ic/bwfm.c log diff annotate
message BCM4387 needs the D11 cores to be held in reset by us, the firmware
will take care of releasing them, as otherwise initialization would
fail some of the time. That chip also contains 3 of these, so make
sure we reset all of them. Necessary on Apple M1 Pro/Max.

date 2021-12-27T14:31:15Z
author patrick
files src/sys/dev/ic/bwfm.c log diff annotate
message Fix off-by-one in blob download, where in the case that the blob is evenly
divisible by 1400, the last chunk isn't marked with an end flag.

ok tobhe@

date 2021-12-27T15:38:25Z
author anton
files src/sys/dev/kcov.c log diff annotate
message Yet another errno correction.

date 2021-12-27T17:12:34Z
author patrick
files src/sys/dev/ic/bwfmreg.h log diff annotate
src/sys/dev/pci/if_bwfm_pci.c log diff annotate
message Support reading OTP information from a few more chips, necessary to learn
firmare names on Apple M1 Pro/Max and Apple T2 Macs.

date 2021-12-27T17:32:14Z
author patrick
files src/sys/dev/pci/if_bwfm_pci.c log diff annotate
message Map the chip ids used on Apple M1 Pro/Max and Apple T2 Macs to firmware
names.

date 2021-12-27T17:56:03Z
author patrick
files src/sys/dev/pci/if_bwfm_pci.c log diff annotate
message Not only BCM4378, but all PCIe core revisions >= 64 need to be accessed
using the new sets of registers.

date 2021-12-28T13:16:28Z
author mpi
files src/sys/uvm/uvm_fault.c log diff annotate
message Unlock bottom part of the fault handler.

Tested by many during the past months, thanks!

ok sthen@

date 2021-12-28T16:29:59Z
author otto
files src/sys/arch/amd64/conf/Makefile.amd64 log diff annotate
message Now that -A prints -- markers as it is supposed to filter them out when
doing the consistency check for locore.o; ok millert@

date 2021-12-28T17:50:10Z
author anton
files src/sys/dev/kcov.c log diff annotate
message The initial kd_lookup() in kcovopen() is redundant as kcov is a cloning
device. Turn it into an assertion instead to better state the expected
semantics of D_CLONE.

Prompted after a discussion with visa@

date 2021-12-28T23:10:30Z
author dlg
files src/sys/net/if_veb.c log diff annotate
message move away from using the M_PROTO1 flag to prevent loops with vports

if a vlan interface is configured on a vport interface, vlan(4)
will take the packet away from ether_input before the veb bridge
input handler gets to clear M_PROTO1. this leaves the flag on the
mbuf as it goes through the l3 stacks. if it goes back out a vport
into a veb, the presence of M_PROTO1 means the packet ends up getting
dropped, which is unexpected.

this diff specialises vport handling by veb even more to avoid the
problem the flag was handling. vports get their own bridge input
handler that skips veb processing completely because a packet being
received on a vport can only occur if a veb has decided to forward
it there and has already processed it. when the stack sends a packet
out a vport interface, then we do actual veb bridge input handling.

bug reported on misc@ and the fix tested by Simon Baker

date 2021-12-28T23:10:58Z
author dlg
files src/sys/net/if_veb.c log diff annotate
message it doesnt make sense to configure a vport as a span port.

date 2021-12-28T23:13:20Z
author dlg
files src/sys/net/if_veb.c log diff annotate
message whitespace tweak, no functional change.