OpenBSD cvs log

created 2023-08-09T07:11:52Z
begin 2022-11-08T00:00:00Z
end 2022-11-15T00:00:00Z
path src/sys
commits 139

date 2022-11-08T11:05:57Z
author mpi
files src/sys/kern/syscalls.master log diff annotate
message Mark mmap(2), munmap(2) and mprotect(2) as NOLOCK.

Accesses to data structures used by these syscalls are serialized by the
VM map lock with the exception of file mappings which are still protected
by the KERNEL_LOCK().

Unlocking this set of syscalls improves most of userland workloads.

Tested by many including robert@ (since 2 years), mlarkin@, kn@, sdk@,
jca@, aoyama@, naddy@, Scott Bennett and others. Thanks to all!

Joint work with kn@.

ok robert@, aja@, kettenis@, kn@, deraadt@, beck@

date 2022-11-08T11:06:41Z
author mpi
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-11-08T11:25:01Z
author kn
files src/sys/kern/sys_socket.c log diff annotate
src/sys/net/if.c log diff annotate
message Push kernel lock down into ifioctl()

This is a mechanical diff without semantical changes, locking ioctls
individually inside ifioctl() rather than all of them around it.

This allows us to unlock ioctls one by one.

OK mpi

date 2022-11-08T11:40:47Z
author kettenis
files src/sys/arch/arm64/dev/aplintc.c log diff annotate
message Sprinkle some #ifdef MULTIPROCESSOR to make non-MP kernels build again.

date 2022-11-08T11:51:34Z
author patrick
files src/sys/dev/fdt/qcgpio_fdt.c log diff annotate
message Implement reading/writing/configuring pins in qcgpio(4). The code has
mostly been there, it only needed to be hooked up to our infrastructure.
With this I can e.g. correctly see the lid state on the x13s.

ok kettenis@

date 2022-11-08T14:01:13Z
author kettenis
files src/sys/arch/arm64/dev/aplintc.c log diff annotate
src/sys/arch/arm64/include/armreg.h log diff annotate
message Move definitions for CNTV_CTL_EL0 to armreg.h.

ok mpi@, jsg@, phessler@, patrick@

date 2022-11-08T14:46:51Z
author cheloha
files src/sys/arch/amd64/amd64/machdep.c log diff annotate
src/sys/arch/amd64/include/cpu.h log diff annotate
message amd64: add delay_fini()

Not all of the clocks with a delay(9) implementation necessarily keep
ticking across suspend/resume. We need a clean way to reverse
delay_init() during suspend when those clocks stop ticking.

Hence, delay_fini(). delay_fini() resets delay_func() to
i8254_delay() if the given function pointer is the active delay(9)
implementation.

ok mlarkin@

date 2022-11-08T14:49:20Z
author cheloha
files src/sys/arch/i386/i386/machdep.c log diff annotate
src/sys/arch/i386/include/cpu.h log diff annotate
message i386: add delay_fini()

Not all of the clocks with a delay(9) implementation necessarily keep
ticking across suspend/resume. We need a clean way to reverse
delay_init() during suspend when those clocks stop ticking.

Hence, delay_fini(). delay_fini() resets delay_func() to
i8254_delay() if the given function pointer is the active delay(9)
implementation.

ok mlarkin@

date 2022-11-08T14:54:47Z
author cheloha
files src/sys/dev/acpi/acpihpet.c log diff annotate
message acpihpet(4): disable/reenable acpihpet_delay() during suspend/resume

We can't use the HPET to delay(9) after we halt it during suspend.
Disable acpihpet_delay() before we halt the HPET and reenable it after
we restart the HPET during resume.

ok mlarkin@

date 2022-11-08T15:20:24Z
author kn
files src/sys/net/if.c log diff annotate
message Push kernel lock into ifioctl_get()

Another mechanical diff without semantic changes to avoid churn in actual
unlocking diffs.

OK mpi

date 2022-11-08T16:20:26Z
author sashan
files src/sys/net/pf.c log diff annotate
message This diff fixes panic tripped by KASSERT(st->sync_state == PFSYNC_S_NONE)
found in pfsync_insert_state(). It is caused by two packets which happen
to belong to the same session. Think of UDP stream or two TCP SYN packets
transmitted almost simultaneously. The first such packet wins a state lock
and inserts state to table. The second packet waits for state lock
as a reader. As soon as the first packet is done with state creation
it drops the lock and is going to sent S_INS message to its peer via
pfsync. The second update meanwhile obtains the state lock as a reader.
It finds a state created by the first packet. Later the second packet
also finds out the state needs to be updated, because sync_state
is still set to PFSYNC_S_NONE. The second packet puts state to snapshot
list marking it as S_UPD. All this happens before the first packet has
a chance to make a progress. Think of the first packet loses cpu after
dropping a write lock. Once the first packet gets running again it
trips KASSERT() because sync_state is set to S_UPD.

tested by hrvoje@

OK dlg@

date 2022-11-08T16:53:40Z
author kettenis
files src/sys/arch/arm64/arm64/cpu.c log diff annotate
message Extent the current suspend/resume implementation to include support for
parking CPUs in a WFE/WFI loop.

ok deraadt@, mlarkin@

date 2022-11-08T17:34:12Z
author cheloha
files src/sys/arch/amd64/amd64/acpi_machdep.c log diff annotate
message amd64: switch to clockintr(9)

Switch amd64 to the clockintr(9) subsystem. There are lots of little
changes, but the bigs ones are listed here.

When using the local apic timer:

- Run the timer in one-shot mode.
- lapic_delay() is gone. We can't use it to delay(9) when running
the timer in one-shot mode.
- Add a randomized statclock(); stathz = hz.
- Add support for switching to profhz when profiling is enabled;
profhz = stathz * 10.

When using the i8254/mc146818:

- i8254's clockintr() no longer has a monopoly on hardclock().
- mc146818's rtcintr() no longer has a monopoly on statclock().
- In profiling mode, the statclock() will drift very slightly
because (profhz = 1024) does not divide evenly into one billion.
We could avoid this by setting (profhz = 512) instead and
programming the RTC to run at that rate.

Early revisions reviewed by mlarkin@. Extensively tested by mlarkin@
on a variety of physical and virtual hardware. Additional testing
from dv@ and jmc@.

Link: https://marc.info/?l=openbsd-tech&m=166776339203279&w=2

ok kettenis@ mlarkin@

