OpenBSD cvs log

created 2022-03-17T16:24:38Z
begin 2022-02-23T00:00:00Z
end 2022-03-02T00:00:00Z
path src/sys
commits 53

date 2022-02-23T07:16:26Z
author jsg
files src/sys/arch/arm64/include/asm.h log diff annotate
src/sys/arch/riscv64/include/asm.h log diff annotate
message unifdef __ELF__
ok guenther@

date 2022-02-24T07:08:21Z
author guenther
files src/sys/arch/arm/include/asm.h log diff annotate
src/sys/arch/arm64/include/asm.h log diff annotate
src/sys/arch/riscv64/include/asm.h log diff annotate
message Fix PIC_SYM() macro: it never needs to token paste, so it's not
dependent on __STDC__ and doesn't need the ## operator.

ok jsg@

date 2022-02-24T07:41:51Z
author mvs
files src/sys/kern/syscalls.master log diff annotate
message Unlock getsockname(2) syscall. For inet and UNIX sockets it fills passed
'sockaddr' structure with socket's address. For key management and route
domain sockets it just returns error.

ok bluhm@

date 2022-02-24T07:43:02Z
author mvs
files src/sys/kern/init_sysent.c log diff annotate
message regen

date 2022-02-24T07:43:03Z
author mvs
files 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 regen

date 2022-02-24T12:40:35Z
author jsg
files src/sys/dev/pci/drm/amd/amdgpu/amdgpu.h log diff annotate
src/sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c log diff annotate
message drm/amd: Warn users about potential s0ix problems

From Mario Limonciello
64519c9e32ac548fd47cf16767f4b779a8cbdd14 in linux 5.15.y/5.15.25
a6ed2035878e5ad2e43ed175d8812ac9399d6c40 in mainline linux

date 2022-02-24T12:42:54Z
author jsg
files src/sys/dev/pci/drm/amd/amdgpu/amdgpu.h log diff annotate
src/sys/dev/pci/drm/amd/amdgpu/amdgpu_acpi.c log diff annotate
message drm/amd: add support to check whether the system is set to s3

From Mario Limonciello
72808bb42c87c4887c553ea8d9f4ecaf15d867d3 in linux 5.15.y/5.15.25
f52a2b8badbd24faf73a13c9c07fdb9d07352944 in mainline linux

date 2022-02-24T12:45:37Z
author jsg
files src/sys/dev/pci/drm/amd/amdgpu/amdgpu_drv.c log diff annotate
message drm/amd: Only run s3 or s0ix if system is configured properly

From Mario Limonciello
38108fd273acbc6248870a7a3e61714398af6f94 in linux 5.15.y/5.15.25
04ef860469fda6a646dc841190d05b31fae68e8c in mainline linux

date 2022-02-24T12:47:29Z
author jsg
files src/sys/dev/pci/drm/amd/amdgpu/amdgpu_ttm.c log diff annotate
message drm/amdgpu: fix logic inversion in check

From Christian Koenig
0fec53c5dca8a218e20b1d3964db23391a689dff in linux 5.15.y/5.15.25
e8ae38720e1a685fd98cfa5ae118c9d07b45ca79 in mainline linux

date 2022-02-24T12:49:47Z
author jsg
files src/sys/dev/pci/drm/radeon/atombios_encoders.c log diff annotate
message drm/radeon: Fix backlight control on iMac 12,1

From Nicholas Bishop
68f3a4252e9718843bd172f9761267aa288647d0 in linux 5.15.y/5.15.25
364438fd629f7611a84c8e6d7de91659300f1502 in mainline linux

date 2022-02-24T12:52:42Z
author jsg
files src/sys/dev/pci/drm/drm_atomic_uapi.c log diff annotate
message drm/atomic: Don't pollute crtc_state->mode_blob with error pointers

From Ville Syrjala
a1596e0277ed430dc2f44b61ebc2c1ecdab718e4 in linux 5.15.y/5.15.25
439cf34c8e0a8a33d8c15a31be1b7423426bc765 in mainline linux

date 2022-02-24T12:54:50Z
author jsg
files src/sys/dev/pci/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c log diff annotate
message drm/amd/pm: correct the sequence of sending gpu reset msg

