OpenBSD cvs log

created 2023-08-08T22:12:03Z
begin 2022-10-25T00:00:00Z
end 2022-11-01T00:00:00Z
path src/sys
commits 37

date 2022-10-25T06:00:34Z
author guenther
files src/sys/arch/sparc64/sparc64/db_trace.c log diff annotate
message rwindow32 is gone and won't be coming back. ok miod@

date 2022-10-25T06:05:57Z
author guenther
files src/sys/arch/sparc64/include/asm.h log diff annotate
src/sys/arch/sparc64/sparc64/machdep.c log diff annotate
src/sys/arch/sparc64/sparc64/vm_machdep.c log diff annotate
message STACK_OFFSET was to support it varying when compiling some code for
either 32bit or 64bit. With the elimination of 32bit sparc bits
it was just a superfluous indirection of BIAS. Also, CCFSZ is gone.

ok miod@

date 2022-10-25T11:39:33Z
author aoyama
files src/sys/arch/luna88k/luna88k/machdep.c log diff annotate
message Add more chance to process IPI in the interrupt service routine.

This prevents "luna88k_ext_int: cpu0 level 1 interrupt" message on
heavy load.

"This makes sense" miod@, tested by me.

date 2022-10-25T15:15:38Z
author guenther
files src/sys/arch/alpha/alpha/locore.s log diff annotate
src/sys/arch/alpha/alpha/vm_machdep.c log diff annotate
src/sys/arch/alpha/include/cpu.h log diff annotate
src/sys/arch/hppa/hppa/locore.S log diff annotate
src/sys/arch/hppa/hppa/vm_machdep.c log diff annotate
src/sys/arch/hppa/include/cpu.h log diff annotate
src/sys/arch/macppc/macppc/locore.S log diff annotate
src/sys/arch/powerpc/powerpc/vm_machdep.c log diff annotate
message Consistently use 'proc_trampoline' as the name of the trampoline
used by cpu_fork()

ok miod@ kettenis@ mpi@ deraadt@

date 2022-10-25T16:08:26Z
author kettenis
files src/sys/kern/kern_exit.c log diff annotate
src/sys/sys/siginfo.h log diff annotate
src/sys/sys/wait.h log diff annotate
message Implement waitid(2) which is now part of POSIX and used by mozilla.
This includes a change of siginfo_r which is technically an ABI break but
this should have no real-world impact since the members involved are
never touched by the kernel.

ok millert@, deraadt@

date 2022-10-25T16:10:31Z
author kettenis
files src/sys/kern/syscalls.master log diff annotate
message mplement waitid(2) which is now part of POSIX and used by mozilla.
This includes a change of siginfo_r which is technically an ABI break but
this should have no real-world impact since the members involved are
never touched by the kernel.

ok millert@, deraadt@

date 2022-10-25T16:11:29Z
author kettenis
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 2022-10-25T16:30:30Z
author millert
files src/sys/sys/_time.h log diff annotate
message Move CLOCKS_PER_SEC to sys/_time.h so the kernel has access to it.
This will be used in waitid(2) to set si_utime and si_stime.
The definition of struct timespec also moves from time.h to sys/_time.h
for struct itimerspec. OK kettenis@

date 2022-10-25T18:44:36Z
author miod
files src/sys/arch/hppa/hppa/pmap.c log diff annotate
src/sys/arch/hppa/include/pmap.h log diff annotate
message Store mod/ref flags using md pg_flags values rather than a specific field in
vm_page_md, which allows this struct to shrink a bit.

date 2022-10-25T19:32:18Z
author mglocker
files src/sys/dev/i2c/pijuice.c log diff annotate
message Calculate approx. battery re-charge time.

date 2022-10-26T13:31:06Z
author kettenis
files src/sys/kern/kern_exit.c log diff annotate
message Fix handling of PGIDs in wait4(2) that I broke with the previous commit.

ok anton@, millert@

date 2022-10-26T16:06:42Z
author kn
files src/sys/dev/acpi/acpisbs.c log diff annotate
message Constify battery check table

OK jcs

date 2022-10-26T16:07:28Z
author kn
files src/sys/dev/usb/ubcmtp.c log diff annotate
message Constify device table

OK jcs

date 2022-10-26T20:19:06Z
author kn
files src/sys/arch/hppa/gsc/harmony.c log diff annotate
message Make audio(9) get_props() optional, remove it from duplex drivers

The property bits of audio(9) are obsolete and ought to be removed
completely.

