openbsd
22 months agoreplace manual poll/ppoll timeout math with ptimeout API
djm [Fri, 6 Jan 2023 02:38:23 +0000 (02:38 +0000)]
replace manual poll/ppoll timeout math with ptimeout API

feedback markus / ok markus dtucker

22 months agoadd ptimeout API for keeping track of poll/ppoll timeouts;
djm [Fri, 6 Jan 2023 02:37:04 +0000 (02:37 +0000)]
add ptimeout API for keeping track of poll/ppoll timeouts;
ok dtucker markus

22 months agomore consistently name pf_state * variables "st".
dlg [Thu, 5 Jan 2023 23:44:35 +0000 (23:44 +0000)]
more consistently name pf_state * variables "st".

pf_state ** are generally called "stp" now too.

discussed with and ok sashan@

22 months agodo not blow up if NOMAN is set
deraadt [Thu, 5 Jan 2023 22:17:43 +0000 (22:17 +0000)]
do not blow up if NOMAN is set

22 months agoafter a few trap.c were fixed to fault with the right access, the
deraadt [Thu, 5 Jan 2023 21:39:57 +0000 (21:39 +0000)]
after a few trap.c were fixed to fault with the right access, the
signal trampoline can now be PROT_EXEC (without PROT_READ) everywhere
ok kettenis

22 months agoThe access type for a prefetch abort should not include PROT_READ,
kettenis [Thu, 5 Jan 2023 20:35:44 +0000 (20:35 +0000)]
The access type for a prefetch abort should not include PROT_READ,
otherwise faults on executable pages mapped only as PROT_EXEC will
not work.

ok deraadt@

22 months agoAdd a dummy --no-execute-only option for compatibility with ld.lld.
kettenis [Thu, 5 Jan 2023 18:55:04 +0000 (18:55 +0000)]
Add a dummy --no-execute-only option for compatibility with ld.lld.
This will allow ports people to sprinkle -Wl,--no-execute-only across the
ports tree when necessary without having to distinguish between ld.bfd and
ld.lld arcitectures.

ok deraadt@, sthen@

22 months agopfctl fails to add addresses to undefined/inactive table
sashan [Thu, 5 Jan 2023 10:06:58 +0000 (10:06 +0000)]
pfctl fails to add addresses to undefined/inactive table

pfr_add_tables() function must set PFR_TFLAG_ACTIVE flag
to table which is attached to rule. This will then allow
pfr_add_addrs() to populate the table with addresses.

without this pair of pfctl(8) commands fails as follows:
    # echo 'pass from <foo> to any' |pfctl -f -
    # pfctl -t foo -T add 192.168.1.0/24
    pfctl: Table does not exist

OK mbuhl@

22 months agosuppress "Connection closed" message when in quiet mode
djm [Thu, 5 Jan 2023 05:49:13 +0000 (05:49 +0000)]
suppress "Connection closed" message when in quiet mode

22 months agoRewrite BN_rshift()
jsing [Thu, 5 Jan 2023 04:51:13 +0000 (04:51 +0000)]
Rewrite BN_rshift()

This improves readability and eliminates special handling for various
cases, making the code cleaner and closer to constant time.

Basic benchmarking shows a performance gain on modern 64 bit architectures,
while there is a decrease on legacy 32 bit architectures (i386),
particularly for the zero bit shift case (which is now handled in the
same code path).

ok tb@

22 months agoAdd additional shift benchmarks that are useful on BN_BITS2 == 32 platforms
jsing [Thu, 5 Jan 2023 04:44:20 +0000 (04:44 +0000)]
Add additional shift benchmarks that are useful on BN_BITS2 == 32 platforms

22 months agoMake free_chunks() return 'const struct chunk *' since we don't
krw [Thu, 5 Jan 2023 00:19:53 +0000 (00:19 +0000)]
Make free_chunks() return 'const struct chunk *' since we don't
modify chunks outside of free_chunks(). Adjust local variables taking
the return value as needed.

No intentional functional change.

22 months agoDelete remnants of removed "diff -l" option.
millert [Thu, 5 Jan 2023 00:00:44 +0000 (00:00 +0000)]
Delete remnants of removed "diff -l" option.
From Nathan Houghton

22 months agoCopy bytes from the_banana[] rather than banana()
tb [Wed, 4 Jan 2023 22:48:57 +0000 (22:48 +0000)]
Copy bytes from the_banana[] rather than banana()

Fixes test failure due to segfault seen on arm64 with xonly snap.