From Yifan Zhang
3851046599c1907c956b126bac18c4b84bf6a16b in linux 5.15.y/5.15.25
9c4f59ea3f865693150edf0c91d1cc6b451360dd in mainline linux

date 2022-02-24T12:57:15Z
author jsg
files src/sys/dev/pci/drm/amd/amdgpu/sdma_v4_0.c log diff annotate
message drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.

From Rajib Mahapatra
960c8a55016bece26140eef7a8077e9dc3709098 in linux 5.15.y/5.15.25
f8f4e2a518347063179def4e64580b2d28233d03 in mainline linux

date 2022-02-24T12:59:55Z
author jsg
files src/sys/dev/pci/drm/i915/display/intel_opregion.c log diff annotate
message drm/i915/opregion: check port number bounds for SWSCI display power state

From Jani Nikula
d006f2fe7d627b3ff3f637cf2fa90d30e05887c9 in linux 5.15.y/5.15.25
ea958422291de248b9e2eaaeea36004e84b64043 in mainline linux

date 2022-02-24T13:02:08Z
author jsg
files src/sys/dev/pci/drm/i915/intel_pm.c log diff annotate
message drm/i915: Fix dbuf slice config lookup

From Ville Syrjala
34f5556ddf2b5fc25696832fa4a1a7013fc80a05 in linux 5.15.y/5.15.25
698bef8ff5d2edea5d1c9d6e5adf1bfed1e8a106 in mainline linux

date 2022-02-24T13:04:07Z
author jsg
files src/sys/dev/pci/drm/i915/intel_pm.c log diff annotate
message drm/i915: Fix mbus join config lookup

From Ville Syrjala
fe802b3fe7631c35abbf280702c5d29b867a1150 in linux 5.15.y/5.15.25
8d9d2a723d64b650f2e6423024ccb4a33f0cdc40 in mainline linux

date 2022-02-24T13:06:39Z
author jsg
files src/sys/dev/pci/drm/i915/gem/i915_gem_ttm.c log diff annotate
message drm/i915/ttm: tweak priority hint selection

From Matthew Auld
79bdf56cc55d103f2a276318fd973a296a110b95 in linux 5.15.y/5.15.25
0bdc0a0699929c814a8aecd55d2accb8c11beae2 in mainline linux

date 2022-02-24T13:09:00Z
author jsg
files src/sys/dev/pci/drm/amd/display/dc/clk_mgr/dcn31/dcn31_smu.c log diff annotate
message display/amd: decrease message verbosity about watermarks table failure

From Mario Limonciello
3fd92f5be6c48cce92c90ecf71719582645da888 in linux 5.15.y/5.15.25
03ad3093c7c069d6ab4403730009ebafeea9ee37 in mainline linux

date 2022-02-24T13:11:45Z
author jsg
files src/sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c log diff annotate
message drm/amd/display: Cap pflip irqs per max otg number

From Roman Li
929b2eddebc2cb5ecf220337658f8d8538d4ab9d in linux 5.15.y/5.15.25
328e34a5ad227399391891d454043e5d73e598d2 in mainline linux

date 2022-02-24T13:11:46Z
author jsg
files src/sys/dev/pci/drm/amd/display/dc/dc.h log diff annotate
src/sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c log diff annotate
message drm/amd/display: Cap pflip irqs per max otg number

From Roman Li
929b2eddebc2cb5ecf220337658f8d8538d4ab9d in linux 5.15.y/5.15.25
328e34a5ad227399391891d454043e5d73e598d2 in mainline linux

date 2022-02-24T13:14:18Z
author jsg
files src/sys/dev/pci/drm/amd/display/dc/dcn31/dcn31_hubbub.c log diff annotate
message drm/amd/display: fix yellow carp wm clamping

From Dmytro Laktyushkin
1ddab2ee882900df817dd89882618356b7ecbab3 in linux 5.15.y/5.15.25
60fdf98a774eee244a4e00c34a9e7729b61d0f44 in mainline linux