date 2022-11-08T17:34:13Z
author cheloha
files src/sys/arch/amd64/amd64/cpu.c log diff annotate
src/sys/arch/amd64/amd64/lapic.c log diff annotate
src/sys/arch/amd64/include/_types.h log diff annotate
src/sys/arch/amd64/include/cpu.h log diff annotate
src/sys/arch/amd64/isa/clock.c log diff annotate
message amd64: switch to clockintr(9)

Switch amd64 to the clockintr(9) subsystem. There are lots of little
changes, but the bigs ones are listed here.

When using the local apic timer:

- Run the timer in one-shot mode.
- lapic_delay() is gone. We can't use it to delay(9) when running
the timer in one-shot mode.
- Add a randomized statclock(); stathz = hz.
- Add support for switching to profhz when profiling is enabled;
profhz = stathz * 10.

When using the i8254/mc146818:

- i8254's clockintr() no longer has a monopoly on hardclock().
- mc146818's rtcintr() no longer has a monopoly on statclock().
- In profiling mode, the statclock() will drift very slightly
because (profhz = 1024) does not divide evenly into one billion.
We could avoid this by setting (profhz = 512) instead and
programming the RTC to run at that rate.

Early revisions reviewed by mlarkin@. Extensively tested by mlarkin@
on a variety of physical and virtual hardware. Additional testing
from dv@ and jmc@.

Link: https://marc.info/?l=openbsd-tech&m=166776339203279&w=2

ok kettenis@ mlarkin@

date 2022-11-08T17:53:01Z
author kn
files src/sys/dev/audio.c log diff annotate
message fix indent

date 2022-11-08T17:56:38Z
author cheloha
files src/sys/arch/arm64/dev/agtimer.c log diff annotate
src/sys/arch/arm64/include/_types.h log diff annotate
src/sys/arch/arm64/include/cpu.h log diff annotate
message arm64: switch to clockintr(9)

Switch arm64 to the clockintr(9) subsystem.

- Remove the custom per-CPU clock interrupt schedule from agtimer(4).
- Remove the custom randomized statclock() pieces from agtimer(4).
- Add agtimer_rearm(), agtimer_trigger(), and wire up agtimer_intrclock.

There is one wart:

- The AArch64 spec says that a value written to CNTV_TVAL_EL0 is
"treated as a signed 32-bit integer" [1]. kettenis@ doesn't know
what to make of this. I'm capping the value at INT32_MAX for
now. It's possible I am misreading this, though.

Tested by kettenis@ on his Apple M1 mini. Tested by me on my
Raspberry Pi 4B.

Link: https://marc.info/?l=openbsd-tech&m=166776342503304&w=2

[1] "Arm Architecture Reference Manual for A-profile architecture"
issue I.a, section D17.11.27 ("CNTV_TVAL_EL0").

ok kettenis@

date 2022-11-08T17:57:14Z
author kn
files src/sys/net/if.c log diff annotate
message Push kernel lock inside ifioctl_get()

After this mechanical move, I can unlock the individual SIOCG* in there.

OK mvs

date 2022-11-08T17:57:47Z
author kn
files src/sys/net/if.c log diff annotate
message Unlock SIOCIFGCLONERS

ifconfig(8) -C is the only user in base and the if_clone_attach() comment
explains how this list is being built during autoconf(9).

