mpi [Wed, 9 Nov 2022 10:27:01 +0000 (10:27 +0000)]
regen
krw [Wed, 9 Nov 2022 10:26:37 +0000 (10:26 +0000)]
gpt_get_fstype() doesn't modify its parameter so make said
parameter const.
mpi [Wed, 9 Nov 2022 10:26:28 +0000 (10:26 +0000)]
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@
sthen [Wed, 9 Nov 2022 10:23:01 +0000 (10:23 +0000)]
add an example for adding a cloning host route to reach a gateway which is
outside the subnet, some hosting providers use this. info from Eric JACQUOT
ok florian kn phessler
dlg [Wed, 9 Nov 2022 10:19:20 +0000 (10:19 +0000)]
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.
espie [Wed, 9 Nov 2022 10:10:53 +0000 (10:10 +0000)]
document '=' as a pkgspec
robert [Wed, 9 Nov 2022 10:05:18 +0000 (10:05 +0000)]
translate Fn+(1-10,-,=) keys to F1-F12 on M1 laptops with a touchbar
ok kettenis@, miod@
robert [Wed, 9 Nov 2022 10:03:22 +0000 (10:03 +0000)]
regen
robert [Wed, 9 Nov 2022 10:03:04 +0000 (10:03 +0000)]
add a USB ID for WELLSPRINGM1_J293 to be used by aplhidev(4) to identify
M1 laptops with touchbars
dtucker [Wed, 9 Nov 2022 09:04:12 +0000 (09:04 +0000)]
Fix typo in fatal error message. Patch from vapier at chromium.org.
dtucker [Wed, 9 Nov 2022 09:01:52 +0000 (09:01 +0000)]
Remove errant colon and simplify format string in error messages.
Patch from vapier at chromium.org.
miod [Wed, 9 Nov 2022 07:20:12 +0000 (07:20 +0000)]
Remove old-style eeprom mentions and relevant leftover code; ok kettenis@
miod [Wed, 9 Nov 2022 07:11:30 +0000 (07:11 +0000)]
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@
jmc [Wed, 9 Nov 2022 06:48:29 +0000 (06:48 +0000)]
use Fn; from josiah frentsos
stsp [Wed, 9 Nov 2022 06:32:58 +0000 (06:32 +0000)]
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]
tb [Wed, 9 Nov 2022 02:01:13 +0000 (02:01 +0000)]
Drop some dead code
ok jsing
djm [Wed, 9 Nov 2022 01:37:44 +0000 (01:37 +0000)]
rename client_global_hostkeys_private_confirm() to
client_global_hostkeys_prove_confirm(), as it handles the
"hostkeys-prove00@openssh.com" message; no functional change
tobhe [Wed, 9 Nov 2022 01:05:45 +0000 (01:05 +0000)]
Fix possible memory leak in BN_mpi2bn() if BN_bin2bn() fails.
found with CodeChecker
feedback from millert@
ok tb@
djm [Wed, 9 Nov 2022 00:15:59 +0000 (00:15 +0000)]
typo in comment
mbuhl [Tue, 8 Nov 2022 23:19:09 +0000 (23:19 +0000)]
In case lh_OBJ_NAME_insert returns NULL due to a failed malloc, onp
is leaked in OBJ_NAME_add.
ok tb
Found by CodeChecker.
kn [Tue, 8 Nov 2022 21:07:33 +0000 (21:07 +0000)]
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.
mlarkin [Tue, 8 Nov 2022 20:41:36 +0000 (20:41 +0000)]
KNF/whitespace - no code change
patrick [Tue, 8 Nov 2022 19:52:40 +0000 (19:52 +0000)]
Tedu spmi bus definition that moved over to the fdt files.
patrick [Tue, 8 Nov 2022 19:49:34 +0000 (19:49 +0000)]
Hook up all those Qualcomm SoC SPMI devices.
patrick [Tue, 8 Nov 2022 19:47:05 +0000 (19:47 +0000)]
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@
patrick [Tue, 8 Nov 2022 19:44:28 +0000 (19:44 +0000)]
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@
patrick [Tue, 8 Nov 2022 19:42:10 +0000 (19:42 +0000)]
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@
patrick [Tue, 8 Nov 2022 19:40:08 +0000 (19:40 +0000)]
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@
dlg [Tue, 8 Nov 2022 19:38:34 +0000 (19:38 +0000)]
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
patrick [Tue, 8 Nov 2022 19:34:54 +0000 (19:34 +0000)]
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@
tobhe [Tue, 8 Nov 2022 19:19:08 +0000 (19:19 +0000)]
Rename out to err to conform with standard naming scheme.
dlg [Tue, 8 Nov 2022 19:18:47 +0000 (19:18 +0000)]
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@
robert [Tue, 8 Nov 2022 19:17:58 +0000 (19:17 +0000)]
allow the KERN_AUTOCONF_SERIAL sysctl in pledge'd processes
ok deraadt@
tobhe [Tue, 8 Nov 2022 19:17:05 +0000 (19:17 +0000)]
Fix leak of pk if EVP_PKEY_set1_DSA() fails.
Found with CodeChecker
ok jsing@
cheloha [Tue, 8 Nov 2022 19:09:53 +0000 (19:09 +0000)]
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@
tobhe [Tue, 8 Nov 2022 19:07:34 +0000 (19:07 +0000)]
Enable gpiobl(4)
tobhe [Tue, 8 Nov 2022 19:06:57 +0000 (19:06 +0000)]
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@
kn [Tue, 8 Nov 2022 18:47:58 +0000 (18:47 +0000)]
Use four spaces not tabs on line break
kn [Tue, 8 Nov 2022 18:43:22 +0000 (18:43 +0000)]
Document ifc_list immutability
Move up to comment explaining different locks to account for all structs.
OK millert mvs
kettenis [Tue, 8 Nov 2022 18:28:10 +0000 (18:28 +0000)]
Implement alternative mailbox handling mechanism required by newer firmware.
ok patrick@
cheloha [Tue, 8 Nov 2022 18:17:51 +0000 (18:17 +0000)]
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@
mlarkin [Tue, 8 Nov 2022 18:08:43 +0000 (18:08 +0000)]
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
kn [Tue, 8 Nov 2022 17:57:47 +0000 (17:57 +0000)]
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
kn [Tue, 8 Nov 2022 17:57:14 +0000 (17:57 +0000)]
Push kernel lock inside ifioctl_get()
After this mechanical move, I can unlock the individual SIOCG* in there.
OK mvs
cheloha [Tue, 8 Nov 2022 17:56:38 +0000 (17:56 +0000)]
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@
kn [Tue, 8 Nov 2022 17:53:01 +0000 (17:53 +0000)]
fix indent
krw [Tue, 8 Nov 2022 17:52:11 +0000 (17:52 +0000)]
Nuke unused variable 'freesectors'.
cheloha [Tue, 8 Nov 2022 17:34:12 +0000 (17:34 +0000)]
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@
jsing [Tue, 8 Nov 2022 17:07:17 +0000 (17:07 +0000)]
Refactor/split ED25519_keypair.
This brings in ED25519_keypair_from_seed() from BoringSSL commit
c034e2d3ce16, which ED25519_keypair then wraps. This reduces differences
between us and BoringSSL.
jsing [Tue, 8 Nov 2022 17:01:57 +0000 (17:01 +0000)]
Change function argument to reduce differences with BoringSSL.
kettenis [Tue, 8 Nov 2022 16:53:40 +0000 (16:53 +0000)]
Extent the current suspend/resume implementation to include support for
parking CPUs in a WFE/WFI loop.
ok deraadt@, mlarkin@
jsing [Tue, 8 Nov 2022 16:50:29 +0000 (16:50 +0000)]
Remove pointless loops.
From BoringSSL
997c706d43504.
tb [Tue, 8 Nov 2022 16:48:28 +0000 (16:48 +0000)]
Avoid signed integer overflow in i2c_ASN1_BIT_STRING()
If the length of the bitstring is INT_MAX, adding 1 to it is undefined
behavior, so error out before doing so.
Based on BoringSSL
eeb3333f by davidben
ok beck joshua
sashan [Tue, 8 Nov 2022 16:20:26 +0000 (16:20 +0000)]
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@
kn [Tue, 8 Nov 2022 15:20:24 +0000 (15:20 +0000)]
Push kernel lock into ifioctl_get()
Another mechanical diff without semantic changes to avoid churn in actual
unlocking diffs.
OK mpi
cheloha [Tue, 8 Nov 2022 14:54:47 +0000 (14:54 +0000)]
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@
cheloha [Tue, 8 Nov 2022 14:49:20 +0000 (14:49 +0000)]
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@
cheloha [Tue, 8 Nov 2022 14:46:51 +0000 (14:46 +0000)]
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@
beck [Tue, 8 Nov 2022 14:42:42 +0000 (14:42 +0000)]
Add missing $OpenBSD$
kn [Tue, 8 Nov 2022 14:05:41 +0000 (14:05 +0000)]
Skip softraid(4) keydisks silently
Logging the presence of a keydisk the same way offline data chunks are
logged seems unjustified:
Offline data chunks mean the softraid volume is degraded and installboot(8)
should be rerun when they're online.
Offline keydisks just means the user unplugged their USB key or so and
installboot must never touch them anyway, so the absence of keydisks is
meaningless to installboot -- it should never touch them.
So a) drop the "is keydisk - skipping" message and b) hoist the keydisk
check before the offline check so as to avoid "not online - skipping"
messages for offline keydisks.
kettenis [Tue, 8 Nov 2022 14:01:13 +0000 (14:01 +0000)]
Move definitions for CNTV_CTL_EL0 to armreg.h.
ok mpi@, jsg@, phessler@, patrick@
deraadt [Tue, 8 Nov 2022 13:47:22 +0000 (13:47 +0000)]
In the new scheme, the main executable object needs to be marked
nodelete, so that _dl_relro() will immutable it's relro.
tb [Tue, 8 Nov 2022 13:01:53 +0000 (13:01 +0000)]
rpki-client regress: fix build after beck's libcrypto time changes
tobhe [Tue, 8 Nov 2022 12:59:36 +0000 (12:59 +0000)]
Fix leak of pk if EVP_PKEY_set1_RSA() fails.
Found with CodeChecker
feedback and ok tb@
beck [Tue, 8 Nov 2022 12:56:00 +0000 (12:56 +0000)]
Replace the old OpenSSL julian date stuff with BoringSSL's
OpenSSL dealt with time conversion using a classical julian
day scheme. BoringSSL got rid of it and uses only a julian
style calculation for seconds since the POSIX time epoch.
This changes libressl to use the seconds calculation exculusively
instead of a mix of the julian day based conversions and the
system time conversions to and from time_t to tm.
ok tb@ jsing@
dv [Tue, 8 Nov 2022 12:41:00 +0000 (12:41 +0000)]
whitespace fix in debug printf, no functional change.
kn [Tue, 8 Nov 2022 12:11:13 +0000 (12:11 +0000)]
Document network-boot-arguments for sparc64 diskless(8)
The Oracle OpenBoot 4.x Administration Guide[0] documents a few useful
options for network boot.
Basically, either
{ok} setenv network-boot-arguments tftp-retries=0
{ok} boot net ...
or
{ok} boot net:tftp-retries=0 ...
Newer machines like the T4-2 using OpenBoot 4.38.16 also support BOOTP/DHCP
besides RARP: "dhcp,hostname=puffy" works as expected on my
T4-2, but "boot-filename" and "boot-retries" remain unsupported on this
particular machine despite being documented in the guide.
0: https://docs.oracle.com/cd/E63648_01/html/E63649/gpvll.html#scrolltoc
OK miod
kn [Tue, 8 Nov 2022 12:08:53 +0000 (12:08 +0000)]
Make "prepare filesystem" softraid aware, fix arm64 softraid install
On EFI platforms, 'installboot -p' on a softraid volume will only prepare
the filesysem inside the volume and leave physical softraid chunks untouched
which leaves you with unbootable chunks.
The current workaround is to prepare chunks manually (see regress).
Fix it in the same spirit the actual "install" already works in softraid.c.
This is what mlarkin has already been tested in a combined diff with the
MD -> MI softraid merge bits from the previous commit.
Works fine on amd64, arm64 and sparc64 upgrades and installations.
OK jsing
patrick [Tue, 8 Nov 2022 11:51:34 +0000 (11:51 +0000)]
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@
kettenis [Tue, 8 Nov 2022 11:40:47 +0000 (11:40 +0000)]
Sprinkle some #ifdef MULTIPROCESSOR to make non-MP kernels build again.
kn [Tue, 8 Nov 2022 11:25:01 +0000 (11:25 +0000)]
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
mpi [Tue, 8 Nov 2022 11:06:41 +0000 (11:06 +0000)]
Regen
mpi [Tue, 8 Nov 2022 11:05:57 +0000 (11:05 +0000)]
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@
nicm [Tue, 8 Nov 2022 10:04:31 +0000 (10:04 +0000)]
Fix C-S-Tab without extended keys, from Aaron Jensen.
tb [Tue, 8 Nov 2022 08:15:39 +0000 (08:15 +0000)]
stray space
deraadt [Tue, 8 Nov 2022 06:55:53 +0000 (06:55 +0000)]
Since the introduction of automatic immutable from the kernel, the munmap()
of ld.so boot.text region is now (silently) failing because the region is
contained within the text LOAD, which is immutable. So create a new btext
LOAD with flags PF_X|PF_R|PF_OPENBSD_MUTABLE, and place all boot.text objects
in there. This LOAD must also be page-aligned so it doesn't skip unmapping
some of the object region, previously it was hilariously unaligned.
ok kettenis and guenther seemed to like it also
This one is for riscv64, tested by jca
deraadt [Tue, 8 Nov 2022 06:47:31 +0000 (06:47 +0000)]
Instead of unmapping boot.text, and then a future allocation could land in
the gap, mmap a fresh MAP_FIXED MAP_ANON PROT_NONE and make it immutable
for good measure
ok guenther kettenis
joshua [Mon, 7 Nov 2022 23:09:25 +0000 (23:09 +0000)]
Wrap long lines
ok jsing@
joshua [Mon, 7 Nov 2022 23:04:25 +0000 (23:04 +0000)]
Move variables above code
ok jsing@
mbuhl [Mon, 7 Nov 2022 22:48:35 +0000 (22:48 +0000)]
Fix a memory leak in the error path of rde_dump_ctx_new.
ctx is leaked in case of an allocation in prefix_dump_new,
prefix_dump_subtree, rib_dump_new, or rib_dump_subtree fails.
Found by CodeChecker.
OK claudio@
tobhe [Mon, 7 Nov 2022 22:39:52 +0000 (22:39 +0000)]
Free objects that were dynamically allocated in libcrypto with OPENSSL_free().
When linking against libressl, OPENSSL_malloc() is just a wrapper around malloc()
so regular free() is safe. Other implementations allow switching to a different
allocator where free() could result in a possible heap corruption.
Report and initial fix by dropk1ck (gh #92)
ok tb@
mbuhl [Mon, 7 Nov 2022 22:39:13 +0000 (22:39 +0000)]
Fix theoretical access to garbage stack memory in pfkey_reply for
bgpd and ldpd.
Found by CodeChecker.
OK claudio@
deraadt [Mon, 7 Nov 2022 21:12:57 +0000 (21:12 +0000)]
Missed an ALIGN (which I will admit I do not understand, this is voodoo)
deraadt [Mon, 7 Nov 2022 20:41:38 +0000 (20:41 +0000)]
Since the introduction of automatic immutable from the kernel, the munmap()
of ld.so boot.text region is now (silently) failing because the region is
contained within the text LOAD, which is immutable. So create a new btext
LOAD with flags PF_X|PF_R|PF_OPENBSD_MUTABLE, and place all boot.text objects
in there. This LOAD must also be page-aligned so it doesn't skip unmapping
some of the object region, previously it was hilariously unaligned.
Similar changes for other architectures coming after more testing.
ok kettenis and guenther seemed to like it also
patrick [Mon, 7 Nov 2022 20:28:23 +0000 (20:28 +0000)]
The gpiokeys(4) 'label' property seems to be optional. If we don't have
any, don't try and print it, and especially don't error out.
Tested on Lenovo x13s (myself) and Pinebook Poop (kn@)
ok kn@
patrick [Mon, 7 Nov 2022 20:15:44 +0000 (20:15 +0000)]
Add support for the PCIe controller on the Qualcomm SC8280XP. Thankfully
UEFI already initializes those, so we can simply just make use of that.
That said, the ctrl/dbi region isn't the first in the register list, so
instead try and look it up first and use it if available. Furthermore,
the ATU region isn't part of the ctrl/dbi region, so if we are able to
retrieve a separate reg for the ATU, use that instead. Some reshuffling
is necessary to make that work.
Tested on my Lenovo x13s and the MacchiatoBin
ok kettenis@
schwarze [Mon, 7 Nov 2022 19:42:24 +0000 (19:42 +0000)]
White space KNF, no code change:
- line breaking and indentation in three struct declarations
- removal of trailing whitespace
Found while working on /usr/src/regress/lib/libcrypto/man/check_complete.pl .
OK tb@
patrick [Mon, 7 Nov 2022 19:07:31 +0000 (19:07 +0000)]
The ARM SMMUv2 does actually support #iommu-cells = <2>, where the second
cell is used as a mask for SMR to match a number of IDs. So far we have
asserted that it's always 1, so loosen the restriction and pass both cells
instead of only the sid.
ok kettenis@
kettenis [Mon, 7 Nov 2022 18:56:20 +0000 (18:56 +0000)]
Implement the "halt" IPI.
ok patrick@
tb [Mon, 7 Nov 2022 18:55:35 +0000 (18:55 +0000)]
Rework OpenSSL regress binding a bit to prepare for an upcoming beck
diff.
joshua [Mon, 7 Nov 2022 17:42:08 +0000 (17:42 +0000)]
Link aes/ to regress
joshua [Mon, 7 Nov 2022 17:41:40 +0000 (17:41 +0000)]
Add regress coverage for AES
ok tb@
dlg [Mon, 7 Nov 2022 16:35:11 +0000 (16:35 +0000)]
revert "move pf_purge out from under the kernel lock".
hrvoje popovski showed me pfsync blowing up with this. im backing
it out quickly in case something else at the hackathon makes it
harder to do later.
kn@ agrees
job [Mon, 7 Nov 2022 16:23:32 +0000 (16:23 +0000)]
Simplify use of strrchr()
with and OK tb@
kn [Mon, 7 Nov 2022 15:56:09 +0000 (15:56 +0000)]
Merge duplicate MD code into MI sr_open_chunk()
It does not have the prettiest signature, but nicely folds identical copies
into softraid.c, which then allows us to reuse sr_open_chunk() yet again in
an upcoming diff to make -p softraid aware (fixes arm64 installations).
Regress keeps passing.
Works fine on amd64, arm64 and sparc64.
"looks fine" mlarkin for whom this unbreaks a fresh arm64 softraid install
kn [Mon, 7 Nov 2022 15:55:56 +0000 (15:55 +0000)]
Use variable and shorter logic for NFS check
No need to hardcode a parent path if we can reuse an existing variable for
the specific path that is in being used.
Negate the file system type in df(1) so the `|| exit 1' can be dropped
in favour of the errexit option, as is done for everything else in there.
Clarify the comment how this is intentionally NOT logged, i.e. the test
happens before the error trap/syslog/logfile handling.
OK millert
jmc [Mon, 7 Nov 2022 15:32:24 +0000 (15:32 +0000)]
remove one more reference to tcp/slowhz;
while here, wrap some long lines;
robert [Mon, 7 Nov 2022 14:25:44 +0000 (14:25 +0000)]
introduce a new kern.autoconf_serial sysctl that can be used by userland
to monitor state changes of the kernel device tree
input from dnd ok dlg@, deraadt@
deraadt [Mon, 7 Nov 2022 13:19:38 +0000 (13:19 +0000)]
sync
dlg [Mon, 7 Nov 2022 12:56:38 +0000 (12:56 +0000)]
move pf_purge out from under the kernel lock and avoid the hogging cpu
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@