date 2022-02-24T14:16:53Z
author visa
files src/sys/arch/riscv64/riscv64/vm_machdep.c log diff annotate
message Reserve room for holding curcpu pointer in u-area

The tp register contains the curcpu pointer in kernel mode. The pointer
has to be saved and replaced with the TCB pointer in the register when
entering user mode. These steps are reversed when returning to kernel.
The curcpu pointer is saved in the u-area. Explicitly reserve room for
the pointer to make the saving more visible.

OK kettenis@

date 2022-02-24T14:19:10Z
author visa
files src/sys/arch/riscv64/include/frame.h log diff annotate
src/sys/arch/riscv64/riscv64/vm_machdep.c log diff annotate
message Fix kernel stack alignment on riscv64

Pad trapframe and switchframe structs so that their size is a multiple
of 16 bytes. This makes context switching and exception handlers keep
kernel stack properly aligned.

OK kettenis@

date 2022-02-25T08:33:26Z
author guenther
files src/sys/netinet6/in6.c log diff annotate
message in6_ioctl() is declared in in6_var.h as it's used in if_umb.c, so
don't declare it again in the .c file

ok dlg@ mvs@ bluhm@

date 2022-02-25T08:36:01Z
author guenther
files src/sys/kern/sys_socket.c log diff annotate
src/sys/kern/uipc_proto.c log diff annotate
src/sys/kern/uipc_socket.c log diff annotate
src/sys/kern/uipc_socket2.c log diff annotate
src/sys/kern/uipc_usrreq.c log diff annotate
src/sys/net/if.c log diff annotate
src/sys/net/pfkeyv2.c log diff annotate
src/sys/net/rtsock.c log diff annotate
src/sys/netinet/in_proto.c log diff annotate
src/sys/netinet/ip_divert.c log diff annotate
src/sys/netinet/ip_divert.h log diff annotate
src/sys/netinet/ip_gre.c log diff annotate
src/sys/netinet/ip_gre.h log diff annotate
src/sys/netinet/ip_var.h log diff annotate
src/sys/netinet/raw_ip.c log diff annotate
src/sys/netinet/tcp_usrreq.c log diff annotate
src/sys/netinet/tcp_var.h log diff annotate
src/sys/netinet/udp_usrreq.c log diff annotate
src/sys/netinet/udp_var.h log diff annotate
src/sys/netinet6/in6_proto.c log diff annotate
src/sys/netinet6/ip6_divert.c log diff annotate
src/sys/netinet6/ip6_divert.h log diff annotate
src/sys/netinet6/ip6_var.h log diff annotate
src/sys/netinet6/raw_ip6.c log diff annotate
src/sys/sys/protosw.h log diff annotate
src/sys/sys/unpcb.h log diff annotate
message Move pr_attach and pr_detach to a new structure pr_usrreqs that can
then be shared among protosw structures, following the same basic
direction as NetBSD and FreeBSD for this.

Split PRU_CONTROL out of pr_usrreq into pru_control, giving it the
proper prototype to eliminate the previously necessary casts.

ok mvs@ bluhm@

date 2022-02-25T13:51:02Z
author visa
files src/sys/arch/arm64/arm64/machdep.c log diff annotate
src/sys/arch/arm64/conf/GENERIC log diff annotate
src/sys/arch/arm64/conf/RAMDISK log diff annotate
message Enable cduart(4) on arm64.

OK kettenis@

date 2022-02-25T18:05:49Z
author rob
files src/sys/sys/proc.h log diff annotate
src/sys/sys/sysctl.h log diff annotate
message A few additional changes related to the now 32 bit accounting flag.
Pointers from and discussions with millert and deraadt.
Ok millert@, deraadt@, bluhm@

date 2022-02-25T18:24:01Z
author tedu
files src/sys/kern/kern_pledge.c log diff annotate
message add setrtable to pledge("id"). from Matthew Martin
ok deraadt

date 2022-02-25T22:18:44Z
author bluhm
files src/sys/net/if_pfsync.c log diff annotate
message To fix crashes seen by Hrvoje with pfsync, IPsec and parallel
forwarding, protect tdb flags and lists in pfsync with a mutex.
help and OK sashan@

