OpenBSD cvs log

created 2023-08-08T14:08:43Z
begin 2022-10-11T00:00:00Z
end 2022-10-18T00:00:00Z
path src/sys
commits 37

date 2022-10-11T11:46:58Z
author jsg
files src/sys/uvm/uvm_swap.c log diff annotate
message add missing unlock in swapmount()
ok tb@ kn@ miod@

date 2022-10-11T23:39:07Z
author krw
files src/sys/arch/alpha/alpha/disksubr.c log diff annotate
src/sys/arch/hppa/hppa/disksubr.c log diff annotate
src/sys/arch/luna88k/luna88k/disksubr.c log diff annotate
message Give checkdisklabel() a new parameter supplying the dev_t of the
device whose disklabel is being checked. Within checkdisklabel()
use this information to discover a device name iff (sic) the
label is an obsolete version. Use the name to generate a
meaningful warning message asking the user to rewrite the
disklabel and thus promote it to the current version.

Suggested by, feedback from and ok deraadt@

date 2022-10-11T23:39:08Z
author krw
files src/sys/arch/macppc/macppc/disksubr.c log diff annotate
src/sys/arch/sparc64/sparc64/disksubr.c log diff annotate
src/sys/kern/subr_disk.c log diff annotate
src/sys/sys/disklabel.h log diff annotate
message Give checkdisklabel() a new parameter supplying the dev_t of the
device whose disklabel is being checked. Within checkdisklabel()
use this information to discover a device name iff (sic) the
label is an obsolete version. Use the name to generate a
meaningful warning message asking the user to rewrite the
disklabel and thus promote it to the current version.

Suggested by, feedback from and ok deraadt@

date 2022-10-12T02:39:16Z
author deraadt
files src/sys/kern/kern_exec.c log diff annotate
message The sigaltstack() MAP_STACK re-map mechanism is incompatible with immutable
regions, so immutable stack isn't viable yet. There are configure programs
which create sigstacks upon their own stacks, and there is no simple fix for
the sigaltstack mechanism...
discovered by sthen and tb

date 2022-10-12T09:23:45Z
author kn
files src/sys/arch/macppc/stand/ofdev.c log diff annotate
message Fix -Wreturn-type

OK miod

date 2022-10-12T10:48:33Z
author kn
files src/sys/arch/macppc/stand/Makefile log diff annotate
src/sys/arch/macppc/stand/Makefile.inc log diff annotate
message Remove powerpc left-overs

There since the powerpc -> macppc move/rename.

KERN_AS usage disappeared in
commit 5b7db11d478192c5908038bb1345e7d51cc35c8e
Author: rahnds <[email protected]>
Date: Mon May 5 16:47:15 1997 +0000

only build one version of the libraries.

REAL_VIRT usage disappeared in
commit 08e027d6bb9ca863bfc44a1aa6957ff3a242e2f4
Author: rahnds <[email protected]>
Date: Thu Apr 27 12:36:29 2000 +0000

Fixes to xcoff bootloader to allow it to execute and load kernels for OpenBSD.

Make agrees that these are defined but not used:

$ make -p | grep -e KERN_AS -e REAL_VIRT
KERN_AS = library
REAL_VIRT = -v
$ make -C ofwboot -p | grep -e KERN_AS -e REAL_VIRT
KERN_AS = library
REAL_VIRT = -v

No object change.
Feedback OK miod

date 2022-10-12T11:29:53Z
author jsg
files src/sys/arch/arm64/dev/apldma.c log diff annotate
message use correct type with sizeof
ok miod@ kettenis@

