OpenBSD cvs log

created 2021-11-21T19:48:58Z
begin 2021-10-27T00:00:00Z
end 2021-11-03T00:00:00Z
path src/sys
commits 55

date 2021-10-27T03:24:44Z
author visa
files src/sys/kern/syscalls.master log diff annotate
message Unlock the kevent(2) system call.

Tested by mpi@ and tb@

OK mpi@

date 2021-10-27T03:25:11Z
author visa
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 regen

date 2021-10-27T09:09:55Z
author jasper
files src/sys/dev/dt/dtvar.h log diff annotate
src/sys/dev/usb/udl.c log diff annotate
message fix spello in comment

date 2021-10-27T13:41:09Z
author mvs
files src/sys/kern/uipc_socket2.c log diff annotate
message Replace 'DIAGNOSTIC' block within soqinsque() by KASSERT(9).

ok sashan@

date 2021-10-27T15:18:12Z
author jasper
files src/sys/dev/dt/dt_prov_kprobe.c log diff annotate
message use db_get_probe_addr() instead of handrolling the expression wrapped in ifdef

ok mpi@

date 2021-10-27T16:58:44Z
author bluhm
files src/sys/netinet/ip_ipsp.c log diff annotate
message The crypto layer needs the kernel lock. ah_zeroize() takes it when
called from tdb_walk(). tdb_walk() needs mutex tdb_sadb_mtx to
protect the loop traversal. First take the kernel lock in tdb_walk()
to preserve lock order.
found by witness
OK tobhe@ mvs@

date 2021-10-27T21:21:35Z
author jasper
files src/sys/ddb/db_ctf.c log diff annotate
message extend checks of ensuring there's valid CTF data before attempting to use it.

date 2021-10-28T08:47:40Z
author jasper
files src/sys/dev/dt/dt_prov_kprobe.c log diff annotate
message add proper declaration for addr in dt_prov_kprobe_hook

date 2021-10-29T13:24:50Z
author ratchov
files src/sys/dev/midi.c log diff annotate
message Don't grab audio_lock in filt_midi{read,write} if NOTE_SUBMIT is set.

Fixes panics caused by attempts to grab audio_lock twice in the
interrupt code path: once in the low-lever interrupt handler and once
in selwakeup()

This is exactly how audio(4) handles this problem.

ok mpi

date 2021-10-29T14:22:26Z
author jsg
files src/sys/dev/usb/usbdevs log diff annotate
message more Prolific HXN ids
ok deraadt@ robert@ patrick@

date 2021-10-29T14:23:07Z
author jsg
files src/sys/dev/usb/usbdevs.h log diff annotate
src/sys/dev/usb/usbdevs_data.h log diff annotate
message regen

date 2021-10-29T14:25:05Z
author jsg
files src/sys/dev/usb/uplcom.c log diff annotate
message match more Prolific HXN ids
tested by robert@ on PL2303GT
ok deraadt@ robert@ patrick@

date 2021-10-29T15:43:55Z
author anton
files src/sys/dev/usb/uhidev.h log diff annotate
message A USB HID report ID must be represented using a single byte ranging
between 1-255 where 0 is reserved. The pseudo report ID
UHIDEV_CLAIM_MULTIPLE_REPORTID is currently colliding with the valid
report ID 255. Therefore crank it which gets rid of the collision and
increase the related fields in order to cope with larger integers.

Thanks to Damien Couderc <openbsd at petrocore dot eu> for reporting and
testing.

date 2021-10-29T15:52:44Z
author anton
files src/sys/kern/sys_generic.c log diff annotate
message poll needs similar treatment as select recently gained in order to not
mask failed kqueue_register() attempts which in turn causes the thread to
end up sleeping as opposed of propagating the failure to user space.

Regression introduced in the recent switch to implement poll on top of
kqueue.

Thanks to Larry Hynes <larry at larryhynes dot com> for reporting and
Leah Neukirchen <leah at vuxu dot org> for providing a reproducer; which
also already made its way into regress.

ok mpi@

date 2021-10-30T03:22:08Z
author jsg
files src/sys/dev/pci/pcidevs log diff annotate
message add Intel 600 Series and Alder Lake S ids

described in
648364-001 Intel 600 Series Chipset Family Platform Controller Hub Datasheet
655258-001 12th Generation Intel Core Processors Datasheet

date 2021-10-30T03:22:44Z
author jsg
files src/sys/dev/pci/pcidevs.h log diff annotate
src/sys/dev/pci/pcidevs_data.h log diff annotate
message regen

date 2021-10-30T03:24:59Z
author jsg
files src/sys/dev/pci/azalia.c log diff annotate
message enable snooping on Intel 600 Series

date 2021-10-30T03:27:35Z
author jsg
files src/sys/dev/pci/dwiic_pci.c log diff annotate
src/sys/dev/pci/ichiic.c log diff annotate
src/sys/dev/pci/pucdata.c log diff annotate
message match on Intel 600 Series