After that it is only ever read. Multiple threads may traverse the list in
parallel and reading the `int' count is atomic.

OK mvs

date 2022-11-08T18:08:43Z
author mlarkin
files src/sys/arch/amd64/amd64/Attic/vmm.c log diff annotate
message vmm(4): remove locking in vmm_intr_pending

Removes a lock around an atomic write; this lock was causing slowdowns
since the lock being requested is nearly always unavailable because it
is held while the VM is running.

Noticed by claudio@, help from mpi@, dlg@ and claudio@.

ok dv

date 2022-11-08T18:17:51Z
author cheloha
files src/sys/kern/kern_tc.c log diff annotate
message tc_setclock: don't print a warning if tc_windup() rejects inittodr(9) time

During resume, it isn't necessarily a problem if the UTC time we get
from inittodr(9) lags behind the system UTC clock. In particular, if
the active timecounter's frequency is low enough, tc_delta() might not
overflow across a brief suspend.

Remove the misleading warning message. The code is behaving as
intended, just not in a way I anticipated when I added the warning
message a few years ago.

Discovered by kettenis@. Root cause isolated with kettenis@.

Link: https://marc.info/?l=openbsd-tech&m=166790845619897&w=2

ok mlarkin@ kettenis@

date 2022-11-08T18:28:10Z
author kettenis
files src/sys/dev/pci/if_bwfm_pci.c log diff annotate
src/sys/dev/pci/if_bwfm_pci.h log diff annotate
message Implement alternative mailbox handling mechanism required by newer firmware.

ok patrick@

date 2022-11-08T18:43:22Z
author kn
files src/sys/net/if.c log diff annotate
src/sys/net/if_var.h log diff annotate
message Document ifc_list immutability

Move up to comment explaining different locks to account for all structs.

OK millert mvs

date 2022-11-08T18:47:58Z
author kn
files src/sys/net/if.c log diff annotate
message Use four spaces not tabs on line break

date 2022-11-08T19:06:57Z
author tobhe
files src/sys/dev/fdt/files.fdt log diff annotate
src/sys/dev/fdt/gpiobl.c log diff annotate
message Add gpiobl(4), a driver for gpio controlled display backlights. This will
allow us to turn off the screen on Apple Silicon laptops until we have a
proper display controller driver.

ok kettenis@ patrick@

date 2022-11-08T19:07:34Z
author tobhe
files src/sys/arch/arm64/conf/GENERIC log diff annotate
message Enable gpiobl(4)

date 2022-11-08T19:09:53Z
author cheloha
files src/sys/kern/kern_timeout.c log diff annotate
src/sys/sys/timeout.h log diff annotate
message timeout(9): remove unused, undocumented timeout_in_nsec() interface

The kernel is not quite ready for timeout_in_nsec(). Remove it and
kclock_nanotime(). Both are unused.

Prompted by jsg@.

ok kn@

date 2022-11-08T19:17:58Z
author robert
files src/sys/kern/kern_pledge.c log diff annotate
message allow the KERN_AUTOCONF_SERIAL sysctl in pledge'd processes

ok deraadt@

date 2022-11-08T19:18:47Z
author dlg
files src/sys/arch/amd64/amd64/Attic/vmm.c log diff annotate
src/sys/arch/amd64/include/vmmvar.h log diff annotate
message further speed up delivery of interrupts to a running vcpu.

this records which physical cpu a vcpu is running on. this is used
by the code that marks a vcpu as having a pending interrupt to check
if the vcpu is currently running. if it thinks the vcpu is running,
it sends a nop IPI to the physical cpu it is running on to trigger
a vmexit, which in turn runs interrupt handling in the guest.

ok mlarkin@

date 2022-11-08T19:34:54Z
author patrick
files src/sys/dev/fdt/qcspmi.c log diff annotate
message Add qcspmi(4), a driver for the SPMI PMIC Arbiter found on Qualcomm SoCs,
which is used on the Lenovo x13s.

As soon as we gain a driver for the Power Domain Controller (PDC) that acts
as a shim towards the GIC, we can switch out the timeout for proper IRQs.

ok kettenis@

date 2022-11-08T19:38:34Z
author dlg
files src/sys/arch/amd64/amd64/Attic/vmm.c log diff annotate
message don't keep track of how many vcpus are currently running.

the number is never read anywhere, and i'm not sure what value that
number has anyway.

mlarkin@ agrees

date 2022-11-08T19:40:08Z
author patrick
files src/sys/dev/fdt/qcpmic.c log diff annotate
message Add qcpmic(4), a driver for the SPMI-connected PMICs found on Qualcomm SoCs,
which are used on the Lenovo x13s.

This is mostly a shim. The work for the actual blocks inside the PMICs
occurs in the children.

ok kettenis@

date 2022-11-08T19:42:10Z
author patrick
files src/sys/dev/fdt/qcpmicgpio.c log diff annotate
message Add qcpmicgpio(4), a driver for the GPIO block inside the Qualcomm PMICs.

This driver is not completed yet, but good enough to be worked on in-tree.

ok kettenis@

date 2022-11-08T19:44:28Z
author patrick
files src/sys/dev/fdt/qcpon.c log diff annotate
message Add qcpon(4), a driver for the Qualcomm PMIC block that hosts the powerkey
and reset input. With this I can use the power button on my x13s to power
off the machine.

ok kettenis@

date 2022-11-08T19:47:05Z
author patrick
files src/sys/dev/fdt/qcrtc.c log diff annotate
message Add qcrtc(4), a driver for the RTC found on Qualcomm PMICs. Unfortunately
on the Lenovo x13s it does not seem to contain the offset from 1970. Also
we are not allowed to write to the RTC.

I was told that the offset I need to calculate the actual date is sorted in
an UEFI variable, which can be accessed over a secure channel. So as long
as we don't have that channel, this driver is useless. Good start though.

ok kettenis@

date 2022-11-08T19:49:34Z
author patrick
files src/sys/arch/arm64/conf/GENERIC log diff annotate
src/sys/arch/arm64/conf/RAMDISK log diff annotate
src/sys/dev/fdt/files.fdt log diff annotate
message Hook up all those Qualcomm SoC SPMI devices.

date 2022-11-08T19:52:40Z
author patrick
files src/sys/arch/arm64/conf/files.arm64 log diff annotate
message Tedu spmi bus definition that moved over to the fdt files.

date 2022-11-08T20:41:36Z
author mlarkin
files src/sys/arch/arm64/include/cpu.h log diff annotate
message KNF/whitespace - no code change

date 2022-11-08T21:07:33Z
author kn
files src/sys/net/if.c log diff annotate
message Revert lock changes inside ifioctl_get()

WITNESS isn't happy with r1.667 "Push kernel lock into ifioctl_get()", so
revert it (including r1.668 and r1.669 depending on it):

witness: userret: returning with the following locks held:
exclusive kernel_lock &kernel_lock r = 0 (0xffffffff82455f58)
#0 witness_lock+0x311
#1 ifioctl_get+0x2e
#2 sys_ioctl+0x2c4
#3 syscall+0x384
#4 Xsyscall+0x128
panic: witness_warn
Stopped at db_enter+0x10: popq %rbp
TID PID UID PRFLAGS PFLAGS CPU COMMAND
* 70588 52613 0 0x3 0 4K pfctl

So back to the drawing board while leaving documentation bits (r1.670).
Thanks Hrvoje.

date 2022-11-09T06:32:58Z
author stsp
files src/sys/arch/amd64/amd64/Attic/vmm.c log diff annotate
message unbreak GENERIC build on amd64; patch by anton@

vmm.c:900:3: error: implicit declaration of function 'x86_send_ipi' is
invalid in C99 [-Werror,-Wimplicit-function-declaration]

date 2022-11-09T07:11:30Z
author miod
files src/sys/arch/arm64/arm64/pmap.c log diff annotate
message Minor cleanups:
- remove unused pmap_vp_remove function.
- remove obviously not-applying-to-this-situation comment in
_pmap_kenter_pa(), copied from pmap_enter() (where it is legit).
- make the PTED_xxx accessors inline.
- actually use PTED_WIRED() rather than inlining it everywhere.

ok mpi@ kettenis@

date 2022-11-09T10:03:04Z
author robert
files src/sys/dev/usb/usbdevs log diff annotate
message add a USB ID for WELLSPRINGM1_J293 to be used by aplhidev(4) to identify
M1 laptops with touchbars

date 2022-11-09T10:03:22Z
author robert
files src/sys/dev/usb/usbdevs.h log diff annotate
src/sys/dev/usb/usbdevs_data.h log diff annotate
message regen

date 2022-11-09T10:05:18Z
author robert
files src/sys/arch/arm64/dev/aplhidev.c log diff annotate
src/sys/dev/hid/hidkbd.c log diff annotate
src/sys/dev/hid/hidkbdsc.h log diff annotate
message translate Fn+(1-10,-,=) keys to F1-F12 on M1 laptops with a touchbar

ok kettenis@, miod@

date 2022-11-09T10:19:20Z
author dlg
files src/sys/arch/amd64/amd64/Attic/vmm.c log diff annotate
message vmm on !MULTIPROCESSOR kernels should still mark vpus with pending intrs.

the #ifdef MULTIPROCESSOR was a little broad.

still grateful to anton and stsp for unbreaking the tree though.

date 2022-11-09T10:26:28Z
author mpi
files src/sys/kern/syscalls.master log diff annotate
message Mark sched_yield(2) as NOLOCK.

All the fields accessed in this syscall are protected by the SCHED_LOCK()
so it isn't necessary to wait for another CPU to release the KERNEL_LOCK()
before that.

ok claudio@

date 2022-11-09T10:26:37Z
author krw
files src/sys/kern/subr_disk.c log diff annotate
message gpt_get_fstype() doesn't modify its parameter so make said
parameter const.

date 2022-11-09T10:27:01Z
author mpi
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-11-09T10:41:18Z
author dlg
files src/sys/net/if.c log diff annotate
message replace SRP with SMR in the if_idxmap.

when i first wrote if_idxmap i didn't realise (and no one thought
to tell me) that index 0 was special and means "no interface", so
while here use the 0th slot in the interface map to store the length
of the map instead of prepending the map with a length field.
if_get() now special cases index 0 and returns NULL directly. this
also means the size of the map is now always a power of 2, which
is a nicer fit with what the kernel malloc aprovides.

tweaks and ok visa@

date 2022-11-09T13:08:36Z
author kn
files src/sys/net/if.c log diff annotate
message Push kernel lock from ifioctl() into ifioctl_get()

Recommit these two together:
- r1.667 "Push kernel lock into ifioctl_get()"
locked before the switch() without unlocking in its cases
- r1.668 "Push kernel lock inside ifioctl_get()"
locked cases individually, as intended

I messed up splitting commits, but of course, Hrvoje managed to test a
CVS checkout right inbetween those two.

OK mpi mvs

date 2022-11-09T13:09:30Z
author kn
files src/sys/net/if.c log diff annotate
message Recommit r1.669 "Unlock SIOCIFGCLONERS"

OK mvs

date 2022-11-09T13:46:11Z
author patrick
files src/sys/dev/fdt/qcpmicgpio.c log diff annotate
message Implement reading/writing pins on qcpmicgpio(4).

date 2022-11-09T15:01:24Z
author claudio
files src/sys/netinet/tcp_usrreq.c log diff annotate
message Add missin 'e' in comment.
OK dlg@

date 2022-11-09T16:23:51Z
author kettenis
files src/sys/arch/arm64/dev/aplpmgr.c log diff annotate
message Make aplpmgr(4) work as a reset controller.

ok patrick@

date 2022-11-09T17:12:50Z
author cheloha
files src/sys/kern/kern_timeout.c log diff annotate
src/sys/sys/timeout.h log diff annotate
message timeout(9): remove TIMEOUT_KCLOCK flag

I never should have added the TIMEOUT_KCLOCK flag. It is redundant
and only serves to complicate the timeout(9) logic. In every place
where we check for the flag we can just use timeout.to_kclock.

So, remove the flag from <sys/timeout.h> and rewrite all affected
logic to use the value of timeout.to_kclock instead.

ok kn@

date 2022-11-09T17:53:12Z
author dv
files src/sys/arch/amd64/amd64/Attic/vmm.c log diff annotate
src/sys/arch/amd64/include/vmmvar.h log diff annotate
message vmm(4): treat vcpu lists as immutable, reducing complexity.

Since vmm doesn't support hot-plug vcpus we can reduce complexity
by treating the vcpu list per vm as immutable after creation.

As a consequence, we can use the vm reference count to protect the
lifetime of the vcpus, removing the need for reference counting
individual vcpu objects. With an immutable list, we no longer need
a rwlock protecting it either.

Original diff from dlg@ that I reworked and tested.

ok dlg@, mlarkin@

date 2022-11-09T18:12:47Z
author claudio
files src/sys/kern/spec_vnops.c log diff annotate
message Simplify the overly complex VXLOCK handling in spec_close.
The code only needs to know if the vnode is exclusive locked and this
can be done on entry of the function.
OK mpi@

date 2022-11-09T18:17:00Z
author kettenis
files src/sys/arch/arm64/dev/aplns.c log diff annotate
src/sys/arch/arm64/dev/rtkit.c log diff annotate
src/sys/arch/arm64/dev/rtkit.h log diff annotate
message Add suspend/resume support to aplns(4).

ok dlg@, patrick@

date 2022-11-09T19:18:11Z
author kettenis
files src/sys/arch/arm64/arm64/intr.c log diff annotate
src/sys/arch/arm64/dev/aplintc.c log diff annotate
src/sys/arch/arm64/dev/aplmbox.c log diff annotate
src/sys/arch/arm64/dev/aplns.c log diff annotate
src/sys/arch/arm64/dev/aplrtk.c log diff annotate
src/sys/arch/arm64/dev/aplsmc.c log diff annotate
src/sys/arch/arm64/dev/rtkit.c log diff annotate
src/sys/arch/arm64/dev/rtkit.h log diff annotate
src/sys/arch/arm64/include/intr.h log diff annotate
src/sys/dev/ofw/ofw_misc.h log diff annotate
message Implement wakeup interrupt support. For now this is only implemented for
aplintc(4); other arm64 interrupt controllers will follow.

ok patrick@

date 2022-11-09T19:25:50Z
author patrick
files src/sys/dev/fdt/qcpmicgpio.c log diff annotate
message Move input/output configuration into the correct function.

date 2022-11-09T19:59:38Z
author patrick
files src/sys/dev/fdt/files.fdt log diff annotate
src/sys/dev/fdt/qcpwm.c log diff annotate
message Add qcpwm(4), a driver for the PWM found on Qualcomm PMICs. This is used
on the Lenovo x13s to control the display backlight brightness.

ok kettenis@ mlarkin@

date 2022-11-09T20:00:05Z
author patrick
files src/sys/arch/arm64/conf/GENERIC log diff annotate
src/sys/arch/arm64/conf/RAMDISK log diff annotate
message Enable qcpwm(4)

ok kettenis@ mlarkin@

date 2022-11-09T22:12:40Z
author kn
files src/sys/dev/fdt/simplefb.c log diff annotate
message Constify simplefb_formats[]; OK patrick

date 2022-11-09T22:15:50Z
author dlg
files src/sys/net/if.c log diff annotate
message revert r1.673: replace SRP with SMR in the if_idxmap.

if the map has to be reallocated during boot, there's an smr_barrier
waiting for the old map to become unused. that barrier ends up
waiting for cpus that aren't running yet because we haven't finished
booting yet, so boot gets stuck.

found by hrvoje popovski

date 2022-11-09T22:25:08Z
author deraadt
files src/sys/kern/kern_pledge.c log diff annotate
message Some limited setsockopt/getsockopt are allowed in pledge "stdio".
Also allow IPPROTO_TCP:TCP_NODELAY
It is very small kernel code, and will allow some software to drop "inet"
requested by djm

date 2022-11-09T22:25:36Z
author claudio
files src/sys/kern/kern_event.c log diff annotate
message Remove kernel lock here since msleep() with PCATCH no longer requires it.
OK mpi@

date 2022-11-09T22:56:44Z
author tobhe
files src/sys/dev/fdt/gpiobl.c log diff annotate
src/sys/dev/fdt/simplefb.c log diff annotate
message Hook up gpiobl(4) to the screen burner instead of wsdisplay(4) brightness
control. This enables automatic screen blanking with X and wscons(4) once
wsfb(4) is fixed.

"this is fine for now" kettenis@

date 2022-11-09T23:00:00Z
author sashan
files src/sys/net/pf.c log diff annotate
src/sys/net/pf_ioctl.c log diff annotate
src/sys/net/pfvar.h log diff annotate
message simplify expiration of 'once' rules.
let packet to mark 'once' rule as expired. The rule
will be removed by pfctl(8) when rules are updated.

OK kn@

date 2022-11-10T00:14:11Z
author jsg
files src/sys/kern/kern_pledge.c log diff annotate
message fix build after 1.298

date 2022-11-10T02:47:52Z
author asou
files src/sys/dev/pv/xenstore.c log diff annotate
message Return error number instead of call panic().

ok mpi@

date 2022-11-10T07:05:41Z
author jmatthew
files src/sys/kern/init_main.c log diff annotate
src/sys/kern/subr_evcount.c log diff annotate
src/sys/sys/evcount.h log diff annotate
message Add support for per-cpu event counters, to be used for clock and IPI
counters where the event being counted occurs across all CPUs in the
system. Counter instances can be made per-cpu by calling evcount_percpu()
after the counter is attached, and this can occur before or after all system
CPUs are attached. Per-cpu counter instances should be incremented using
evcount_inc().

ok kettenis@ jca@ cheloha@

date 2022-11-10T07:08:01Z
author jmatthew
files src/sys/arch/sparc64/sparc64/clock.c log diff annotate
message Convert sparc64 clock event counter to per-cpu and increment using
evcount_inc() rather than atomic operations.

ok kettenis@ jca@ cheloha@

date 2022-11-10T08:26:54Z
author jmatthew
files src/sys/arch/amd64/amd64/ipi.c log diff annotate
src/sys/arch/amd64/amd64/lapic.c log diff annotate
message Convert amd64 clock and ipi event counters to per-cpu

ok kettenis@ jca@ cheloha@

date 2022-11-10T10:37:40Z
author kettenis
files src/sys/kern/subr_suspend.c log diff annotate
message Put CPUs in the lowest P-state just before the final suspend step. The
firmware probably does this for us on ACPI systems with proper S3 support,
but this doesn't happen on systems where we park CPUs in a low-power idle
state ourselves.

ok deraadt@

date 2022-11-10T11:23:21Z
author kettenis
files src/sys/arch/arm64/dev/apm.c log diff annotate
message arm64 can suspend without PSCI support now

ok deraadt@, phessler@

date 2022-11-10T11:44:06Z
author kettenis
files src/sys/arch/arm64/dev/aplpmgr.c log diff annotate
message iWe must be careful to only disable power domains that are no longer in
use by a device. So maintainer a counter and only disable the power
domain if it drops to zero.

ok deraadt@, tobhe@

date 2022-11-10T11:45:29Z
author kettenis
files src/sys/arch/arm64/dev/aplsmc.c log diff annotate
message Make the power button function as a wakeup button during suspend.

ok phessler@, patrick@, tobhe@

date 2022-11-10T11:46:39Z
author dv
files src/sys/arch/amd64/include/vmmvar.h log diff annotate
message vmd(8): import mmio decode and emulation, disabled for now.

The initial mmio support for vmd adds support for only specific MOV
and MOVZX instructions. Plan is to begin iterating in-tree on other
missing pieces. All functionality is gated behind an #if for now.

Only change to vmm(4) is reordering register #define's in vmmvar.h.

ok mlarkin@

date 2022-11-10T12:10:54Z
author matthieu
files src/sys/dev/wscons/wskbd.c log diff annotate
message Move the code handling brightness keys into a task, since with
inteldrm(4) it requires a process context. ok kettenis@

date 2022-11-10T12:12:53Z
author patrick
files src/sys/dev/fdt/files.fdt log diff annotate
src/sys/dev/fdt/qcpdc.c log diff annotate
message Add qcpdc(4), a driver for the Qualcomm Power Domain controller found on
Qualcomm SoCs. This is mostly a shim torwards agintc(4).

ok kettenis@

date 2022-11-10T12:13:22Z
author patrick
files src/sys/arch/arm64/conf/GENERIC log diff annotate
src/sys/arch/arm64/conf/RAMDISK log diff annotate
message Enable qcpdc(4)

ok kettenis@

date 2022-11-10T12:14:05Z
author kettenis
files src/sys/dev/pci/if_bwfm_pci.c log diff annotate
message We need to turn a few more things on in the resume path. This makes it
possible to ifconfig down the interface suspend/resume and ifconfig up the
interface again afterwards in most cases. Suspend/resume with the interface
up is still busted.

ok patrick@, stsp@

date 2022-11-10T12:16:06Z
author patrick
files src/sys/dev/fdt/qcspmi.c log diff annotate
message Remove hack that uses a timeout to fake interrupts now that qcpdc(4) allows
us to properly establish interrupts.

The fixed IPL_BIO should probably be replaced by the highest IPL requested
by our children.

ok kettenis@

date 2022-11-10T12:46:19Z
author kn
files src/sys/net/if_var.h log diff annotate
message typofix; ok dlg

date 2022-11-10T14:15:15Z
author kettenis
files src/sys/arch/arm64/dev/aplsart.c log diff annotate
message Add suspend/resume support to control the power domain.

ok patrick@

date 2022-11-10T14:22:43Z
author sashan
files src/sys/net/pf.c log diff annotate
src/sys/net/pfvar.h log diff annotate
message Add a mutex to pf_state structure. Mutex retain a consistency
of structure members without using a global state lock.
The first member which uses protection by mutex is key[] array.
more will follow.

OK dlg@

date 2022-11-10T16:00:17Z
author kn
files src/sys/netinet6/nd6.c log diff annotate
message Use local variable for consistency

OK claudio

date 2022-11-10T16:12:05Z
author krw
files src/sys/kern/subr_disk.c log diff annotate
message Add mbr_get_fstype() and use it to translate MBR dp_typ fields
into FS_* values. Similar to what gpt_get_fstype() does. Code is
clearer and better positioned for planned enhancements to
spoofing.

No intentional functional change.

date 2022-11-10T16:20:54Z
author patrick
files src/sys/dev/fdt/qcpon.c log diff annotate
message Apparently we receive interrupts for both powerkey press and release, which
isn't quite helpful when it's used to come back from suspend and then the
second interrupt initiates powerdown. Ignore press, but handle release.

ok kettenis@

date 2022-11-10T16:29:20Z
author sashan
files src/sys/net/pf.c log diff annotate
src/sys/net/pfvar.h log diff annotate
message revert pf_state mtx commit, because it breaks tree.
pfctl does not build

OK dlg@

date 2022-11-10T17:17:47Z
author dlg
files src/sys/net/if.c log diff annotate
message bring back r1.673: replace SRP with SMR in the if_idxmap.

when i first wrote if_idxmap i didn't realise (and no one thought
to tell me) that index 0 was special and means "no interface", so
while here use the 0th slot in the interface map to store the length
of the map instead of prepending the map with a length field.
if_get() now special cases index 0 and returns NULL directly. this
also means the size of the map is now always a power of 2, which
is a nicer fit with what the kernel malloc aprovides.

the problem with r1.673 that hrvoje popovski found was that attaching
a lot of interfaces during autoconf would lock up when growing the
map called smr_barrier. the fix in this diff is to (ab)use the
usedidx bitmap to store an smr_entry and defer the freeing of the
interface pointer map with it.

tested by hrvoje popovski
tweaks and ok visa@

date 2022-11-10T23:21:15Z
author kettenis
files src/sys/arch/arm64/dev/aplsmc.c log diff annotate
message Sprinkle some #ifdef SUSPEND to unbreak the tree.

date 2022-11-10T23:42:15Z
author jsg
files src/sys/arch/arm64/dev/apm.c log diff annotate
message pscivar.h include no longer needed
ok kettenis@

date 2022-11-11T02:21:09Z
author jsg
files src/sys/dev/pci/drm/amd/amdgpu/amdgpu_kms.c log diff annotate
src/sys/dev/pci/drm/i915/Attic/i915_drv.c log diff annotate
src/sys/dev/pci/drm/radeon/radeon_kms.c log diff annotate
message return early from drm activate functions after fatal error

avoids a page fault trap trying to take an uninitialised
modeset lock on suspend

reported and tested by Ali Farzanrad on HP ProBook 4530s

radeondrm0 at pci1 dev 0 function 0 "ATI Radeon HD 6400M" rev 0x00
drm1 at radeondrm0
radeondrm0: msi
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 3000" rev 0x09
drm0 at inteldrm0
inteldrm0: msi, SANDYBRIDGE, gen 6
..
radeondrm0: CAICOS
[drm] *ERROR* Unable to locate a BIOS ROM
drm:pid0:radeondrm_attachhook *ERROR* Fatal error during GPU init
inteldrm0: 1366x768, 32bpp

date 2022-11-11T06:46:48Z
author anton
files src/sys/dev/hid/files.hid log diff annotate
src/sys/dev/hid/hidcc.c log diff annotate
src/sys/dev/hid/hidccvar.h log diff annotate
message Extract the HID specific pieces from ucc(4) into hidcc. First steps
toward attaching hidcc over i2c.

ok matthieu@

date 2022-11-11T06:48:38Z
author anton
files src/sys/dev/usb/files.usb log diff annotate
src/sys/dev/usb/ucc.c log diff annotate
message Make ucc(4) the first consumer of hidcc. No intended functional change.

ok matthieu@

date 2022-11-11T07:58:42Z
author jsg
files src/sys/dev/pci/pcidevs log diff annotate
message add AMD family 19h model 44h (Rembrandt) ids

from a ThinkPad T14 Gen 3 AMD dmesg provided by Philippe Meunier

date 2022-11-11T07:59:19Z
author jsg
files src/sys/dev/pci/pcidevs.h log diff annotate
message regen

date 2022-11-11T07:59:20Z
author jsg
files src/sys/dev/pci/pcidevs_data.h log diff annotate
message regen

date 2022-11-11T10:51:46Z
author dlg
files src/sys/net/if_pflow.c log diff annotate
message prepare for moving struct pf_state from pfvar.h to pfvar_priv.h

pflow obviously looks at the kernel pf state structure to do it's
thing, so it will need the header that provides it. i'm committing
this chunk separately to the actual pf_state move to keep the commits
small and simple.

ok sashan@

date 2022-11-11T10:55:48Z
author dlg
files src/sys/net/pfvar.h log diff annotate
src/sys/net/pfvar_priv.h log diff annotate
message move struct pf_state from pfvar.h to pfvar_priv.h.

we (sashan) are going to add a mutex to the pf_state struct, but a
mutex is a kernel data structure that changes shape depending on
things like whether MULTIPROCESSOR is enabled, and should therefore
not be visible to userland. when we added a mutex to pf_state,
compiling pfctl failed because it doesn't know what a mutex is and
it can't know which version of it the current kernel is running
with.

moving struct pf_state to pfvar_priv.h makes it clear it is a private
kernel only data structure, and avoids this leak into userland.

tested by me and make build
ok sashan@

date 2022-11-11T11:02:35Z
author dlg
files src/sys/net/pf.c log diff annotate
src/sys/net/pfvar.h log diff annotate
src/sys/net/pfvar_priv.h log diff annotate
message rewrite the pf_state_peer_ntoh and pf_state_peer_hton macros as functions.

i can read this code as functions, but it takes too much effort as macros.

date 2022-11-11T11:22:48Z
author sashan
files src/sys/net/if_pfsync.c log diff annotate
message Turn KASSERT() into if() to prevent state being inserted to
pfsync snapshot multiple times.

OK dlg@

date 2022-11-11T11:45:10Z
author kettenis
files src/sys/arch/arm64/dev/aplns.c log diff annotate
src/sys/arch/arm64/dev/aplsart.c log diff annotate
src/sys/arch/arm64/dev/rtkit.c log diff annotate
src/sys/arch/arm64/dev/rtkit.h log diff annotate
message Unmap and free memory when we shutdown rtkit. This fixes an issue where
we run out of SART entries after a few suspend/resume cycles.

ok patrick@

date 2022-11-11T11:47:12Z
author dlg
files src/sys/net/pf.c log diff annotate
message rename pfsync_up() to pfsync_is_up()

foo_up() where foo is a network driver is usually a function that
configures and brings an interface up into a running state. this
small tweak just makes the code a bit easier for me to read.

date 2022-11-11T11:47:13Z
author dlg
files src/sys/net/if_pfsync.c log diff annotate
src/sys/net/if_pfsync.h log diff annotate
message rename pfsync_up() to pfsync_is_up()

foo_up() where foo is a network driver is usually a function that
configures and brings an interface up into a running state. this
small tweak just makes the code a bit easier for me to read.

date 2022-11-11T12:06:17Z
author dlg
files src/sys/net/pfvar_priv.h log diff annotate
message steal a change by sashan@ to say which bits of pf_state need which locks.

not all members are annotated yet, but that's because there's no clear
protection for them yet.

ok sashan@

date 2022-11-11T12:14:01Z
author krw
files src/sys/kern/subr_disk.c log diff annotate
message Use the first 8 bytes of GPT gh_guid as the default d_uid. gh_guid is
initialized with arc4random().

date 2022-11-11T12:29:32Z
author dlg
files src/sys/net/pfvar_priv.h log diff annotate
message kn@ points out that lock annotations are usually wrapped in ()

date 2022-11-11T12:36:05Z
author dlg
files src/sys/net/pfvar_priv.h log diff annotate
message fix a misuse of vi.

date 2022-11-11T12:50:45Z
author dlg
files src/sys/net/pfvar_priv.h log diff annotate
message kn points out that brackets are not parentheses

date 2022-11-11T13:59:40Z
author anton
files src/sys/dev/hid/hidcc.c log diff annotate
message ihidev can pass a buffer larger than the size of the claimed input
report since it unconditionally uses the size of the longest input
report. This is quite harmless and the defensive check in hidcc can
therefore be relaxed and instead only examining the number of expected
bytes.

ok matthieu@ patrick@

date 2022-11-11T15:02:31Z
author dlg
files src/sys/net/pf.c log diff annotate
src/sys/net/pfvar_priv.h log diff annotate
message add a mutex to struct pf_state and init it.

nothing is protected by it yet but it will allow us to provide
consistent updates to individual states without relying on a global
lock. getting that right between the packet processing in pf itself,
pfsync, the pf purge code, the ioctl paths, etc is not worth the
required contortions.

while pf_state does grow, it doesn't use more cachelines on machines
where we will want to run in parallel with a lot of states.

stolen from and ok sashan@

date 2022-11-11T15:25:13Z
author matthieu
files src/sys/dev/hid/hidcc.c log diff annotate
src/sys/dev/i2c/files.i2c log diff annotate
src/sys/dev/i2c/icc.c log diff annotate
message Add icc(4) to handle Customer Control keyboards attached to i2c bus.
ok anton@ patrick@

date 2022-11-11T15:27:39Z
author matthieu
files src/sys/arch/amd64/conf/GENERIC log diff annotate
src/sys/arch/arm64/conf/GENERIC log diff annotate
message Enable icc(4). ok anton@ patrick@

date 2022-11-11T16:12:08Z
author dlg
files src/sys/net/pf.c log diff annotate
src/sys/net/pf_ioctl.c log diff annotate
src/sys/net/pfvar.h log diff annotate
src/sys/net/pfvar_priv.h log diff annotate
message try pf.c r1.1143 again: move pf_purge out from under the kernel lock

this also avoids holding NET_LOCK too long.

the main change is done by running the purge tasks in systqmp instead
of systq. the pf state list was recently reworked so iteration over
the state can be done without blocking insertions.

however, scanning a lot of states can still take a lot of time, so
this also makes the state list scanner yield if it has spent too
much time running.

the other purge tasks for source nodes, rules, and fragments have
been moved to their own timeout/task pair to simplify the time
accounting.

in my environment, before this change pf purges often took 10 to
50ms. the softclock thread runs next to it often took a similar
amount of time, presumably because they ended up spinning waiting
for each other. after this change the pf_purges are more like 6 to
12ms, and dont block softclock. most of the variability in the runs
now seems to come from contention on the net lock.

tested by me sthen@ chris@
ok sashan@ kn@ claudio@

the diff was backed out because it made things a bit more racey,
but sashan@ has squashed those races this week. let's try it again.

date 2022-11-11T16:41:44Z
author mbuhl
files src/sys/dev/pci/if_igc.c log diff annotate
message Due to checksum offloading one more element could be written to the ring
than there is space available.
ok dlg

date 2022-11-11T17:12:30Z
author dlg
files src/sys/net/pfvar_priv.h log diff annotate
message me and my text editor are not getting along today

date 2022-11-11T17:23:09Z
author matthieu
files src/sys/dev/hid/hidcc.c log diff annotate
message Debug was accidentally left enabled in previous commit.

date 2022-11-11T18:09:58Z
author cheloha
files src/sys/kern/kern_fork.c log diff annotate
src/sys/kern/kern_timeout.c log diff annotate
src/sys/netinet/ip_ipsp.c log diff annotate
src/sys/sys/timeout.h log diff annotate
message timeout(9): remove timeout_set_kclock(), TIMEOUT_INITIALIZER_KCLOCK()

We have too many timeout(9) initialization functions and macros.
Let's slim it down and combine some interfaces.

- Remove timeout_set_kclock(), TIMEOUT_INITIALIZER_KCLOCK().
- Expand timeout_set_flags(), TIMEOUT_INITIALIZER_FLAGS() to accept
an additional "kclock" parameter.
- Reimplement timeout_set(), timeout_set_proc() with timeout_set_flags().
- Reimplement TIMEOUT_INITIALIZER() with TIMEOUT_INITIALIZER_FLAGS().
- Update the sole timeout_set_flags() user to pass a kclock parameter.
- Update the sole timeout_set_kclock() user to call timeout_set_flags().
- Update the sole TIMEOUT_INITIALIZER_FLAGS() user to provide a kclock
parameter.

The timeout(9) code is now a bit out of sync with the manpage. This
will be corrected in a subsequent commit.

ok kn@

date 2022-11-11T18:53:29Z
author krw
files src/sys/kern/subr_disk.c log diff annotate
message Revert last until we can guarantee gh_guid can't escape to the
d_uid written to disk.

date 2022-11-12T02:48:14Z
author kn
files src/sys/net/pf.c log diff annotate
message Put pf_state_import() under NPFSYNC>0 to fix build without pfsync

date 2022-11-12T02:49:34Z
author kn
files src/sys/netinet6/ip6_var.h log diff annotate
message Zap dead ip6_auto_linklocal

Removed in 2015 15f0a5b39a2bb226b44457ed81a5d989cfee0393
Ensure that link-local addresses are correctly configured on loopback
interfaces.

date 2022-11-12T02:50:59Z
author kn
files src/sys/netinet6/ip6_output.c log diff annotate
message Zap comment about dead linkmtu

Removed in 2015 a923c8476c6771493ee2bc4f277a429c9ae3eaff
Remove linkmtu and maxmtu from struct nd_ifinfo.

date 2022-11-12T02:53:17Z
author kn
files src/sys/netinet6/nd6.h log diff annotate
message Remove unused RS_LHCOOKIE macro

Added in 2014 110585f259f4974284e531f0a1e121b001a580dc
Move sending of router solicitations to the kernel; [...]
but never used.

date 2022-11-12T12:58:34Z
author kettenis
files src/sys/arch/arm64/arm64/pmap.c log diff annotate
message Fix a long-standing pmap bug, where we would enter an executable mapping
for a page before synchronizing the data and instruction cache. This means
that another thread that is executing code on this page may not fault, but
see stale contennts until the data cache flushes and/or instruction cache
invalidation propagates. The bug surfaced when testing a change that would
recycle code pages quickly instead of keeping them around.

Fix the issue by synchronizing the caches before entering an executable
mapping for a page. Also make sure we mark the page as "clean" after
synchronization instead of before.

ok patrick@, jca@ (and mpi@ and dlg@ for an earlier version of this diff)

date 2022-11-12T16:36:07Z
author kn
files src/sys/netinet6/in6.c log diff annotate
src/sys/netinet6/in6_var.h log diff annotate
message Remove unused fields from struct in6_ifextra

This is all under _KERNEL:
- rs_lhcookie was added in 2014 110585f259f4974284e531f0a1e121b001a580dc
"Move sending of router solicitations to the kernel; [...]"
but never used
- nprefixes and ndefrouters became obsolete with 2017
4a2f474d14c160dc7829cce0149ead09d473ece9
"Remove sending of router solicitations and processing of router
advertisements from the kernel. [...]"

OK mpi

date 2022-11-13T16:01:32Z
author mvs
files src/sys/kern/uipc_proto.c log diff annotate
src/sys/kern/uipc_usrreq.c log diff annotate
src/sys/sys/unpcb.h log diff annotate
message Split out handlers for SOCK_DGRAM unix(4) sockets from SOCK_STREAM and
SOCK_SEQPACKET. Introduce `uipc_dgram_usrreqs' to store pointers for
dgram specific handlers.