date 2022-02-25T23:51:03Z
author guenther
files src/sys/kern/sys_socket.c log diff annotate
src/sys/kern/uipc_proto.c log diff annotate
src/sys/kern/uipc_socket.c log diff annotate
src/sys/kern/uipc_socket2.c log diff annotate
src/sys/kern/uipc_usrreq.c log diff annotate
src/sys/net/if.c log diff annotate
src/sys/net/pfkeyv2.c log diff annotate
src/sys/net/rtsock.c log diff annotate
src/sys/netinet/in_proto.c log diff annotate
src/sys/netinet/ip_divert.c log diff annotate
src/sys/netinet/ip_divert.h log diff annotate
src/sys/netinet/ip_gre.c log diff annotate
src/sys/netinet/ip_gre.h log diff annotate
src/sys/netinet/ip_var.h log diff annotate
src/sys/netinet/raw_ip.c log diff annotate
src/sys/netinet/tcp_usrreq.c log diff annotate
src/sys/netinet/tcp_var.h log diff annotate
src/sys/netinet/udp_usrreq.c log diff annotate
src/sys/netinet/udp_var.h log diff annotate
message Reported-by: [email protected]
Revert the pr_usrreqs move: syzkaller found a NULL pointer deref
and I won't be available to monitor for followup issues for a bit

date 2022-02-25T23:51:04Z
author guenther
files src/sys/netinet6/in6.c log diff annotate
src/sys/netinet6/in6_proto.c log diff annotate
src/sys/netinet6/ip6_divert.c log diff annotate
src/sys/netinet6/ip6_divert.h log diff annotate
src/sys/netinet6/ip6_var.h log diff annotate
src/sys/netinet6/raw_ip6.c log diff annotate
src/sys/sys/protosw.h log diff annotate
src/sys/sys/unpcb.h log diff annotate
message Reported-by: [email protected]
Revert the pr_usrreqs move: syzkaller found a NULL pointer deref
and I won't be available to monitor for followup issues for a bit

date 2022-02-26T02:15:45Z
author dlg
files src/sys/net/if_tun.c log diff annotate
message have another go at fixing assert "sc->sc_dev == NUM" failed.

claudio figured it out. his clue was that multiple concurrent calls
to tunopen (or tapopen) will share a vnode. because tunopen can sleep,
multiple programs can be inside tunopen for the same tun interface at
the same time, all with references against the same vnode.

at the same time as this another thread/program can call VOP_REVOKE
via tun_clone_destroy (eg, ifconfig tun1 destroy does this).
VOP_REVOKE marks a vnode as bad, which in turn means that subsequent
open()s of a tun interface will get a brand new vnode.

so multiple threads holding references to a vnode can be sleeping in
tun_dev_open on the interface cloner lock. one thread wins and takes
ownership of the tun interface, then another thread can destroy that tun
interface, calls VOP_REVOKE which calls tun_dev_close to tear down the
vnodes association with the tun interface and mark the vnode as bad.
the thread that called tun_clone_destroy then creates another instance
of the interface by calling tun_clone_create immediately.

one of the original threads with the old vnode reference wakes up and
takes ownership of the new tun_softc. however, because the vnode is bad,
all the vnode ops have been replaced with the deadfs ops. the close() op
on the old vnode is now a nop from the point of view of tun interfaces.
the old vnode is no longer associated with tun and tap and will now
never call tun_dev_close (via tunclose or tapclose), which in turn means
sc_dev won't get cleared.

another thread can now call tun_clone_destroy against the new instance
of tun_softc. this instance has sc_dev set, so it tries to revoke it,
but there's no vnode associated with it because the old vnode reference
is dead.

because this second call to VOP_REVOKE couldnt find a vnode, it
can't call tunclose against it, so sc_dev is still set and this
KASSERT fires.

claudio and i came up with the following, which is to have tun_dev_open
check the state of the vnode associated with the current open call
after all the sleeping and potential tun_clone_destroy and
tun_clone_create calls. if the vnode has been made bad/dead after
all the sleeping, it returns with ENXIO.

Reported-by: [email protected]
ok claudio@ visa@