sys/dev/audio.c:audio_open() currently uses get_props() to bail out if
read *and* write was requested on a non-duplex driver.

Drivers that currently support playing but not recording need adjustment
before the API can be cleaned up.

Drivers that advertise themselves as full duplex, i.e. those that always
return AUDIO_PROP_FULLDUPLEX unconditionally in their get_props() currently
always succeed this check.

As this is the only property, losen audio_open()'s DIAGNOSTIC check and only
do the duplex check if the driver provides get_props().

This allows for simple removal of get_props() from full-duplex drivers
without adding any other code or without changing functionality.

This includes all audio drivers under sys/dev/pci/ (maestro(4) being the
only unfinished exception here).

Other drivers as well as the API change can then follow in smaller diffs.

This builds on amd64, arm64, i386, macppc and sparc64.
amd64 with azalia(4) still plays, records as well as plays and records
at the same time on my X230 as tested with

$ aucat -i play.wav [-o rec.wav]

alpha and hppa tests by miod
OK ratchov miod

date 2022-10-26T20:19:07Z
author kn
files src/sys/arch/macppc/dev/aoa.c log diff annotate
src/sys/arch/macppc/dev/awacs.c log diff annotate
src/sys/arch/macppc/dev/daca.c log diff annotate
src/sys/arch/macppc/dev/i2s.c log diff annotate
src/sys/arch/macppc/dev/i2svar.h log diff annotate
src/sys/arch/macppc/dev/onyx.c log diff annotate
src/sys/arch/macppc/dev/snapper.c log diff annotate
src/sys/arch/macppc/dev/tumbler.c log diff annotate
src/sys/arch/sparc64/dev/ce4231.c log diff annotate
src/sys/dev/audio.c log diff annotate
src/sys/dev/ic/am7930.c log diff annotate
src/sys/dev/ic/am7930var.h log diff annotate
src/sys/dev/pci/auacer.c log diff annotate
message Make audio(9) get_props() optional, remove it from duplex drivers

The property bits of audio(9) are obsolete and ought to be removed
completely.

sys/dev/audio.c:audio_open() currently uses get_props() to bail out if
read *and* write was requested on a non-duplex driver.

Drivers that currently support playing but not recording need adjustment
before the API can be cleaned up.

Drivers that advertise themselves as full duplex, i.e. those that always
return AUDIO_PROP_FULLDUPLEX unconditionally in their get_props() currently
always succeed this check.

As this is the only property, losen audio_open()'s DIAGNOSTIC check and only
do the duplex check if the driver provides get_props().

This allows for simple removal of get_props() from full-duplex drivers
without adding any other code or without changing functionality.

This includes all audio drivers under sys/dev/pci/ (maestro(4) being the
only unfinished exception here).

Other drivers as well as the API change can then follow in smaller diffs.

This builds on amd64, arm64, i386, macppc and sparc64.
amd64 with azalia(4) still plays, records as well as plays and records
at the same time on my X230 as tested with

$ aucat -i play.wav [-o rec.wav]

alpha and hppa tests by miod
OK ratchov miod

date 2022-10-26T20:19:08Z
author kn
files src/sys/dev/pci/auglx.c log diff annotate
src/sys/dev/pci/auich.c log diff annotate
src/sys/dev/pci/auixp.c log diff annotate
src/sys/dev/pci/autri.c log diff annotate
src/sys/dev/pci/auvia.c log diff annotate
src/sys/dev/pci/azalia.c log diff annotate
src/sys/dev/pci/cmpci.c log diff annotate
src/sys/dev/pci/cs4280.c log diff annotate
src/sys/dev/pci/cs4281.c log diff annotate
src/sys/dev/pci/eap.c log diff annotate
src/sys/dev/pci/emuxki.c log diff annotate
src/sys/dev/pci/envy.c log diff annotate
src/sys/dev/pci/esa.c log diff annotate
src/sys/dev/pci/eso.c log diff annotate
src/sys/dev/pci/fms.c log diff annotate
src/sys/dev/pci/neo.c log diff annotate
src/sys/dev/pci/sv.c log diff annotate
src/sys/dev/pci/yds.c log diff annotate
message Make audio(9) get_props() optional, remove it from duplex drivers

The property bits of audio(9) are obsolete and ought to be removed
completely.

sys/dev/audio.c:audio_open() currently uses get_props() to bail out if
read *and* write was requested on a non-duplex driver.

Drivers that currently support playing but not recording need adjustment
before the API can be cleaned up.