ok djm

22 months agoThe access type for an instruction storage interrupt should not
kettenis [Wed, 4 Jan 2023 22:13:43 +0000 (22:13 +0000)]
The access type for an instruction storage interrupt should not
include PROT_READ, otherwise faults on executable pages mapped only as
PORT_EXEC will not work.

ok deraadt@

22 months agoUse 'const struct disklabel *' parameters where the disklabel is
krw [Wed, 4 Jan 2023 21:08:08 +0000 (21:08 +0000)]
Use 'const struct disklabel *' parameters where the disklabel is
not altered. And 'const struct partition *' for pointers into
newly const disklabels.

No intentional functional change.

22 months agominor text shuffle, for clarity; ok millert
jmc [Wed, 4 Jan 2023 19:12:34 +0000 (19:12 +0000)]
minor text shuffle, for clarity; ok millert

22 months agoEliminate two unnecessary 'i' loop variables by incrementing
krw [Wed, 4 Jan 2023 18:41:25 +0000 (18:41 +0000)]
Eliminate two unnecessary 'i' loop variables by incrementing
the pointer instead.

No intentional functional change.

22 months agoPrint RRDP serial + ID if nothing changed
job [Wed, 4 Jan 2023 16:51:34 +0000 (16:51 +0000)]
Print RRDP serial + ID if nothing changed

OK tb@

22 months agoImplement strscpy() and implement strscpy_pad() on top of that. Fixes the
kettenis [Wed, 4 Jan 2023 15:48:00 +0000 (15:48 +0000)]
Implement strscpy() and implement strscpy_pad() on top of that.  Fixes the
return value in case of truncation.

ok jsg@

22 months agoReplace p_fstype to/from FS_UNUSED dances around invocations of
krw [Wed, 4 Jan 2023 15:18:46 +0000 (15:18 +0000)]
Replace p_fstype to/from FS_UNUSED dances around invocations of
free_chunks() with a parameter that names the partition to treat
as FS_UNUSED when building the list of free space chunks. With -1
indicating that no partition should be ignored.

Simplifies code and enables further simplifications and a raft
of const'ifications.

No intentional functional change. Regress still happy.
SUN_CYLCHECK, SUN_AAT0 and D_VENDOR still happy.

22 months agoEduardo Horvath agreed to rescind clause 3 and 4 in
jsg [Wed, 4 Jan 2023 14:58:04 +0000 (14:58 +0000)]
Eduardo Horvath agreed to rescind clause 3 and 4 in
NetBSD fgen.1 rev 1.9 cpu_in_cksum.S rev 1.2

https://mail-index.netbsd.org/source-changes/2009/10/19/msg002130.html

22 months agoChristos Zoulas removed his name from advertising clauses and copyrights
jsg [Wed, 4 Jan 2023 14:42:46 +0000 (14:42 +0000)]
Christos Zoulas removed his name from advertising clauses and copyrights
of some files in NetBSD.  Make the same changes here.

https://mail-index.netbsd.org/source-changes/2017/06/03/msg084953.html
https://mail-index.netbsd.org/source-changes/2017/06/03/msg084955.html
https://mail-index.netbsd.org/source-changes/2019/12/02/msg111431.html
https://mail-index.netbsd.org/source-changes/2019/12/02/msg111432.html

22 months agoAdjust open policy integration test to the change of config in bgpd.
claudio [Wed, 4 Jan 2023 14:34:50 +0000 (14:34 +0000)]
Adjust open policy integration test to the change of config in bgpd.

22 months agoAdd a per eBGP session role to the config.
claudio [Wed, 4 Jan 2023 14:33:30 +0000 (14:33 +0000)]
Add a per eBGP session role to the config.

This somewhat replaces the RFC 9234 open policy role. This is done because
ASPA requires the same role to be present to properly validate paths.
For iBGP sessions the role is forced to ROLE_NONE. If no role is set on
an ebgp session then 'announce policy' is forced to 'no'.
Also make sure the the role capability is only added if the role is set.
OK tb@

22 months agoThe redirectchain test actually works again. The test servr fixed the
claudio [Wed, 4 Jan 2023 14:27:00 +0000 (14:27 +0000)]
The redirectchain test actually works again. The test servr fixed the
redirect location to be https.

22 months agoWhen building this regress test I copied a bad UUID from some other
claudio [Wed, 4 Jan 2023 14:26:08 +0000 (14:26 +0000)]
When building this regress test I copied a bad UUID from some other
RRDP file and so a few files have bad unique ids, fix them up to be valid.