date 2022-02-26T04:46:34Z
author dlg
files src/sys/net/if_vxlan.c log diff annotate
message add the mbuf tag that prevents loops in vxlan_encap, not vxlan_output.

vxlan_output calls ether_output, which will do arp for ipv4 packets.
if arp hasn't resolved an address for a peer yet, it will queue the
packet and transmit it again after resolution completes. the way
it outputs is to call the interface output routine again, which is
vxlan_output.

if we tag the packet in vxlan_output before arp, and then arp calls
vxlan_output again, it looks like a loop and drops it. moving the
tagging to when we add all the encap headers in vxlan_encap avoids
this issue.

date 2022-02-26T13:38:11Z
author kettenis
files src/sys/dev/pci/pcidevs log diff annotate
message Add Broadcom BCM4387.

date 2022-02-26T13:38:46Z
author kettenis
files src/sys/dev/pci/pcidevs.h log diff annotate
src/sys/dev/pci/pcidevs_data.h log diff annotate
message regen

date 2022-02-27T02:27:55Z
author krw
files src/sys/scsi/sd.c log diff annotate
src/sys/scsi/st.c log diff annotate
message SC_DEBUG() requires an initialized scsi_link. Shuffle
code to make it so.

Pointed out by clang when prodded with SCSIDEBUG.

date 2022-02-27T10:14:01Z
author bluhm
files src/sys/dev/dt/dt_dev.c log diff annotate
src/sys/dev/dt/dtvar.h log diff annotate
message Fix whitespace and uninitialized variable in dt(4).
OK mpi@

date 2022-02-27T17:36:52Z
author kettenis
files src/sys/arch/arm64/dev/apldart.c log diff annotate
message Adjust definition of DART_L1_TABLE to what Linux uses.

ok jsg@

date 2022-02-28T00:12:11Z
author dlg
files src/sys/net/if_etherip.c log diff annotate
message add the mbuf tags that prevent output loops.

mostly copied from vxlan where the tag is checked in output and
set in encap. etherip appears to be one of the first drivers i
reworked, so it's a bit crufty. the ipv4 vs ipv6 handling could
be done better.

date 2022-02-28T02:40:16Z
author jsg
files src/sys/dev/pci/drm/drm_linux.c log diff annotate
src/sys/dev/pci/drm/include/linux/pci.h log diff annotate
message add pcie_aspm_enabled() for the next linux 5.15.y release

date 2022-02-28T09:01:29Z
author jsg
files src/sys/dev/pci/drm/include/linux/pm_qos.h log diff annotate
src/sys/dev/pci/drm/include/linux/radix-tree.h log diff annotate
message remove some unused defines

date 2022-02-28T14:48:11Z
author krw
files src/sys/scsi/scsi_base.c log diff annotate
src/sys/scsi/scsi_debug.h log diff annotate
src/sys/scsi/scsiconf.c log diff annotate
message Shuffle some SCSIDEBUG code to simplify code, tersify the
emitted verbiage, and show INQUIRY header & vendor info early so
humans can more easily determine what scsi_probe_link() will
do.

No functional change outside SCSIDEBUG.

date 2022-02-28T15:49:57Z
author visa
files src/sys/arch/mips64/mips64/trap.c log diff annotate
message Remove unneeded symbol name lookup.

date 2022-02-28T15:51:02Z
author kettenis
files src/sys/arch/arm64/dev/apldart.c log diff annotate
message The IOMMUs integrated on Apple's M1 Pro/MaxJ SoC use a different page table
layout where the physical (CPU) address needs to be shifted to allow for the
larger physical address space implemented in these SoCs. Make apldart(4)
handle this new page table layout based on the compatible property.

ok jsg@

date 2022-03-01T04:08:03Z
author jsg
files src/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c log diff annotate
message change some defines to static inline functions