The dgram pru_shutdown and pru_send handlers were splitted to
uipc_dgram_shutdown() and uipc_dgram_send(). The pru_accept, pru_rcvd
and pru_abort handlers are not required for dgram sockets.

The unp_disconnect() remains shared between all unix(4) sockets because
it called from common paths too.

Proposed by and ok guenther@

date 2022-11-13T16:14:06Z
author jca
files src/sys/arch/riscv64/riscv64/pmap.c log diff annotate
message Sync data and instruction cache before entering an executable page

Adapted from kettenis' fix for arm64/pmap.c. Since we haven't been able
to reliably reproduce the clang crashes that affect base and ports, it
not yet known whether riscv64 was badly affected by this misordering.
Time will tell. ok kettenis@

date 2022-11-14T00:16:44Z
author deraadt
files src/sys/dev/hid/hidcc.c log diff annotate
message include sys/device.h, on some architectures this gets pulled in, but others
(like sparc64) require it explicitly

date 2022-11-14T00:16:46Z
author deraadt
files src/sys/dev/usb/ucc.c log diff annotate
message include sys/device.h, on some architectures this gets pulled in, but others
(like sparc64) require it explicitly

date 2022-11-14T07:22:44Z
author miod
files src/sys/dev/fdt/pwmbl.c log diff annotate
message When the fdt does not provide a list of brightness states, pwmbl(4)
builds a 256 state ramp (i.e. state[i] = i with 0 <= i < 256).