date 2022-10-12T13:39:50Z
author kettenis
files src/sys/arch/arm64/dev/aplpmu.c log diff annotate
src/sys/arch/arm64/dev/aplsmc.c log diff annotate
src/sys/arch/arm64/dev/efi_machdep.c log diff annotate
src/sys/arch/loongson/dev/mcclock.c log diff annotate
src/sys/arch/octeon/dev/octrtc.c log diff annotate
src/sys/arch/powerpc64/dev/opal.c log diff annotate
src/sys/arch/sparc64/dev/prtc.c log diff annotate
src/sys/arch/sparc64/dev/rtc.c log diff annotate
src/sys/arch/sparc64/dev/sbbc.c log diff annotate
src/sys/arch/sparc64/dev/vrtc.c log diff annotate
src/sys/dev/clock_subr.h log diff annotate
src/sys/dev/fdt/dapmic.c log diff annotate
src/sys/dev/fdt/plrtc.c log diff annotate
src/sys/dev/fdt/rkpmic.c log diff annotate
src/sys/dev/fdt/sxirtc.c log diff annotate
src/sys/dev/i2c/m41t8x.c log diff annotate
src/sys/dev/i2c/pcf85063.c log diff annotate
src/sys/dev/i2c/pcf8523.c log diff annotate
src/sys/dev/i2c/pcf8563.c log diff annotate
src/sys/dev/i2c/rs5c372.c log diff annotate
src/sys/dev/ic/mk48txx.c log diff annotate
src/sys/kern/kern_time.c log diff annotate
message Extend struct todr_chip_handle with a todr_quality member. This allows us
to assign a quality to RTC implementation and pick the "best" RTC if a
system has multiple RTCs (or multiple interfaces to an RTC). This allows
us to prefer a battery-backed I2C RTC over an RTC that is part of the SoC
which is only running of the SoC is powered. It also allows us to
work around issues with firmware RTC interfaces that may lie to us or
even crash the system.

This change makes sure the todr_quality member of the struct is always
initialized. In most cases the quality will be set to zero; further
adjustments of the quality for specific subsystems/architectures will follow.

ok cheloha@, patrick@

date 2022-10-12T23:11:33Z
author krw
files src/sys/sys/disklabel.h log diff annotate
message Nuke D_BADSECT and disktab's 'sf'.

DEC standard 144 bad sector information is no longer a thing. As
evidenced by bad144(8) moving to the attic 16 years ago.

ok miod@, who points out that badsect(8) is now the nail sticking
out.

date 2022-10-13T07:04:53Z
author kettenis
files src/sys/arch/arm64/dev/agintc.c log diff annotate
message Implement support for MBIs. MBIs are message based interrupts that can be
used as an alternative implementation for MSIs on hardware that doesn't
implement an ITS (or where the ITS is broken such as on the Rochchip
RK3566 SoC).

Based on an earlier WIP diff from patrick@; I just cleaned it up a bit.

ok patrick@

date 2022-10-13T08:38:53Z
author tb
files src/sys/dev/rnd.c log diff annotate
message Make comment match the code.

Since rnd.c r1.127, there is only one stirring polynomial.

date 2022-10-13T09:07:26Z
author kettenis
files src/sys/dev/fdt/dwpcie.c log diff annotate
message Add (minimal) support for the RK3568 PCIe controller. This relies on
the firmware to do most of the hardware initialization; the driver
basically only sets up the address translation unit to match the
configuration specified in the device tree.

ok patrick@

date 2022-10-13T18:34:56Z
author kettenis
files src/sys/arch/arm64/dev/agintc.c log diff annotate
message Properly implement disestablishing LPI interrupts. Fixes a crash when using
virtio(4) in combination with agintc(4).

ok jsg@, patrick@

date 2022-10-14T13:22:57Z
author krw
files src/sys/arch/luna88k/luna88k/disksubr.c log diff annotate
src/sys/arch/luna88k/stand/boot/ufs_disksubr.c log diff annotate
message No point in luna88k setting D_VENDOR since all actual uses are
inside #ifdef SUN_CYLCHECK or #ifdef SUN_AAT0 blocks in
disklabel(8), neither of which are defined for luna88k.

ok miod@

date 2022-10-14T20:53:18Z
author aoyama
files src/sys/arch/luna88k/luna88k/autoconf.c log diff annotate
src/sys/arch/luna88k/luna88k/locore0.S log diff annotate
src/sys/arch/luna88k/luna88k/machdep.c log diff annotate
src/sys/arch/luna88k/stand/boot/Attic/boot.c log diff annotate
src/sys/arch/luna88k/stand/boot/devopen.c log diff annotate
message Pass boot device information from bootloader to kernel.

This brings the default root device is the same one of the kernel
specified by bootloader, rather than NVRAM setting, like other
architectures.

"looks good to me" miod@, tested on LUNA-88K2 and nono (LUNA-88K
capable emulator) by me.

date 2022-10-14T20:53:19Z
author aoyama
files src/sys/arch/luna88k/stand/boot/init_main.c log diff annotate
src/sys/arch/luna88k/stand/boot/locore.S log diff annotate
src/sys/arch/luna88k/stand/boot/samachdep.h log diff annotate
message Pass boot device information from bootloader to kernel.