22 months agoValidate the session_id to be a real UUID.
claudio [Wed, 4 Jan 2023 14:22:43 +0000 (14:22 +0000)]
Validate the session_id to be a real UUID.

RFC 8182 requires the session_id to be a version 4 random UUID (using
variant 1). Now checking the version and variant is currently disabled
because there is at least one CA with a session_id that is all random
and therefor the version check triggers there.
Joint work with job@. OK job@, tb@

22 months agoremove unused version of ncr53cxxx.c
jsg [Wed, 4 Jan 2023 13:08:23 +0000 (13:08 +0000)]
remove unused version of ncr53cxxx.c
ok deraadt@ miod@

22 months agoexperiments for --execute-only on arm64 and riscv64 are going well,
deraadt [Wed, 4 Jan 2023 13:01:46 +0000 (13:01 +0000)]
experiments for --execute-only on arm64 and riscv64 are going well,
which will prompt making that the default.  That means efiboot, which
build in a different way, must disable the link option.
ok kettenis

22 months agoChristos Zoulas agreed to rescind clause 3 and 4 in
jsg [Wed, 4 Jan 2023 13:00:11 +0000 (13:00 +0000)]
Christos Zoulas agreed to rescind clause 3 and 4 in
NetBSD fsck.8 rev 1.35 fsutil.h rev 1.14 pathnames.h rev 1.2
netgroup_mkdb.8 rev 1.9 netgroup_mkdb.c rev 1.18 str.c rev 1.7
str.h rev 1.4 rdate.8 rev 1.11 rdate.c rev 1.19 extern.h rev 1.14
getnetgrent.c rev 1.41 netgroup.h rev 1.10
fparseln.3 rev 1.4 fparseln.c rev 1.10

our stringlist.c/stringlist.h are derived from getnetgrent.c
rfc868time.c from rdate.c
newfs/pathnames.h from fsck/pathnames.h

https://mail-index.netbsd.org/source-changes/2009/10/21/msg002182.html
Not all files are covered as some had copyright assigned to TNF in 1998.

22 months agougly white space
deraadt [Wed, 4 Jan 2023 12:53:38 +0000 (12:53 +0000)]
ugly white space

22 months agoLeo Weppelman agreed to rescind clause 3 and 4 in
jsg [Wed, 4 Jan 2023 10:59:34 +0000 (10:59 +0000)]
Leo Weppelman agreed to rescind clause 3 and 4 in
NetBSD kvm_dump.3 rev 1.15 kcore.h rev 1.3

https://mail-index.netbsd.org/source-changes/2009/10/20/msg002169.html

22 months agomove the pf_state_tree_id type from pfvar.h to pfvar_priv.h.
dlg [Wed, 4 Jan 2023 10:31:55 +0000 (10:31 +0000)]
move the pf_state_tree_id type from pfvar.h to pfvar_priv.h.

the pf_state_tree_id type is private to the kernel.

while here, move it from being an RB tree to an RBT tree. this saves
about 12k in pf.o on amd64.

ok sashan@

22 months agoMichael L. Hitch agreed to rescind clause 3 and 4 in
jsg [Wed, 4 Jan 2023 10:05:44 +0000 (10:05 +0000)]
Michael L. Hitch agreed to rescind clause 3 and 4 in
NetBSD ncr53cxxx.c rev 1.16 osiop.ss rev 1.2

https://mail-index.netbsd.org/source-changes/2009/10/21/msg002215.html

22 months agoGordon W. Ross and Bill Studenmund agreed to rescind clause 3 and 4 in
jsg [Wed, 4 Jan 2023 09:34:26 +0000 (09:34 +0000)]
Gordon W. Ross and Bill Studenmund agreed to rescind clause 3 and 4 in
NetBSD zs.c rev 1.49

https://mail-index.netbsd.org/source-changes/2009/10/27/msg002419.html

22 months agoGordon W. Ross agreed to rescind clause 3 and 4 in
jsg [Wed, 4 Jan 2023 09:24:14 +0000 (09:24 +0000)]
Gordon W. Ross agreed to rescind clause 3 and 4 in
NetBSD dev_net.c rev 1.15 bootparam.c rev 1.19

https://mail-index.netbsd.org/source-changes/2009/10/21/msg002212.html

22 months ago- use Fl instead of Ar for print0; from josiah frentsos
jmc [Wed, 4 Jan 2023 07:33:00 +0000 (07:33 +0000)]
- use Fl instead of Ar for print0; from josiah frentsos
- while here, describe it as a primary rather than an option