Drivers that advertise themselves as full duplex, i.e. those that always
return AUDIO_PROP_FULLDUPLEX unconditionally in their get_props() currently
always succeed this check.

As this is the only property, losen audio_open()'s DIAGNOSTIC check and only
do the duplex check if the driver provides get_props().

This allows for simple removal of get_props() from full-duplex drivers
without adding any other code or without changing functionality.

This includes all audio drivers under sys/dev/pci/ (maestro(4) being the
only unfinished exception here).

Other drivers as well as the API change can then follow in smaller diffs.

This builds on amd64, arm64, i386, macppc and sparc64.
amd64 with azalia(4) still plays, records as well as plays and records
at the same time on my X230 as tested with

$ aucat -i play.wav [-o rec.wav]

alpha and hppa tests by miod
OK ratchov miod

date 2022-10-26T20:19:09Z
author kn
files src/sys/dev/sbus/cs4231.c log diff annotate
src/sys/dev/tc/bba.c log diff annotate
src/sys/dev/usb/uaudio.c log diff annotate
message Make audio(9) get_props() optional, remove it from duplex drivers

The property bits of audio(9) are obsolete and ought to be removed
completely.

sys/dev/audio.c:audio_open() currently uses get_props() to bail out if
read *and* write was requested on a non-duplex driver.

Drivers that currently support playing but not recording need adjustment
before the API can be cleaned up.

Drivers that advertise themselves as full duplex, i.e. those that always
return AUDIO_PROP_FULLDUPLEX unconditionally in their get_props() currently
always succeed this check.

As this is the only property, losen audio_open()'s DIAGNOSTIC check and only
do the duplex check if the driver provides get_props().

This allows for simple removal of get_props() from full-duplex drivers
without adding any other code or without changing functionality.

This includes all audio drivers under sys/dev/pci/ (maestro(4) being the
only unfinished exception here).

Other drivers as well as the API change can then follow in smaller diffs.

This builds on amd64, arm64, i386, macppc and sparc64.
amd64 with azalia(4) still plays, records as well as plays and records
at the same time on my X230 as tested with

$ aucat -i play.wav [-o rec.wav]

alpha and hppa tests by miod
OK ratchov miod

date 2022-10-27T13:19:42Z
author patrick
files src/sys/dev/usb/usbdevs log diff annotate
message Add USB device id for integrated ure(4) on Windows Dev Kit 2023

ok jsg@

date 2022-10-27T13:20:16Z
author patrick
files src/sys/dev/usb/usbdevs.h log diff annotate
src/sys/dev/usb/usbdevs_data.h log diff annotate
message regen

date 2022-10-27T13:21:14Z
author patrick
files src/sys/dev/usb/if_ure.c log diff annotate
message Match ure(4) on Windows Dev Kit 2023

ok jsg@

date 2022-10-27T16:01:18Z
author deraadt
files src/sys/kern/exec_elf.c log diff annotate
message VMCMD_SYSCALL cannot be incorporated into flags variable, because flags
is inspected narrowly for base address later.
ok kettenis

date 2022-10-27T22:48:17Z
author deraadt
files src/sys/kern/exec_elf.c log diff annotate
src/sys/sys/exec.h log diff annotate
message Unfortunately there are still ugly text-relocation binaries in the wild.
Libraries are less of a concern, because ld.so can fix them in the right
order. So we must scan DYNAMIC for the TEXTREL marker, and not make
X LOADs immutable. ld.so will apply changes to the text segment. In
upcoming diff, crt0 and ld.so will then apply immutability.
ok kettenis

date 2022-10-27T23:17:18Z
author deraadt
files src/sys/sys/exec_elf.h log diff annotate
message In dynamic binaries, AUX_base is the ld.so address. In static PIE binaries,
it is the base of the binary itself. Repair of this comment does not undo
the hair pulling that happened today.
ok guenther

date 2022-10-28T14:55:46Z
author kn
files src/sys/dev/isa/ad1848.c log diff annotate
src/sys/dev/isa/ad1848var.h log diff annotate
src/sys/dev/isa/ess.c log diff annotate
src/sys/dev/isa/gus.c log diff annotate
src/sys/dev/isa/gusvar.h log diff annotate
src/sys/dev/isa/pas.c log diff annotate
src/sys/dev/isa/sb.c log diff annotate
src/sys/dev/isa/sbdsp.c log diff annotate
src/sys/dev/isa/sbdspvar.h log diff annotate
message Replace audio(9) get_props() with duplex check in open() in partial duplex drivers