Change the logic to not need to malloc an array of values in this case,
since they are trivially known.

test&ok patrick@

date 2022-11-14T11:11:17Z
author kettenis
files src/sys/arch/arm64/dev/aplsmc.c log diff annotate
message Turns out the power button on the Mac mini and the touchid button on the
various Macbook models generate different events. So rename the existing
constant for a "short press" of the touchid button and add support for the
power button on the Mac mini such that is can be resumed.

ok tobhe@, patrick@

date 2022-11-14T17:12:55Z
author claudio
files src/sys/netinet6/in6_ifattach.c log diff annotate
message Relax the list of interfaces which support IPv6 a bit.

No longer require IFF_MULTICAST for all interfaces. It is save to skip
this for interfaces that don't require a ND cache. Also do not assign a
link-local address in such cases. This affects point-to-point interfaces
and the NBMA / point-to-multipoint interfaces like mpe(4), mgre(4) and wg(4).
The NBMA interfaces need some alternative way to figure out the address
mapping. In the end this allows non-multicast interfaces to work with IPv6.
OK dlg@ kn@

date 2022-11-14T17:15:41Z
author visa
files src/sys/arch/loongson/loongson/isa_machdep.c log diff annotate
message Add missing clock trigger to loongson_isa_splx().

Fixes unexpected delays that have occurred with mips64 clock(4).