This brings the default root device is the same one of the kernel
specified by bootloader, rather than NVRAM setting, like other
architectures.

"looks good to me" miod@, tested on LUNA-88K2 and nono (LUNA-88K
capable emulator) by me.

date 2022-10-15T03:23:50Z
author deraadt
files src/sys/kern/kern_sig.c log diff annotate
src/sys/uvm/uvm_map.c log diff annotate
src/sys/uvm/uvm_map.h log diff annotate
message During the MAP_STACK introduction in 2018, sigaltstack() became a
problem because haphazard use could shoot holes in the address space
(changing permissions, providing opportunities for pivoting, etc). I
tried to write a diff to convert the address space correctly but did
not understand enough about map entries, so instead we mapped new
memory over top of the existing object. Placing a new mapping becomes
unfeasible with the upcoming mimmutable model, so here is code that
adds MAP_STACK to the region. It will only do so for a contigiously
mapped region that is non-syscall with permission RW, otherwise it
returns an error.
Food for thought: If we know the object isn't service by an object,
we should consider zero'ing the region, to block pre-pivot placement?
ok kettenis

date 2022-10-15T05:56:01Z
author deraadt
files src/sys/uvm/uvm_map.c log diff annotate
message remove one of the debug messages

date 2022-10-15T08:04:02Z
author jsg
files src/sys/arch/arm/arm/db_interface.c log diff annotate
src/sys/arch/arm64/arm64/db_interface.c log diff annotate
src/sys/arch/powerpc/ddb/db_memrw.c log diff annotate
message ansi

date 2022-10-15T08:41:18Z
author jsg
files src/sys/arch/macppc/dev/i2s.c log diff annotate
src/sys/arch/macppc/dev/if_wi_obio.c log diff annotate
src/sys/arch/macppc/dev/mediabay.c log diff annotate
message ansi

date 2022-10-15T10:12:12Z
author jsg
files src/sys/arch/alpha/alpha/conf.c log diff annotate
message ansi

date 2022-10-15T10:12:13Z
author jsg
files src/sys/arch/hppa/hppa/conf.c log diff annotate
src/sys/arch/landisk/landisk/conf.c log diff annotate
src/sys/arch/loongson/loongson/conf.c log diff annotate
src/sys/arch/luna88k/luna88k/conf.c log diff annotate
src/sys/arch/octeon/octeon/conf.c log diff annotate
src/sys/arch/sparc64/sparc64/conf.c log diff annotate
message ansi

date 2022-10-15T14:58:54Z
author jsg
files src/sys/arch/loongson/dev/mcclock.c log diff annotate
src/sys/arch/loongson/dev/mcclock_isa.c log diff annotate
message ansi

date 2022-10-15T18:22:53Z
author kettenis
files src/sys/dev/i2c/abx80x.c log diff annotate
src/sys/dev/i2c/ds1307.c log diff annotate
src/sys/dev/i2c/ds3231.c log diff annotate
src/sys/dev/i2c/isl1208.c log diff annotate
src/sys/dev/i2c/mcp794xx.c log diff annotate
message Convert remaining I2C RTC drivers to use todr_attach().
These all get a quality of 1000 since these are supposed to be battery
backed and almost certainly what the hardware designers want us to use.

ok mglocker@, jsg@