22 months agoIchiro FUKUHARA agreed to rescind clause 3 and 4 in
jsg [Wed, 4 Jan 2023 07:06:08 +0000 (07:06 +0000)]
Ichiro FUKUHARA agreed to rescind clause 3 and 4 in
NetBSD if_ath_cardbus.c rev 1.36

https://mail-index.netbsd.org/source-changes/2009/10/21/msg002189.html

22 months agoChuck Cranor rescinded the advertising clause of uvm_mmap.c in
jsg [Wed, 4 Jan 2023 06:33:33 +0000 (06:33 +0000)]
Chuck Cranor rescinded the advertising clause of uvm_mmap.c in
NetBSD rev 1.134 and confirmed with Mike Hibler that the University of
Utah would do the same.

https://mail-index.netbsd.org/source-changes/2011/02/02/msg018021.html

ok deraadt@

22 months agofix a comment, no functional change.
dlg [Wed, 4 Jan 2023 03:47:10 +0000 (03:47 +0000)]
fix a comment, no functional change.

22 months agoTypos in vmd error message. No functional change.
dv [Wed, 4 Jan 2023 02:19:19 +0000 (02:19 +0000)]
Typos in vmd error message. No functional change.

22 months agomove the pf_state_tree rb tree type from pfvar.h to pfvar_priv.h
dlg [Wed, 4 Jan 2023 02:00:49 +0000 (02:00 +0000)]
move the pf_state_tree rb tree type from pfvar.h to pfvar_priv.h

the pf_state_tree types are kernel private, and are not used by
userland. make build agrees with me.

while here, move the pf_state_tree from the RB macros to the RBT
functions. this shaves about 13k off pf.o on amd64.

ok sashan@

22 months agoShuffle code a bit to eliminate need for inner loop
krw [Wed, 4 Jan 2023 01:22:48 +0000 (01:22 +0000)]
Shuffle code a bit to eliminate need for inner loop
variable 'j' in editor_allocspace().

No intentional functional change. Regress still happy.

22 months agoon sh/landisk, ELF binaries are currently unpadded between text and rodata.
deraadt [Wed, 4 Jan 2023 00:18:50 +0000 (00:18 +0000)]
on sh/landisk, ELF binaries are currently unpadded between text and rodata.
Comment says because no nx support.  Well, we'll soon be able to something
like nx, and need the rodata to not be mingled into the same pages as
executable, so enforce padding.
with kettenis, ok miod

22 months agoNo need to call editor_countfree() when displaying all the free
krw [Tue, 3 Jan 2023 23:27:03 +0000 (23:27 +0000)]
No need to call editor_countfree() when displaying all the free
chunks in the 'r' editor command. Just add up chunks as they are
displayed. Eliminates pointless second invocation of
free_chunks().

Increment the chunk pointer rather than using iteration
variable + indexing.

No intentional functional change.

22 months agodo not mention dhclient as a dhcp route message sender
deraadt [Tue, 3 Jan 2023 20:58:05 +0000 (20:58 +0000)]
do not mention dhclient as a dhcp route message sender

22 months agoPrint the RRDP Session ID and Serial in verbose mode
job [Tue, 3 Jan 2023 18:19:12 +0000 (18:19 +0000)]
Print the RRDP Session ID and Serial in verbose mode

OK tb@ claudio@

22 months agoPoll battery sensors less frequently.
anton [Tue, 3 Jan 2023 15:52:02 +0000 (15:52 +0000)]
Poll battery sensors less frequently.

22 months agoThe software id in the request must be copied as is to the response by the
anton [Tue, 3 Jan 2023 15:51:40 +0000 (15:51 +0000)]
The software id in the request must be copied as is to the response by the
hardware. Leverage the fact that the same id can be anything within [1, 15] by
using a different id per request in a round robin fashion. Makes it easier to
correlate requests and responses while making sense of the debug output.

22 months agoGroup more request and response constants.
anton [Tue, 3 Jan 2023 15:50:52 +0000 (15:50 +0000)]
Group more request and response constants.

22 months agoQuery the client terminal for foreground and background colours and if
nicm [Tue, 3 Jan 2023 11:43:24 +0000 (11:43 +0000)]
Query the client terminal for foreground and background colours and if
OSC 10 or 11 is received but no colour has been set inside tmux, return
the colour from the first attached client (probably most people will
have all light or or all dark terminals).