Make drivers which do *not* adverise AUDIO_PROP_FULLDPLEX return ENXIO
in their open() if full-duplex mode was requested.

This way, sys/dev/audio.c:audio_open() will fail immediately rather than
later through the to-be-removed get_props() check.

This is the first round for drivers with logic in their get_props(), i.e.
those that only support full-duplex mode for specific hardware:

ess(4), gus(4), pas(4) and sb(4)

All of these are i386/GENERIC only and share code through
sys/dev/isa/{ad1848,sbdsp}{.c,var.h} which are not used by any other kernel.

i386/GENERIC.MP builds and boots with this diff.
OK ratchov miod

date 2022-10-28T15:02:20Z
author kn
files src/sys/dev/usb/utvfu.c log diff annotate
message Remove audio(9) get_props() from record-only drivers

utvfu(4) seems to be the only driver that currently supports recording but
not playing and its open() already returns ENXIO when playing is requested,
so no need to add another duplex check after get_props() is gone.

OK ratchov miod

date 2022-10-28T15:07:25Z
author kettenis
files src/sys/arch/mips64/include/exec.h log diff annotate
message Implement support for DT_MIPS_RLD_MAP_REL.

ok deraadt@

date 2022-10-28T15:09:45Z
author kn
files src/sys/arch/arm64/dev/aplaudio.c log diff annotate
src/sys/arch/arm64/dev/aplmca.c log diff annotate
src/sys/arch/luna88k/cbus/nec86.c log diff annotate
src/sys/arch/luna88k/cbus/nec86hw.c log diff annotate
src/sys/arch/luna88k/cbus/nec86hwvar.h log diff annotate
src/sys/dev/fdt/graphaudio.c log diff annotate
src/sys/dev/fdt/rkiis.c log diff annotate
src/sys/dev/fdt/simpleaudio.c log diff annotate
src/sys/dev/ic/arcofi.c log diff annotate
message Replace audio(9) get_props() with duplex check in open() in non-duplex drivers

Make drivers which do *not* adverise AUDIO_PROP_FULLDPLEX return ENXIO
in their open() if full-duplex mode was requested.

This way, sys/dev/audio.c:audio_open() will fail immediately rather than
later through the to-be-removed get_props() check.

These are all drivers which simply don't support full-duplex mode.

In device-tree based drivers like simpleaudio(4)/rkiis(4) and newer Apple
ones like aplaudio(4)/aplmca(4), this adds a new open() stub to the
low-level drivers which merely does the duplex check.

My Pinebook Pro keeps playing audio and recording silence with this diff
just like before (rkiis(4) is currently play-only):
simpleaudio0 at mainbus0
simpleaudio1 at mainbus0
audio0 at simpleaudio1

$ aucat -i song69.wav -o rec.wav

OK ratchov miod

date 2022-10-28T15:09:46Z
author kn
files src/sys/dev/pci/maestro.c log diff annotate
message Replace audio(9) get_props() with duplex check in open() in non-duplex drivers

Make drivers which do *not* adverise AUDIO_PROP_FULLDPLEX return ENXIO
in their open() if full-duplex mode was requested.

This way, sys/dev/audio.c:audio_open() will fail immediately rather than
later through the to-be-removed get_props() check.

These are all drivers which simply don't support full-duplex mode.

In device-tree based drivers like simpleaudio(4)/rkiis(4) and newer Apple
ones like aplaudio(4)/aplmca(4), this adds a new open() stub to the
low-level drivers which merely does the duplex check.

My Pinebook Pro keeps playing audio and recording silence with this diff
just like before (rkiis(4) is currently play-only):
simpleaudio0 at mainbus0
simpleaudio1 at mainbus0
audio0 at simpleaudio1

$ aucat -i song69.wav -o rec.wav

OK ratchov miod

date 2022-10-28T15:13:59Z
author kn
files src/sys/dev/audio.c log diff annotate
src/sys/dev/audio_if.h log diff annotate
message Remove unused audio(9) get_props()/AUDIO_PROP_FULLDUPLEX

All audio drivers have been cleaned up and, if needed, now check for duplex
mode in their open() handler.

OK ratchov miod

date 2022-10-29T20:35:50Z
author kettenis
files src/sys/arch/arm64/dev/efi_machdep.c log diff annotate
src/sys/arch/arm64/dev/smbios.c log diff annotate
message The x13s only defines the (legacy) 32-bit SMBIOS entry point. Add code to
handle that such that we can see the firmware version in dmesg.

ok deraadt@, phessler@