date 2022-10-16T01:22:39Z
author jsg
files src/sys/arch/sparc64/dev/auxio.c log diff annotate
src/sys/arch/sparc64/dev/beep.c log diff annotate
src/sys/arch/sparc64/dev/beeper.c log diff annotate
src/sys/arch/sparc64/dev/central.c log diff annotate
src/sys/arch/sparc64/dev/creator.c log diff annotate
src/sys/arch/sparc64/dev/fhc_central.c log diff annotate
src/sys/arch/sparc64/dev/fhc_mainbus.c log diff annotate
src/sys/arch/sparc64/dev/lpt_ebus.c log diff annotate
src/sys/arch/sparc64/dev/pci_machdep.c log diff annotate
src/sys/arch/sparc64/dev/pckbc_ebus.c log diff annotate
src/sys/arch/sparc64/dev/pcons.c log diff annotate
src/sys/arch/sparc64/dev/power.c log diff annotate
src/sys/arch/sparc64/dev/psycho.c log diff annotate
src/sys/arch/sparc64/dev/sab.c log diff annotate
src/sys/arch/sparc64/dev/stp_sbus.c log diff annotate
src/sys/arch/sparc64/dev/uperf.c log diff annotate
src/sys/arch/sparc64/dev/uperf_ebus.c log diff annotate
src/sys/arch/sparc64/fpu/fpu.c log diff annotate
src/sys/arch/sparc64/fpu/fpu_add.c log diff annotate
src/sys/arch/sparc64/fpu/fpu_div.c log diff annotate
src/sys/arch/sparc64/fpu/fpu_explode.c log diff annotate
src/sys/arch/sparc64/fpu/fpu_implode.c log diff annotate
src/sys/arch/sparc64/fpu/fpu_mul.c log diff annotate
src/sys/arch/sparc64/fpu/fpu_sqrt.c log diff annotate
src/sys/arch/sparc64/include/bus.h log diff annotate
src/sys/arch/sparc64/sparc64/cache.c log diff annotate
src/sys/arch/sparc64/sparc64/db_interface.c log diff annotate
src/sys/arch/sparc64/sparc64/machdep.c log diff annotate
src/sys/arch/sparc64/sparc64/ofw_machdep.c log diff annotate
src/sys/arch/sparc64/sparc64/openfirm.c log diff annotate
src/sys/arch/sparc64/sparc64/openprom.c log diff annotate
src/sys/arch/sparc64/sparc64/process_machdep.c log diff annotate
src/sys/arch/sparc64/sparc64/sys_machdep.c log diff annotate
src/sys/dev/ic/lsi64854.c log diff annotate
src/sys/dev/ic/mk48txx.c log diff annotate
message Change function definitions using the identifier-list form used in the
1st edition of Kernighan and Ritchie's The C Programming Language, to
that of the parameter-type-list form described in the ANSI X3.159-1989
standard.

In ISO/IEC 9899:2023 drafts, there is only one form of function definition.
"N2432 Remove support for function definitions with identifier lists".

ok kettenis@

date 2022-10-16T01:22:40Z
author jsg
files src/sys/dev/sbus/bwtwo.c log diff annotate
src/sys/dev/sbus/dma_sbus.c log diff annotate
src/sys/dev/sbus/qe.c log diff annotate
src/sys/dev/sbus/qec.c log diff annotate
message Change function definitions using the identifier-list form used in the
1st edition of Kernighan and Ritchie's The C Programming Language, to
that of the parameter-type-list form described in the ANSI X3.159-1989
standard.

In ISO/IEC 9899:2023 drafts, there is only one form of function definition.
"N2432 Remove support for function definitions with identifier lists".

ok kettenis@

date 2022-10-16T15:03:39Z
author kettenis
files src/sys/arch/amd64/amd64/bios.c log diff annotate
src/sys/arch/amd64/amd64/efi_machdep.c log diff annotate
src/sys/arch/amd64/amd64/machdep.c log diff annotate
src/sys/arch/amd64/amd64/pmap.c log diff annotate
src/sys/arch/amd64/conf/GENERIC log diff annotate
src/sys/arch/amd64/conf/files.amd64 log diff annotate
src/sys/arch/amd64/include/pmap.h log diff annotate
src/sys/dev/efi/efi.h log diff annotate
message Add the guts for EFI runtime services support on amd64. This will be used
in the future to implement support for things like EFI variables.