22 months agoDisable display backlight on Apple Silicon laptops when suspending.
tobhe [Tue, 3 Jan 2023 10:59:00 +0000 (10:59 +0000)]
Disable display backlight on Apple Silicon laptops when suspending.

ok kettenis@ patrick@

22 months agoAdd tfind_user(), for getting a proc* given a user-space TID and
guenther [Mon, 2 Jan 2023 23:09:48 +0000 (23:09 +0000)]
Add tfind_user(), for getting a proc* given a user-space TID and
the process* that it should be part of.  Use that in clock_get{time,res}(),
thrkill(), and ptrace().

ok jca@ miod@ mpi@ mvs@

22 months agoThe access type for an instruction storage/segment interrupt should not
kettenis [Mon, 2 Jan 2023 23:03:18 +0000 (23:03 +0000)]
The access type for an instruction storage/segment interrupt should not
include PROT_READ, otherwise faults on executable pages mapped only as
PORT_EXEC will not work.

"obviously correct" deraadt@

22 months agoLet the EFI bootloader make a copy of the EFI System Resource Table (ESRT)
kettenis [Mon, 2 Jan 2023 22:41:17 +0000 (22:41 +0000)]
Let the EFI bootloader make a copy of the EFI System Resource Table (ESRT)
and pass it to the kernel.

ok jca@, patrick@

22 months agoFix the check for the BWX extension introduced in 1.92.
miod [Mon, 2 Jan 2023 19:09:17 +0000 (19:09 +0000)]
Fix the check for the BWX extension introduced in 1.92.
This repairs operation on 21164 processors (not 21164A!) which lack BWX.

Reported by Mark Butt on alpha@

22 months agoregression test for PermitRemoteOpen
djm [Mon, 2 Jan 2023 07:03:57 +0000 (07:03 +0000)]
regression test for PermitRemoteOpen

22 months agofix bug in PermitRemoteOpen which caused it to ignore its first
djm [Mon, 2 Jan 2023 07:03:30 +0000 (07:03 +0000)]
fix bug in PermitRemoteOpen which caused it to ignore its first
argument unless it was one of the special keywords "any" or "none".

Reported by Georges Chaudy in bz3515; ok dtucker@

22 months agouse the pf generated toeplitz hash when setting the mbuf flow id.
dlg [Mon, 2 Jan 2023 05:32:40 +0000 (05:32 +0000)]
use the pf generated toeplitz hash when setting the mbuf flow id.

before this it would use the pf state id, which is just an increasing
number. the toeplitz hash is generated/used by the rest of the
stack, so this encourages consistent flow of traffic through the
system.

22 months agoClear status bits when we receive a host system error. Otherwise the
kettenis [Sun, 1 Jan 2023 21:45:40 +0000 (21:45 +0000)]
Clear status bits when we receive a host system error.  Otherwise the
interrupt keeps firing even if the hos controller has been declared dead.

ok mpi@

22 months agoWith the introduction of the PMAP_PREFER_{ALIGN,OFFSET} macros a long time ago,
miod [Sun, 1 Jan 2023 19:49:17 +0000 (19:49 +0000)]
With the introduction of the PMAP_PREFER_{ALIGN,OFFSET} macros a long time ago,
there are actually no more uses of the PMAP_PREFER() macro left in the kernel.
Remove that macro but keep PMAP_PREFER as a simple #define for it to let uvm
knows the PMAP_PREFER_{ALIGN,OFFSET} macros are available.

ok mpi@

22 months agoAdd explicit LL suffixes to large constants to appease some compilers on
miod [Sun, 1 Jan 2023 17:43:04 +0000 (17:43 +0000)]
Add explicit LL suffixes to large constants to appease some compilers on
32-bit systems.

22 months agoAdd explicit LL suffixes to large constants to appease some compilers on
miod [Sun, 1 Jan 2023 17:00:08 +0000 (17:00 +0000)]
Add explicit LL suffixes to large constants to appease some compilers on
32-bit systems.

22 months agoAdd explicit LL suffixes to large constants to appease some compilers on
miod [Sun, 1 Jan 2023 16:58:23 +0000 (16:58 +0000)]
Add explicit LL suffixes to large constants to appease some compilers on
32-bit platforms; NFCI

ok tb@

22 months agoRound up fractional percentages, as per POSIX.
millert [Sun, 1 Jan 2023 16:31:20 +0000 (16:31 +0000)]
Round up fractional percentages, as per POSIX.
From nabijaczleweli, OK deraadt@