date 2022-10-30T10:55:52Z
author kn
files src/sys/dev/isa/sbdsp.c log diff annotate
message Move duplex check from sbdsp_midi_open() to sbdsp_open() where it belongs

sbdsp.c r1.42 "Replace audio(9) get_props() with duplex check in open()
in partial duplex drivers" added it to the wrong function.

date 2022-10-30T15:34:54Z
author patrick
files src/sys/dev/acpi/xhci_acpi.c log diff annotate
message On the Lenovo X13s attaching to the multiport USB controller leads to hard
resets. Previously this was only seen with smmu(4) enabled, probably as
there is no IORT reference to that controller and hence no IOMMU mapping
established. Since recent BIOS updates, this now also happens without
smmu(4) enabled. Let's skip this node for now to keep machines running.

Prompted by deraadt@
ok phessler@

date 2022-10-30T17:43:39Z
author guenther
files src/sys/arch/alpha/alpha/machdep.c log diff annotate
src/sys/arch/amd64/amd64/machdep.c log diff annotate
src/sys/arch/arm/arm/arm_machdep.c log diff annotate
src/sys/arch/arm64/arm64/machdep.c log diff annotate
src/sys/arch/hppa/hppa/machdep.c log diff annotate
src/sys/arch/i386/i386/machdep.c log diff annotate
src/sys/arch/m88k/m88k/m88k_machdep.c log diff annotate
src/sys/arch/macppc/macppc/machdep.c log diff annotate
src/sys/arch/mips64/mips64/mips64_machdep.c log diff annotate
src/sys/arch/powerpc64/powerpc64/machdep.c log diff annotate
message Simplfity setregs() by passing it the ps_strings and switching
sys_execve() to return EJUSTRETURN.

setregs() is the MD routine used by sys_execve() to set up the
thread's trapframe and PCB such that, on 'return' to userspace, it
has the register values defined by the ABI and otherwise zero. It
had to set the syscall retval[] values previously because the normal
syscall return path overwrites a couple registers with the retval[]
values. By instead returning EJUSTRETURN that and some complexity
with program-counter handling on m88k and sparc64 goes away.

Also, give setregs() add a 'struct ps_strings *arginfo' argument
so powerpc, powerpc64, and sh can directly get argc/argv/envp
values for registers instead of copyin()ing the one in userspace.

Improvements from miod@ and millert@
Testing assistance miod@, kettenis@, and aoyama@
ok miod@ kettenis@

date 2022-10-30T17:43:40Z
author guenther
files src/sys/arch/riscv64/riscv64/machdep.c log diff annotate
src/sys/arch/sh/sh/sh_machdep.c log diff annotate
src/sys/arch/sparc64/sparc64/machdep.c log diff annotate
src/sys/kern/init_main.c log diff annotate
src/sys/kern/kern_exec.c log diff annotate
src/sys/sys/exec.h log diff annotate
message Simplfity setregs() by passing it the ps_strings and switching
sys_execve() to return EJUSTRETURN.

setregs() is the MD routine used by sys_execve() to set up the
thread's trapframe and PCB such that, on 'return' to userspace, it
has the register values defined by the ABI and otherwise zero. It
had to set the syscall retval[] values previously because the normal
syscall return path overwrites a couple registers with the retval[]
values. By instead returning EJUSTRETURN that and some complexity
with program-counter handling on m88k and sparc64 goes away.

Also, give setregs() add a 'struct ps_strings *arginfo' argument
so powerpc, powerpc64, and sh can directly get argc/argv/envp
values for registers instead of copyin()ing the one in userspace.

Improvements from miod@ and millert@
Testing assistance miod@, kettenis@, and aoyama@
ok miod@ kettenis@

date 2022-10-31T03:20:41Z
author guenther
files src/sys/arch/alpha/alpha/sys_machdep.c log diff annotate
message style: 'The function type should be on a line by itself preceding the function.'

date 2022-10-31T10:46:24Z
author mpi
files src/sys/uvm/uvm_map.c log diff annotate
message Fix VMMAP_DEBUG code to compile with not-so-recent changes.

If enabled the debug code currently panic the kernel. To investigate.

date 2022-10-31T13:59:10Z
author visa
files src/sys/arch/mips64/mips64/clock.c log diff annotate
message mips64: Raise SPL for hardclock()

This lets the MI clock interrupt code see the correct SPL.

The full splx() is skipped because the updating of the hardware interrupt
masks should not be needed here.

Prompted by and OK cheloha@