date 2021-10-30T11:56:19Z
author ratchov
files src/sys/dev/usb/uhidev.h log diff annotate
message Revert previous commit as it's causing panic when devices are detached

ok sthen, anton

date 2021-10-30T12:26:26Z
author ratchov
files src/sys/dev/midi.c log diff annotate
src/sys/dev/midivar.h log diff annotate
message Defer selwakeup() calls to a softintr

selwakeup() needs to be protected by KERNEL_LOCK, but we're not
allowed to grab KERNEL_LOCK on interrupt context because midi runs at
IPL_AUDIO with the audio_lock held. Furthermore, doing so is a locking
order bug: syscall code-path grabs KERNEL_LOCK first while interrupt
code-path does the opposite when calling selwakeup().

ok visa

date 2021-10-30T12:40:55Z
author ratchov
files src/sys/dev/midi.c log diff annotate
message Disestablish softintrs upon detach (missed in last commit)

During detach, we can't rely on softintrs to signal processes blocked
in read, write or poll, so we need to explicitely call wakeup
functions in the detach method, as other drivers do.

date 2021-10-30T12:48:11Z
author ratchov
files src/sys/dev/midi.c log diff annotate
message Fix build break caused by accidental keystroke during last commit

date 2021-10-30T14:50:54Z
author kettenis
files src/sys/arch/arm64/dev/aplpinctrl.c log diff annotate
message Add GPIO functionality (including support for using GPIOs as interrupt pins).
Needed for upcoming Apple M1 laptop keyboard support.

ok patrick@

date 2021-10-30T16:24:18Z
author mvs
files src/sys/kern/uipc_usrreq.c log diff annotate
message Fix the UNIX domain sockets leak in soclose().

Each listening socket has two queues, the `so_q0' where partial connected
sockets linked and the `so_q' where connected but not yet accept(2)ed
sockets linked. Such sockets has no file descriptor allocated, so they
have no access from the userland. When the socket linked to `so_q0' or
`so_q' it has it's `so_head' pointed to the listening socket. The userland
receive sockets from `so_q' by accept(2) which allocates the file
descriptor to the socket.

When userland close(2) listening socket, soclose() should release the
sockets linked to `so_q0' and `so_q' because it's the only place where
they are referenced. It removes the socket from the queue by soqremque().
Since socket is not in the queue it's `so_head' is NULL. Then the socket
passed to soabort() which should destroy it by (*pr_usrreq)() call with
'PRU_ABORT' request.

In UNIX domain sockets layer the unp_drop() only disconnects passed socket
and doesn't destroy it because it's `so_head' is NULL. This socket has the
only access by the UNIX domain sockets garbage collector which leaves it
alive, so the socket is permanently leaked.

This leak was introduced in the revision 1.26 of sys/uipc_socket.c when
soqremque() was placed before soabort(). To fix this the unp_drop() was
replaced by unp_detach() and sofree() in the 'PRU_ABORT' path. unp_drop()
only sets the error and disconnects passed socket. We don't expose this
error and unp_detach() also disconnects the socket before destroy it's
protocol control block. sofree() destroys the rest.

The socket passed to soabort() has no vnode(9) associated, so unp_detach()
don't release `unp_lock'. Also this socket never had associated file
descriptor so it already has 'SS_NOFDREF' flag set.

This diff was also applied to 6.9 and 7.0 branches as errata.

date 2021-10-30T16:35:31Z
author mvs
files src/sys/kern/uipc_usrreq.c log diff annotate
message Kill the dead code from unp_drop().