22 months agoEnable power management for PCI devices.
kettenis [Sun, 1 Jan 2023 11:29:09 +0000 (11:29 +0000)]
Enable power management for PCI devices.

ok mlarkin@, deraadt@

22 months agocopyright++;
jsg [Sun, 1 Jan 2023 07:00:51 +0000 (07:00 +0000)]
copyright++;

22 months agoupdate drm to linux 6.1.2
jsg [Sun, 1 Jan 2023 01:34:33 +0000 (01:34 +0000)]
update drm to linux 6.1.2

new hardware support includes

AMD
Raphael, Ryzen 7000 desktop, gfx1036/GC 10.3.6
Mendocino, Ryzen & Athlon 7020 Series mobile APU, gfx1037/GC 10.3.7
Navi 31, gfx1100 dGPU, GC 11.0.0, Radeon RX 7900 XT/XTX
gfx1101 dGPU
gfx1102 dGPU
gfx1103 APU

Thanks to the OpenBSD Foundation for sponsoring this work.

22 months agotimeout.9: document new interfaces, miscellaneous rewrites and cleanup
cheloha [Sun, 1 Jan 2023 01:19:18 +0000 (01:19 +0000)]
timeout.9: document new interfaces, miscellaneous rewrites and cleanup

- Document timeout_abs_ts(9).
- Add the kclock arguments to timeout_set_flags(9) and
  TIMEOUT_INITIALIZER_FLAGS(9).
- Document KCLOCK_NONE and KCLOCK_UPTIME.
- Mention the static initialization macros alongside timeout_set(9) etc.;
  keep relevant information adjacent.
- Mention timeout_add_sec(9) etc. alongside timeout_add(9); keep
  relevant information adjacent.

... plus many other cleanups, rewrites, and rearrangements.

Prompted by mvs@ and many others.  With input from jmc@, mvs@, kn@,
schwarze@, and probably a few others I have forgotten.

v1: https://marc.info/?l=openbsd-tech&m=162449274513068&w=2
v2: https://marc.info/?l=openbsd-tech&m=165851505627764&w=2
v3: https://marc.info/?l=openbsd-tech&m=167250339811308&w=2

ok jmc@ mvs@ schwarze@

22 months agoDocument that -P disables BLOCKSIZE support.
millert [Sat, 31 Dec 2022 21:47:53 +0000 (21:47 +0000)]
Document that -P disables BLOCKSIZE support.
With input from and OK jmc@

22 months agotimeout: rename "timeout_at_ts" to "timeout_abs_ts"
cheloha [Sat, 31 Dec 2022 16:06:24 +0000 (16:06 +0000)]
timeout: rename "timeout_at_ts" to "timeout_abs_ts"

I think "abs" ("absolute timeout") is a better mnemonic than
"at" ("at the given time").

The interface is undocumented and there are only two callers, so
renaming it is not a big deal.

probably ok kn@

22 months agosync
jsg [Sat, 31 Dec 2022 09:31:39 +0000 (09:31 +0000)]
sync

22 months agoLook for the first 2 mem regions, ignore the rest
gkoehler [Sat, 31 Dec 2022 05:06:18 +0000 (05:06 +0000)]
Look for the first 2 mem regions, ignore the rest

Some macppc nvidia graphics cards have a 3rd mem region, but nv(4)
wants to mmap the 1st and 2nd regions.

ok miod@

22 months agocrank libfido2 major version, it depends on libcbor and it just
djm [Sat, 31 Dec 2022 03:36:12 +0000 (03:36 +0000)]
crank libfido2 major version, it depends on libcbor and it just
cranked. ok tb@

22 months agoupdate to upstream libcbor v.0.10.0 and crank major. Also includes
djm [Sat, 31 Dec 2022 03:35:21 +0000 (03:35 +0000)]
update to upstream libcbor v.0.10.0 and crank major. Also includes
e308674c5d to fix PR259. This release includes a number of memory
leak fixes.

Disable the upsteam custom allocators feature.

Feedback/ok tb@

Thanks also to Pedro Martelletto for pointing out the new release as
well as PR259.

22 months agoLet luna88k's bootloader pass RB_GOODRANDOM to the kernel.
aoyama [Sat, 31 Dec 2022 02:42:01 +0000 (02:42 +0000)]
Let luna88k's bootloader pass RB_GOODRANDOM to the kernel.

Current bootloader can pass boothowto information to the kernel.  It
also has the capability to load random seed data from /etc/random.seed
already.  So set RB_GOODRANDOM at the bootloader when loadrandom() has
been finished successfully.