ok krw@ (a few others ok'ed earlier incarnations of this diff)

date 2022-10-16T16:16:37Z
author deraadt
files src/sys/uvm/uvm_extern.h log diff annotate
src/sys/uvm/uvm_map.c log diff annotate
src/sys/uvm/uvm_map.h log diff annotate
message Rather than marking MAP_STACK on entries for sigaltstack() [2 days ago],
go back to the old approach: using a new anon mapping because it removes
any potential gadgetry pre-placed in the region (by making it zero). But
also bring in a few more validation checks beyond contigious mapping -- it
must not be a syscall region, and the protection must be precisely RW.
This does allow sigaltstack() to shoot zero'd MAP_STACK non-immutable regions
into the main stack area (which will soon be immutable). I am not sure we
can keep reinforce immutable on the region after we do stack (like maybe
determine this while doing the validation entry walk?)
Sadly, continued support for sigaltstack() does require selecting the guessed
best compromise.
ok kettenis

date 2022-10-16T16:27:02Z
author deraadt
files src/sys/kern/kern_sig.c log diff annotate
message Rather than marking MAP_STACK on entries for sigaltstack() [2 days ago],
go back to the old approach: using a new anon mapping because it removes
any potential gadgetry pre-placed in the region (by making it zero). But
also bring in a few more validation checks beyond contigious mapping -- it
must not be a syscall region, and the protection must be precisely RW.
This does allow sigaltstack() to shoot zero'd MAP_STACK non-immutable regions
into the main stack area (which will soon be immutable). I am not sure we
can keep reinforce immutable on the region after we do stack (like maybe
determine this while doing the validation entry walk?)
Sadly, continued support for sigaltstack() does require selecting the guessed
best compromise.
ok kettenis

date 2022-10-16T18:23:44Z
author bru
files src/sys/dev/wscons/wsmouse.c log diff annotate
message Fix a bug in the initialization mechanism of wsmouse.

The CONFIGURED flag, which indicates that first-time initialization
has been completed, must be set immediately after the first call to
wstpad_configure. Otherwise, passing touchpad parameters to the
initialization function has no effect for some of them.

date 2022-10-16T20:17:08Z
author bru
files src/sys/dev/hid/hidmt.c log diff annotate
message Improve the clickpad/touchpad detection in hidmt.

If the HID descriptors don't provide a HUD_BUTTON_TYPE property, hidmt
should treat all devices as clickpads if they report a "clickpad button",
or don't report to have both a left and right external button.

date 2022-10-17T14:49:01Z
author mvs
files src/sys/kern/uipc_usrreq.c log diff annotate
src/sys/net/pfkeyv2.c log diff annotate
message Change pru_abort() return type to the type of void and make pru_abort()
optional.

We have no interest on pru_abort() return value. We call it only from
soabort() which is dummy pru_abort() wrapper and has no return value.

Only the connection oriented sockets need to implement (*pru_abort)()
handler. Such sockets are tcp(4) and unix(4) sockets, so remove existing
code for all others, it doesn't called.

ok guenther@

date 2022-10-17T14:49:02Z
author mvs
files src/sys/net/rtsock.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_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/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 Change pru_abort() return type to the type of void and make pru_abort()
optional.

We have no interest on pru_abort() return value. We call it only from
soabort() which is dummy pru_abort() wrapper and has no return value.

Only the connection oriented sockets need to implement (*pru_abort)()
handler. Such sockets are tcp(4) and unix(4) sockets, so remove existing
code for all others, it doesn't called.

ok guenther@

date 2022-10-17T18:49:06Z
author kettenis
files src/sys/arch/sparc64/sparc64/ofw_machdep.c log diff annotate
message Fix "map" OpenFirmware call. It does not return a value according to the
IEEE 1275 specification.

Based on a diff provided by Harald Gutch (hgutch@netbsd). Also see
NetBSD PR#56829.

ok miod@

date 2022-10-17T18:55:20Z
author kettenis
files src/sys/arch/sparc64/stand/ofwboot/Locore.c log diff annotate
message Fix "map" OpenFirmware call. It does not return a value according to the
IEEE 1275 specification. This should fix booting on machines that would
fail with something like:

OF_map_phys(3fe44000,8192,fed58000,-1) failed
no space for symbol table
Program terminated

Based on a diff provided by Harald Gutch (hgutch@netbsd). Also see
NetBSD PR#56829.

There were (and still are) some questions about whether this diff breaks
the blade1.5k. However the failure in question might have been hardware
related and subsequent testing of the equivalent kernel diff (which
was just committed) was successful. So committing this in the hope it
sticks to ease testing.

ok miod@

date 2022-10-17T19:09:46Z
author kettenis
files src/sys/dev/fdt/acrtc.c log diff annotate
src/sys/dev/fdt/exrtc.c log diff annotate
src/sys/dev/fdt/gfrtc.c log diff annotate
src/sys/dev/fdt/imxrtc.c log diff annotate
src/sys/dev/fdt/mvrtc.c log diff annotate
src/sys/dev/fdt/plrtc.c log diff annotate
src/sys/dev/fdt/sxirtc.c log diff annotate
message Convert more drivers to use todr_attach(). The quality of the RTC is
set such that "discrete" RTC chips are preferred over RTCs integrated on
a SoC.

ok deraadt@, miod@

date 2022-10-17T19:51:54Z
author kettenis
files src/sys/arch/riscv64/riscv64/pmap.c log diff annotate
message Implement uncached mappings on the StarFive JH7100 SoC, where the hardware
provides allows bypassing the L2 cache by using a physical address alias.

ok miod@