date 2022-11-14T17:25:00Z
author visa
files src/sys/kern/exec_elf.c log diff annotate
message Fix tag type and buffer limit in DT_TEXTREL lookup.

OK deraadt@ kettenis@

date 2022-11-14T22:06:25Z
author kn
files src/sys/net/if.c log diff annotate
message Document global interface group list locking

The per-interface group list is protected by the net lock and already
documented as such.

The global interface group list `ifg_head' is also protected by the net
lock and all access to it (all within if.c) take it accordingly.

Feedback OK mvs

date 2022-11-14T22:06:26Z
author kn
files src/sys/net/if_var.h log diff annotate
message Document global interface group list locking

The per-interface group list is protected by the net lock and already
documented as such.

The global interface group list `ifg_head' is also protected by the net
lock and all access to it (all within if.c) take it accordingly.

Feedback OK mvs

date 2022-11-14T22:07:30Z
author kn
files src/sys/net/if.c log diff annotate
message Unlock SIOCGIFCONF

As netintro(4) explains, this copies a bunch of data from the global
interface list as well as its per-interface address lists.

All of this is never written to by ifconf(), protected by the net lock
and documented as such in the struct comments already.

OK mvs

date 2022-11-14T22:45:02Z
author kn
files src/sys/net/if.c log diff annotate
message Unlock SIOCGIFG{MEMB,ATTR,LIST}

The global interface group list is also protected by the net lock and all
access to it (all within if.c) take it accordingly.

Getting all
- members of a group (SIOCGIFGMEMB),
- attributes of a group (SIOCGIFGATTR),
- groups (SIOCGIFGLIST)
are each read-only operations on the global interface group `ifg_head'.

The global interface list `ifnetlist' or its per-interface group lists are
not used in these ioctls.

OK mvs