date 2022-03-01T04:08:04Z
author jsg
files src/sys/dev/pci/drm/i915/i915_drv.c log diff annotate
src/sys/dev/pci/drm/include/acpi/video.h log diff annotate
src/sys/dev/pci/drm/include/asm/iosf_mbi.h log diff annotate
src/sys/dev/pci/drm/include/linux/aer.h log diff annotate
src/sys/dev/pci/drm/include/linux/backlight.h log diff annotate
src/sys/dev/pci/drm/include/linux/bottom_half.h log diff annotate
src/sys/dev/pci/drm/include/linux/console.h log diff annotate
src/sys/dev/pci/drm/include/linux/dma-buf.h log diff annotate
src/sys/dev/pci/drm/include/linux/dma-direction.h log diff annotate
src/sys/dev/pci/drm/include/linux/dma-mapping.h log diff annotate
src/sys/dev/pci/drm/include/linux/i2c.h log diff annotate
src/sys/dev/pci/drm/include/linux/idr.h log diff annotate
src/sys/dev/pci/drm/include/linux/kmemleak.h log diff annotate
src/sys/dev/pci/drm/include/linux/pci.h log diff annotate
src/sys/dev/pci/drm/include/linux/pm_qos.h log diff annotate
src/sys/dev/pci/drm/include/linux/pm_runtime.h log diff annotate
src/sys/dev/pci/drm/include/linux/preempt.h log diff annotate
src/sys/dev/pci/drm/include/linux/random.h log diff annotate
src/sys/dev/pci/drm/include/linux/reboot.h log diff annotate
src/sys/dev/pci/drm/include/linux/swap.h log diff annotate
src/sys/dev/pci/drm/include/linux/timekeeping.h log diff annotate
src/sys/dev/pci/drm/include/linux/vga_switcheroo.h log diff annotate
src/sys/dev/pci/drm/include/linux/workqueue.h log diff annotate
message change some defines to static inline functions

date 2022-03-01T04:08:05Z
author jsg
files src/sys/dev/pci/drm/include/media/cec-notifier.h log diff annotate
src/sys/dev/pci/drm/include/trace/events/dma_fence.h log diff annotate
src/sys/dev/pci/drm/radeon/radeon_kms.c log diff annotate
src/sys/dev/pci/drm/ttm/ttm_pool.c log diff annotate
message change some defines to static inline functions

date 2022-03-01T08:07:38Z
author jsg
files src/sys/dev/pci/drm/amd/amdgpu/amdgpu.h log diff annotate
src/sys/dev/pci/drm/i915/i915_perf.c log diff annotate
src/sys/dev/pci/drm/i915/i915_perf_types.h log diff annotate
message change some defines to static inline functions

date 2022-03-01T08:07:39Z
author jsg
files src/sys/dev/pci/drm/include/linux/ratelimit.h log diff annotate
message change some defines to static inline functions

date 2022-03-01T11:50:37Z
author jsg
files src/sys/dev/pci/drm/drm_linux.c log diff annotate
src/sys/dev/pci/drm/include/linux/i2c.h log diff annotate
message __i2c_transfer() should not lock the bus
i2c_transfer() locks the bus

date 2022-03-01T20:45:27Z
author kettenis
files src/sys/arch/arm64/dev/apldart.c log diff annotate
message The display controller sits behind a DART. We must make sure we keep
that DART enabled with the mappings provided by the firmware. Otherwise
the display controller can no longer access the framebuffer and the
display goes black.

ok jsg@

date 2022-03-01T21:29:10Z
author kettenis
files src/sys/arch/arm64/dev/aplintc.c log diff annotate
message Apple M1 Pro/Max SoCs come with a new version of the interrupt controller.
This version appears to be more scalable (supports more cores, more
interrupts) but is still fairly similar to the previous generation so
it makes sense for them to share a driver. One major difference is that
it seems that the new interrupt controller no longer has the ability to
have external interrupts target specific CPU cores. Instead it delivers
them to whichever core is willing to handle the interrupt. Since this
currently isn't compatible with what OpenBSD wants we disable the
delivery of external interrupts to the secondary cores by setting some
bits in an implementation-defined system register.

This makes OpenBSD run on M1 Pro/Max machines.

ok jsg@

date 2022-03-01T23:53:03Z
author bluhm
files src/sys/netinet/in_pcb.c log diff annotate
message Remove outdated comment about v4-mapped v6 addresses. They are not
supported anymore.