Now the kernel says "random: good seed from bootblocks".

Tested by LUNA-88K2 and nono emulator, "Absolutely!" ok miod@

22 months agosysctl_clockintr: clear "sum" with memset before copyout(9)
cheloha [Sat, 31 Dec 2022 00:48:53 +0000 (00:48 +0000)]
sysctl_clockintr: clear "sum" with memset before copyout(9)

22 months agoAdd machdep.lidaction to machdep names list.
patrick [Sat, 31 Dec 2022 00:30:21 +0000 (00:30 +0000)]
Add machdep.lidaction to machdep names list.

ok mpi@

22 months agoAdd TABDLY, TAB0, TAB3 for better source compatibility.
millert [Fri, 30 Dec 2022 23:41:45 +0000 (23:41 +0000)]
Add TABDLY, TAB0, TAB3 for better source compatibility.
These are XSI extensions but some code seems to expect them.
We don't currently implement TAB1 or TAB2.  Idea from FreeBSD.
OK guenther@ gnezdo@

22 months agoadd history for getpid(2) and getppid(2)
jsg [Fri, 30 Dec 2022 23:12:12 +0000 (23:12 +0000)]
add history for getpid(2) and getppid(2)

getpid() appeared (undocumented) in v5.  Between v6 and v7 there is an
extra return value for the parent process ID.

getppid() did not appear in v7, it appeared in 32v libc.  But getppid()
predates 32v.  It seems to have been in earlier USG releases such as
Generic 3 (PG-1C300 Issue 3) as the MERT Release 0 manual references it.

getppid() didn't become a system call until 4.3BSD-Reno

omit most of these details and just mention v5 and 32v

with and ok schwarze@

22 months agopause.3: miscellaneous rewrites, cleanup
cheloha [Fri, 30 Dec 2022 21:21:25 +0000 (21:21 +0000)]
pause.3: miscellaneous rewrites, cleanup

Eliminate some redundant or extraneous pieces from the pause.3 page.
Say the "thread" "blocks", don't say the "process" "pauses".  No need
to enumerate the ways a signal can be delivered.  Add a few relevant
cross-references.

With input from millert@ and schwarze@.

Link: https://marc.info/?l=openbsd-tech&m=166801212316670&w=2
ok millert@ schwarze@

22 months agoaccton.c: add missing $OpenBSD$ tag
cheloha [Fri, 30 Dec 2022 18:47:45 +0000 (18:47 +0000)]
accton.c: add missing $OpenBSD$ tag

22 months agoDo not send (normal) packets before we reach the run state. Logic copied
kettenis [Fri, 30 Dec 2022 16:49:34 +0000 (16:49 +0000)]
Do not send (normal) packets before we reach the run state.  Logic copied
from iwm(4), which also looks at the TX_MGMT_ONLY flag.  We don't expect
that flag to be ever set for bwfm(4), but it shouldn't hurt and it keeps
things consistent across drivers.

This fixes issues with suspend/resume (including firmware crashes seen on
the M2 Macbook Air).

ok patrick@, stsp@

22 months agoAdd chip name for new revision of the BCM4378.
kettenis [Fri, 30 Dec 2022 14:10:17 +0000 (14:10 +0000)]
Add chip name for new revision of the BCM4378.

ok patrick@

22 months agoActually hide the clang-15 workaround behind the COMPILER_VERSION check
jca [Fri, 30 Dec 2022 06:50:27 +0000 (06:50 +0000)]
Actually hide the clang-15 workaround behind the COMPILER_VERSION check

COMPILER_VERSION initially missed.  I'm not sure why we still have those
COMPILER_VERSION checks in sys/arch/i386 and sys/arch/amd64, when the
base system doesn't ship gcc any more, but let's stay consistent.

22 months agoNeuter zlib fatal warnings when building kernels and bootloaders with clang 15
jca [Fri, 30 Dec 2022 06:44:35 +0000 (06:44 +0000)]
Neuter zlib fatal warnings when building kernels and bootloaders with clang 15

Disable -Wdeprecated-non-prototype instead of patching zlib.  Upstream
plans to drop the pre-ANSI syntax soon.  ok tb@ millert@

22 months agoSupport FTDI FT232R. The upper 2 bits encode the fractional component of the
kevlo [Fri, 30 Dec 2022 00:54:09 +0000 (00:54 +0000)]
Support FTDI FT232R.  The upper 2 bits encode the fractional component of the
FT232R is either 0 or 0.125.