The unp_drop() was removed from the 'PRU_ABORT' path in the previous
commit. Now it only remains in the unp_detach() where disconnects the
connected datagram sockets linked to the `unp_link' list. Such sockets
always have the associated file descriptor and never had been linked to
the `so_q0' or `so_q' of listening socket so their `so_head' is always
NULL.

ok millert@ sashan@ mpi@

date 2021-10-30T23:24:46Z
author deraadt
files src/sys/dev/acpi/acpi.c log diff annotate
message Change hw.perfpolicy=auto by default, at startup. If the system has AC
power connected (default is yes when no driver differentiates) then default
to 100% performance. On battery, use the existing auto algorithm (which is
admittedly somewhat unrefined).
This change overrides the system/BIOS speed and puts OpenBSD in control.
As this happens very early during boot, besides speedups in all usage usage
patterns, some surprises: unhibernate and sysupgrade times are cut in half.
note: on a few architectures, the setperf fn pointer is changed late, and
thus the auto algorithm stops timeing out. kettenis and i will look for
a solution.
in snaps for more than a week.
ok kettenis

date 2021-10-30T23:24:47Z
author deraadt
files src/sys/dev/acpi/acpiac.c log diff annotate
message Change hw.perfpolicy=auto by default, at startup. If the system has AC
power connected (default is yes when no driver differentiates) then default
to 100% performance. On battery, use the existing auto algorithm (which is
admittedly somewhat unrefined).
This change overrides the system/BIOS speed and puts OpenBSD in control.
As this happens very early during boot, besides speedups in all usage usage
patterns, some surprises: unhibernate and sysupgrade times are cut in half.
note: on a few architectures, the setperf fn pointer is changed late, and
thus the auto algorithm stops timeing out. kettenis and i will look for
a solution.
in snaps for more than a week.
ok kettenis

date 2021-10-30T23:24:48Z
author deraadt
files src/sys/kern/kern_sysctl.c log diff annotate
src/sys/kern/sched_bsd.c log diff annotate
src/sys/sys/sysctl.h log diff annotate
message Change hw.perfpolicy=auto by default, at startup. If the system has AC
power connected (default is yes when no driver differentiates) then default
to 100% performance. On battery, use the existing auto algorithm (which is
admittedly somewhat unrefined).
This change overrides the system/BIOS speed and puts OpenBSD in control.
As this happens very early during boot, besides speedups in all usage usage
patterns, some surprises: unhibernate and sysupgrade times are cut in half.
note: on a few architectures, the setperf fn pointer is changed late, and
thus the auto algorithm stops timeing out. kettenis and i will look for
a solution.
in snaps for more than a week.
ok kettenis

date 2021-10-31T12:17:54Z
author stsp
files src/sys/dev/usb/if_run.c log diff annotate
message Raise SPL to IPL_NET in run_next_scan() to avoid splassert failures.

Problem found and fix tested by krw@.
ok krw@

date 2021-10-31T12:22:48Z
author stsp
files src/sys/dev/usb/usbdevs log diff annotate
message Add USB device ID for the Sony UWA-BR100. Patch by martingot@protonmail

date 2021-10-31T12:23:17Z
author stsp
files src/sys/dev/usb/usbdevs.h log diff annotate
src/sys/dev/usb/usbdevs_data.h log diff annotate
message regen

date 2021-10-31T12:24:02Z
author stsp
files src/sys/dev/usb/if_athn_usb.c log diff annotate
message Make athn(4) attach to the Sony UWA-BR100. Patch by martingot@protonmail

date 2021-10-31T14:41:00Z
author patrick
files src/sys/dev/pci/pcidevs log diff annotate
message Add another PCI id for Intel 2.5Gb adapters.

date 2021-10-31T14:41:53Z
author patrick
files src/sys/dev/pci/pcidevs.h log diff annotate
src/sys/dev/pci/pcidevs_data.h log diff annotate
message regen

date 2021-10-31T14:52:57Z
author patrick
files src/sys/dev/pci/files.pci log diff annotate
src/sys/dev/pci/if_igc.c log diff annotate
src/sys/dev/pci/if_igc.h log diff annotate
src/sys/dev/pci/igc_api.c log diff annotate
src/sys/dev/pci/igc_api.h log diff annotate
src/sys/dev/pci/igc_base.c log diff annotate
src/sys/dev/pci/igc_base.h log diff annotate
src/sys/dev/pci/igc_defines.h log diff annotate
src/sys/dev/pci/igc_hw.h log diff annotate
src/sys/dev/pci/igc_i225.c log diff annotate
src/sys/dev/pci/igc_i225.h log diff annotate
src/sys/dev/pci/igc_mac.c log diff annotate
src/sys/dev/pci/igc_mac.h log diff annotate
src/sys/dev/pci/igc_nvm.c log diff annotate
src/sys/dev/pci/igc_nvm.h log diff annotate
src/sys/dev/pci/igc_phy.c log diff annotate
src/sys/dev/pci/igc_phy.h log diff annotate
src/sys/dev/pci/igc_regs.h log diff annotate
message Add igc(4), a driver for the Intel 2.5Gb Ethernet controllers.

Ported by kevlo@
ok jmatthew@

date 2021-10-31T15:02:25Z
author patrick
files src/sys/dev/pci/if_igc.c log diff annotate
message Move the fill and the tail pointer change to a later point, to make sure
that the RDT is written, and that it is written not too early. Doing it
before writing IGC_RXDCTL definitely doesn't work.

The tail pointer needs to be set to the next empty slot, so it has to be
"last desc filled + 1".

Make sure sure that the rss mapping does not happen in the middle of the
RX checksum block, and that it happens only if nqueues > 1. Also disable
storing bad packets.

With this, igc(4) receives packets just fine.

ok kevlo@

date 2021-10-31T15:12:00Z
author kettenis
files src/sys/dev/fdt/imxspi.c log diff annotate
src/sys/dev/fdt/mvspi.c log diff annotate
src/sys/dev/spi/spivar.h log diff annotate
message Extend the SPI bus API a bit. The config structure gets an sc_cs_delay
member to allow us to specify a delay between assert the CS# signal and
starting the clock. And the transfer function gains a flags argument,
which can be used to specify a new SPI_KEEP_CS flag to keep CS# asserted
after the transfer. This allows us to do another transfer immediately
afterwards without de-asserting CS# which is necessary for sending
commands to the upcoming Apple M1 keyboard/touchpad driver.

ok patrick@

date 2021-10-31T15:22:40Z
author patrick
files src/sys/dev/pci/if_igc.c log diff annotate
message Implement transmit and transmit completion path.

date 2021-10-31T15:25:10Z
author patrick
files src/sys/dev/pci/if_igc.c log diff annotate
message Disable both TCP/UDP checksum offloading and VLAN HW tag offloading for now,
as we currently configure neither in the transmit code path.

Found by sf@

date 2021-10-31T16:38:12Z
author kettenis
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/aplspi.c log diff annotate
message Add aplspi(4), a driver for the SPI controller found on the Apple M1 SoC.

ok patrick@

date 2021-11-01T03:29:53Z
author jsg
files src/sys/dev/pci/drm/include/linux/power_supply.h log diff annotate
message use hw_power to implement power_supply_is_system_supplied()

date 2021-11-01T09:02:46Z
author kettenis
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/aplhidev.c log diff annotate
message Add support for the keyboard/touchpad on Apple M1 laptops.

ok patrick@

date 2021-11-01T09:19:10Z
author bluhm
files src/sys/netinet/ipsec_input.c log diff annotate
message In ipsec_common_input_cb() pass mbuf pointer to pf_test() so that
all callers get an update if the mbuf changes.
OK tobhe@

date 2021-11-01T12:08:46Z
author krw
files src/sys/dev/usb/if_run.c log diff annotate
message Restore some NULL checks lost in r1.132, add a couple more to deal with WEP key
installation happening w/o a node, and don't attempt to set WEP keys that don't
exist.

Should fix the '(null node)' panics reported by James Hastings.

ok stsp@

date 2021-11-01T13:53:59Z
author kettenis
files src/sys/lib/libkern/crc16.h log diff annotate
message Add CRC-16 implementation. From NetBSD.

ok krw@, deraadt@

date 2021-11-01T14:44:10Z
author kn
files src/sys/.gitignore log diff annotate
message Ignore obj like in src

sys/ only checkouts are common, especiall in got(1) times, but they don't
include the global .gitignore which is annoying.

Duplicate it here.

OK sthen

date 2021-11-01T18:43:04Z
author fcambus
files src/sys/dev/wsfont/wsfont.c log diff annotate
message Enable spleen16x32 and spleen32x64 on riscv64 for GENERIC kernels.

OK deraadt@

date 2021-11-01T20:04:11Z
author kettenis
files src/sys/arch/arm64/dev/apldart.c log diff annotate
message Catch up with the Linux device tree bindings. Put the USB DARTs into bypass
mode for now as we need to enter translations into both of them which is
hard to do now that they have separate device tree bindings.

date 2021-11-01T20:22:12Z
author kettenis
files src/sys/arch/arm64/dev/aplpcie.c log diff annotate
message Remove backwards compat code.

date 2021-11-02T02:17:56Z
author deraadt
files src/sys/dev/acpi/acpi.c log diff annotate
message knf

date 2021-11-02T08:25:47Z
author patrick
files src/sys/arch/amd64/conf/GENERIC log diff annotate
message Enable igc(4).

Tested by kevlo@

date 2021-11-02T09:52:40Z
author dlg
files src/sys/dev/usb/uchcom.c log diff annotate
message add handling for parity and character size config.

i wanted to talk modbus to a thing using a uchcom rs485 adapter,
but i needed even parity enabled to do that which the code didnt
support. this pulls in the necessary changes from netbsd uchcom.c
r1.26. it does not pull in the reset changes in 1.26 because netbsd
r1.28 reverts the reset code back to what we have now.

existing functionality tested by felix kronlage-dammers
ok patrick@

date 2021-11-02T14:49:53Z
author patrick
files src/sys/dev/sdmmc/if_bwfm_sdio.c log diff annotate
message Recognize BCM43436, as seen on the Raspberry Pi Zero 2 W.

ok jsg@

date 2021-11-02T16:31:27Z
author fcambus
files src/sys/dev/wsfont/wsfont.c log diff annotate
message Enable spleen16x32 and spleen32x64 on powerpc64 for GENERIC kernels.

Pointed out by Brad, thanks!

OK kettenis@, deraadt@

date 2021-11-02T23:30:15Z
author mlarkin
files src/sys/arch/amd64/amd64/identcpu.c log diff annotate
message Remove trailing whitespace