ok dlg@

22 months agosparc64: pull retry logic out of tickcmpr_set(), sys_tickcmpr_set()
cheloha [Thu, 29 Dec 2022 22:44:23 +0000 (22:44 +0000)]
sparc64: pull retry logic out of tickcmpr_set(), sys_tickcmpr_set()

Pull the retry logic out of tickcmpr_set() and sys_tickcmpr_set() into
C functions tick_rearm() and sys_tick_rearm(), respectively.  There is
nothing wrong with the retry logic in these assembly functions, but
it's better to keep equivalent code similar and this change realigns
the %TICK and %SYS_TICK rearm code with that of the Hummingbird
%STICK.

Tested by miod@ on UltraSPARC I, UltraSPARC II, and UltraSPARC IIe.

Link: https://marc.info/?l=openbsd-tech&m=167175014315419&w=2
ok kettenis@

22 months agoHISTORY: clarify that unmount(2) used to be called umount(2) from v1 to Tahoe;
schwarze [Thu, 29 Dec 2022 14:56:48 +0000 (14:56 +0000)]
HISTORY: clarify that unmount(2) used to be called umount(2) from v1 to Tahoe;
joint work with and OK jsg@

22 months agoAvoid doing cache flush/invalidate operations for DMA memory allocated with
kettenis [Thu, 29 Dec 2022 11:35:01 +0000 (11:35 +0000)]
Avoid doing cache flush/invalidate operations for DMA memory allocated with
the BUS_DMA_COHERENT flag.

ok miod@

22 months agoUse an iorw fence since we're syncing cpu access and device access to
kettenis [Thu, 29 Dec 2022 11:30:58 +0000 (11:30 +0000)]
Use an iorw fence since we're syncing cpu access and device access to
memory.

ok miod@

22 months agocapital letter at sentence start;
jmc [Thu, 29 Dec 2022 06:49:34 +0000 (06:49 +0000)]
capital letter at sentence start;

22 months agoFORK_SIGHAND and the handling of func==NULL disappeared in 2017 in
guenther [Thu, 29 Dec 2022 06:10:54 +0000 (06:10 +0000)]
FORK_SIGHAND and the handling of func==NULL disappeared in 2017 in
sys/kern/kern_fork.c rev 1.195.

22 months agoprofil(2) first appeared in fifth edition
jsg [Thu, 29 Dec 2022 05:00:12 +0000 (05:00 +0000)]
profil(2) first appeared in fifth edition

tuhs/Distributions/Research/Dennis_v4/v4man.tar.gz has
manx/profil.2 but no man2/profil.2

the nsys sysent.c has '&nullsys, /* 44 = prof */'
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/nsys/ken/sysent.c

profil(2) is first listed as v5 in the Combined Tables of Contents from
McIlroy's A Research UNIX Reader.
https://marc.info/?l=tuhs&m=158099986005023&w=2
and is present in
tuhs/Distributions/Research/Dennis_v5/v5man.pdf

ok schwarze@

22 months agofcntl(2) first appeared in System III
jsg [Thu, 29 Dec 2022 02:12:41 +0000 (02:12 +0000)]
fcntl(2) first appeared in System III
ok schwarze@

22 months agoAdd ktrace struct tracepoints for siginfo_t to the kernel side of
guenther [Thu, 29 Dec 2022 01:36:36 +0000 (01:36 +0000)]
Add ktrace struct tracepoints for siginfo_t to the kernel side of
waitid(2) and __thrsigdivert(2) and teach kdump(1) to handle them.
Also report more from the siginfo_t inside PSIG tracepoints.

ok mpi@

22 months ago{en,de}queing -> {en,de}queuing; from paul tagliamonte
jmc [Wed, 28 Dec 2022 21:38:29 +0000 (21:38 +0000)]
{en,de}queing -> {en,de}queuing; from paul tagliamonte

22 months agospelling fixes; from paul tagliamonte
jmc [Wed, 28 Dec 2022 21:30:15 +0000 (21:30 +0000)]
spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech

22 months agoiostat(8): implement periodic display with setitimer(2)
cheloha [Wed, 28 Dec 2022 20:56:37 +0000 (20:56 +0000)]
iostat(8): implement periodic display with setitimer(2)

Prefer setitimer(2)+sigsuspend(2) to nanosleep(2) when performing
periodic work.  The latter drifts.

Link: https://marc.info/?l=openbsd-tech&m=167068674625838&w=2
ok millert@