openbsd
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@

22 months agosystat(1): vmstat: dinfo(): compute rates using real elapsed time
cheloha [Wed, 28 Dec 2022 20:49:05 +0000 (20:49 +0000)]
systat(1): vmstat: dinfo(): compute rates using real elapsed time

The "naptime" value is not the real elapsed time.  But showkre() has
the real elapsed time, "etime", so pass that as argument to dinfo().

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

22 months agomicrotime.9: rewrite description, miscellaneous cleanup
cheloha [Wed, 28 Dec 2022 15:46:39 +0000 (15:46 +0000)]
microtime.9: rewrite description, miscellaneous cleanup

- Remove the bintime interfaces.  They should not be used outside of
  the timecounting layer.  Unsure whether they warrant a manpage of
  their own.
- In the SYNOPSIS, change the variable names for timespec interfaces
  from "tv" to "ts".
- Document the new-ish "nsec" interfaces.
- Rewrite the DESCRIPTION.  Describe every clock completely in its own
  paragraph.  Enumerate all the interfaces in tables.  Explicitly state
  the output format for each interface in said tables.  Add new vocab
  ("hardware", "timestamp") to clarify the differences between the
  "get" and non-"get" interfaces.
- Add the CONTEXT, RETURN VALUES, and ERRORS sections.
- Cross-reference clock_settime(2), timeradd(3), and tc_init(9).

Lots of input from schwarze@.

ok jmc@ schwarze@

22 months agostyle(9) for includes
tb [Wed, 28 Dec 2022 13:21:11 +0000 (13:21 +0000)]
style(9) for includes

22 months agothe S in CSRC is Science not Sciences
jsg [Wed, 28 Dec 2022 13:00:57 +0000 (13:00 +0000)]
the S in CSRC is Science not Sciences

22 months agoThe RISC-V architecture support execute-only mappings, so implement those.
kettenis [Wed, 28 Dec 2022 12:56:35 +0000 (12:56 +0000)]
The RISC-V architecture support execute-only mappings, so implement those.

ok jca@

22 months agoProperly ignore comments in geofeed files
tb [Wed, 28 Dec 2022 12:16:35 +0000 (12:16 +0000)]
Properly ignore comments in geofeed files

Do not consider comments and whitespace leading up to a comment as part
of the line.

ok claudio job

22 months agoHandle clock that can't be gated as a no-op.
kettenis [Wed, 28 Dec 2022 11:20:09 +0000 (11:20 +0000)]
Handle clock that can't be gated as a no-op.

ok patrick@

22 months agoChange space character to TAB.
asou [Wed, 28 Dec 2022 10:11:36 +0000 (10:11 +0000)]
Change space character to TAB.

ok tb mlarkin giovanni

22 months agoMake wait_reorder_libs() honour library_aslr=NO
kn [Wed, 28 Dec 2022 09:53:33 +0000 (09:53 +0000)]
Make wait_reorder_libs() honour library_aslr=NO

Otherwise it will unconditionally print an empty line in case relinking
is disabled.

Reported by kettenis
Feedback OK tb
OK florian

22 months agosucccess -> success
jsg [Wed, 28 Dec 2022 07:59:13 +0000 (07:59 +0000)]
succcess -> success

22 months agoAnsify, fixes clang 15 -Wdeprecated-non-prototype (fatal with -Werror)
jca [Wed, 28 Dec 2022 07:40:23 +0000 (07:40 +0000)]
Ansify, fixes clang 15 -Wdeprecated-non-prototype (fatal with -Werror)

ok millert@

22 months agoFix the word in the copyright. IIJ is not a regent. ok from nakayama
yasuoka [Wed, 28 Dec 2022 01:39:21 +0000 (01:39 +0000)]
Fix the word in the copyright.  IIJ is not a regent.  ok from nakayama
at iij

found and ok miod

22 months agospelling fixes; from paul tagliamonte
jmc [Tue, 27 Dec 2022 23:05:55 +0000 (23:05 +0000)]
spelling fixes; from paul tagliamonte
ok nicm

22 months agoNewer device trees for boards based on the JH7100 SoC use a SoC-specific
kettenis [Tue, 27 Dec 2022 21:13:25 +0000 (21:13 +0000)]
Newer device trees for boards based on the JH7100 SoC use a SoC-specific
compatible string.  Still preliminary since JH7100 support hasn't made it
into mainline Linux yet.

ok patrick@

22 months agoFix array bounds mismatch with clang 15
patrick [Tue, 27 Dec 2022 20:13:03 +0000 (20:13 +0000)]
Fix array bounds mismatch with clang 15

New warning -Warray-parameter is a bit overzealous.
ok millert@ tb@

22 months agoChange the way malloc_init() works so that the main data structures
otto [Tue, 27 Dec 2022 17:31:09 +0000 (17:31 +0000)]
Change the way malloc_init() works so that the main data structures
can be made immutable to provide extra protection.  Also init pools
on-demand: only pools that are actually used are initialized.

Tested by many

22 months agoRevert spelling fixes. Please report them upstream.
tb [Tue, 27 Dec 2022 17:13:04 +0000 (17:13 +0000)]
Revert spelling fixes. Please report them upstream.

22 months agospelling fixes; from paul tagliamonte
jmc [Tue, 27 Dec 2022 17:10:05 +0000 (17:10 +0000)]
spelling fixes; from paul tagliamonte
any changes not taken noted on tech, but chiefly here i did not take the
cancelation - cancellation changes;

22 months agoAdjust handling of the RFC 9234 role capability for ibgp sessions:
claudio [Tue, 27 Dec 2022 17:05:38 +0000 (17:05 +0000)]
Adjust handling of the RFC 9234 role capability for ibgp sessions:
 - Exclude the role capability on ibgp sessions when sending an OPEN
 - Warn when a role capability is received on an iBGP session
 - Make sure the capability negotiation is skipped for ibgp sessions,
   this in turn disables the role capability on the session.
OK tb@

22 months agoOnly print the hello_timer if it is actually running.
claudio [Tue, 27 Dec 2022 12:11:39 +0000 (12:11 +0000)]
Only print the hello_timer if it is actually running.
Problem reported by Wouter Prins. Initial diff by kn@
OK remi@

22 months agospelling fixes; from paul tagliamonte
jmc [Tue, 27 Dec 2022 07:44:56 +0000 (07:44 +0000)]
spelling fixes; from paul tagliamonte

22 months agoAnsify pxe_netif_close() and {,pxe}socktodesc()
jca [Tue, 27 Dec 2022 07:34:05 +0000 (07:34 +0000)]
Ansify pxe_netif_close() and {,pxe}socktodesc()

To appease the clang 15 warning -Wdeprecated-non-prototype (turned on
by -Wall).  ok millert@

22 months agoFix array bounds mismatch with clang 15
jca [Tue, 27 Dec 2022 07:30:10 +0000 (07:30 +0000)]
Fix array bounds mismatch with clang 15

New warning -Warray-parameter is a bit overzealous.
ok millert@

22 months agogdb: fix build with clang 15
jca [Tue, 27 Dec 2022 02:22:46 +0000 (02:22 +0000)]
gdb: fix build with clang 15

The code wants a pointer to a "CORE_ADDR", thus the "(CORE_ADDR)" cast
is erroneous.  Just pass NULL.

ok jsg@

22 months agoperl: avoid -Wdeclaration-after-statement warning in our local patch
jca [Tue, 27 Dec 2022 02:02:44 +0000 (02:02 +0000)]
perl: avoid -Wdeclaration-after-statement warning in our local patch

Fixes build with clang 15.  Input + "seems ok" from afresh1@

22 months agovmd(8): provide a detailed e820 memory map.
dv [Mon, 26 Dec 2022 23:50:20 +0000 (23:50 +0000)]
vmd(8): provide a detailed e820 memory map.

When booting guests with SeaBIOS, vmd(8) supplied details about the
available guest memory via CMOS registers. Consequently, we've been
carrying some patches in the ports tree to SeaBIOS to fetch this
information like it's the 1990s.

When a vm initializes memory ranges, we now track what each range
represents. This information can be used to supply the e820 memory
map to SeaBIOS via the fw_cfg interface allowing it to properly
communicate memory ranges to a guest operating system. (This will
also allow us to drop some patches from the port.)

Given the ranges can now be marked with a purpose, this also allows
vmm(4) to switch from hard-coded mmio ranges and instead let the
information on the memory range dictate if vmm should be handling
a page fault or sending to vmd for a memory assist.

Tested by Mischa Peters and others. OK mlarkin@.

22 months agotweak the -f text; ok florian
jmc [Mon, 26 Dec 2022 21:04:10 +0000 (21:04 +0000)]
tweak the -f text; ok florian

22 months agoadd newline missed in previous
kn [Mon, 26 Dec 2022 20:24:43 +0000 (20:24 +0000)]
add newline missed in previous

22 months agospelling fixes; from paul tagliamonte
jmc [Mon, 26 Dec 2022 20:06:43 +0000 (20:06 +0000)]
spelling fixes; from paul tagliamonte

22 months agospelling fix; from paul tagliamonte
jmc [Mon, 26 Dec 2022 19:34:12 +0000 (19:34 +0000)]
spelling fix; from paul tagliamonte
ok millert

22 months agospelling fix; from paul tagliamonte
jmc [Mon, 26 Dec 2022 19:32:30 +0000 (19:32 +0000)]
spelling fix; from paul tagliamonte
ok tb

22 months agoReplace two (void)copystr(..., NULL) with equivalent (void)strlcpy() calls.
miod [Mon, 26 Dec 2022 19:25:49 +0000 (19:25 +0000)]
Replace two (void)copystr(..., NULL) with equivalent (void)strlcpy() calls.

ok millert@

22 months agospelling fixes; from paul tagliamonte
jmc [Mon, 26 Dec 2022 19:24:11 +0000 (19:24 +0000)]
spelling fixes; from paul tagliamonte
ok florian

22 months agosend_adb_cuda() would assume the returned value of splhigh() is the macintr
miod [Mon, 26 Dec 2022 19:17:00 +0000 (19:17 +0000)]
send_adb_cuda() would assume the returned value of splhigh() is the macintr
interrupt enable register; this used to be true more than 20 years ago but
the interrupt code has changed a lot since, and it is nevertheless bad
practice from md drivers to know to much about spl*() return values.

The check should become a "spl >= IPL_TTY", but management of the
adb_polling variable is good enough to need this at all.

22 months agospelling fixes; from paul tagliamonte
jmc [Mon, 26 Dec 2022 19:16:00 +0000 (19:16 +0000)]
spelling fixes; from paul tagliamonte
amendments to his diff are noted on tech

22 months agoUpdate adb_polling in akbd_cnpollc rather than akbd_cngetc; repairs ddb
miod [Mon, 26 Dec 2022 19:14:18 +0000 (19:14 +0000)]
Update adb_polling in akbd_cnpollc rather than akbd_cngetc; repairs ddb
input on adb machines.

22 months agoRe-order libraries in parallel to netstart.
florian [Mon, 26 Dec 2022 18:57:50 +0000 (18:57 +0000)]
Re-order libraries in parallel to netstart.

While netstart is busy setting up the network and waiting for a
default route we can already start with reordering libraries since
this does not depend on running network, speeding things up.

Idea & input deraadt
Input & OK kn

22 months agoImplement support for personal units library.
florian [Mon, 26 Dec 2022 18:52:10 +0000 (18:52 +0000)]
Implement support for personal units library.

With -f one could read an alternative library but it would replace the
standard units library, not add to it. Allow passing -f multiple times
to read all files and merge them together. Passing the empty string,
i.e. -f '' reads the default units library.

This is implemented in at least FreeBSD and Linux.

OK miod

22 months agospelling fixes from paul tagliamonte;
jmc [Mon, 26 Dec 2022 18:51:18 +0000 (18:51 +0000)]
spelling fixes from paul tagliamonte;
part of a larger diff: i'm committing this separately
as i changed statuses to status;

22 months agorevert previous: just as i get to replying, i find sthen's note. this part
jmc [Mon, 26 Dec 2022 18:43:49 +0000 (18:43 +0000)]
revert previous: just as i get to replying, i find sthen's note. this part
of the diff is not for me.

22 months agoemited -> emitted;
jmc [Mon, 26 Dec 2022 18:41:05 +0000 (18:41 +0000)]
emited -> emitted;
from paul tagliamonte

22 months agoreformat some multiline markup, which had been causing an unwanted
jmc [Mon, 26 Dec 2022 17:45:27 +0000 (17:45 +0000)]
reformat some multiline markup, which had been causing an unwanted
space (specifically in the "alias", "readonly" and "typeset"
commands);

from josiah frentsos

22 months agoPrepare to provide X509_CRL_get0_sigalg()
tb [Mon, 26 Dec 2022 16:00:36 +0000 (16:00 +0000)]
Prepare to provide X509_CRL_get0_sigalg()

This is an obvious omission from the OpenSSL 1.1 and OpenSSL 3 API which
does not provide a way to access the tbs sigalg of a CRL. This is needed
in security/pivy.

From Alex Wilson
ok jsing

22 months agofix another typo in comment in a line touched by the last commit (this
sthen [Mon, 26 Dec 2022 10:54:47 +0000 (10:54 +0000)]
fix another typo in comment in a line touched by the last commit (this
one wouldn't have triggered a spell checker though)

22 months agospelling fixes; from paul tagliamonte
jmc [Mon, 26 Dec 2022 07:31:44 +0000 (07:31 +0000)]
spelling fixes; from paul tagliamonte
ok tb

22 months agospelling fixes; from paul tagliamonte
jmc [Mon, 26 Dec 2022 07:18:50 +0000 (07:18 +0000)]
spelling fixes; from paul tagliamonte
i removed the arithmetics -> arithmetic changes, as i felt they
were not clearly correct

ok tb

22 months agoAdd close vmt.
asou [Mon, 26 Dec 2022 04:09:14 +0000 (04:09 +0000)]
Add close vmt.

22 months agoDocument ruby32 FLAVOR for Ruby ports
jeremy [Mon, 26 Dec 2022 03:09:04 +0000 (03:09 +0000)]
Document ruby32 FLAVOR for Ruby ports

22 months agoRe-enable DT_MIPS_RLD_MAP_REL tag in ld.so
visa [Sun, 25 Dec 2022 09:39:37 +0000 (09:39 +0000)]
Re-enable DT_MIPS_RLD_MAP_REL tag in ld.so

The linker now produces correct values for DT_MIPS_RLD_MAP_REL tags.

The DT_MIPS_RLD_MAP_REL offset is relative to the entry of the original
dynamic tags array. Therefore look up the tag from exe_obj->load_dyn
instead of exe_obj->Dyn.info to get the correct base address.

OK kettenis@ deraadt@

22 months agoHook up xhci(4)'s activate function to the FDT attachment driver. This
patrick [Sat, 24 Dec 2022 12:36:06 +0000 (12:36 +0000)]
Hook up xhci(4)'s activate function to the FDT attachment driver.  This
makes the USB ports work after a suspend/resume cycle on the x13s.

ok kettenis@

22 months agoMake .text (and .btext) execute-only on arm64.
kettenis [Sat, 24 Dec 2022 10:52:04 +0000 (10:52 +0000)]
Make .text (and .btext) execute-only on arm64.

ok deraadt@

22 months agoEnable pcagpio(4), and also consistently pcamux(4) while we're at it. With
patrick [Sat, 24 Dec 2022 10:51:27 +0000 (10:51 +0000)]
Enable pcagpio(4), and also consistently pcamux(4) while we're at it.  With
this the SFP port on the ClearFog Base (CN9130) starts to work, as the SFP
slot has some GPIOs routed through a GPIO extender.

ok dlg@ kettenis@

22 months agoBuild libc with executable-only .text on arm64.
kettenis [Sat, 24 Dec 2022 10:50:40 +0000 (10:50 +0000)]
Build libc with executable-only .text on arm64.

ok deraadt@

22 months agoDon't use a literal pool in .text to load the setjmp magic value as this is
kettenis [Sat, 24 Dec 2022 10:49:19 +0000 (10:49 +0000)]
Don't use a literal pool in .text to load the setjmp magic value as this is
incompatible with executable-only code.

ok deraadt@, guenther@

22 months agoUse the correct instruction to clear the frame pointer.
kettenis [Sat, 24 Dec 2022 10:47:22 +0000 (10:47 +0000)]
Use the correct instruction to clear the frame pointer.

ok guenther@, deraadt@

22 months agoZap trailing whitespace in license and add some empty lines
tb [Sat, 24 Dec 2022 07:12:09 +0000 (07:12 +0000)]
Zap trailing whitespace in license and add some empty lines

22 months agofix and enable toeplitz hashing of pf_state_keys again.
dlg [Sat, 24 Dec 2022 05:20:32 +0000 (05:20 +0000)]
fix and enable toeplitz hashing of pf_state_keys again.

the hash generated when setting up the pf pdesc struct uses outer
addresses, while the addresses used in the state table goes through
pf_state_key_addr_setup(), which does interesting things with some
ipv6 icmp values. state lookups used pf_state_key_addr_setup(), but
pf_state_key_setup copied the pdesc value, causing an inconsistency.
pf_state_key_setup now calls pf_state_key_addr_setup().

found by anton@
tested by anton@ florian@

22 months agosync
deraadt [Sat, 24 Dec 2022 03:39:13 +0000 (03:39 +0000)]
sync

22 months agoAdd the missing Copyright and license headers in the libcrypto/comp directory.
schwarze [Fri, 23 Dec 2022 23:23:02 +0000 (23:23 +0000)]
Add the missing Copyright and license headers in the libcrypto/comp directory.
Requested some time ago by tb@.

According to OpenSSL git history, the original version of this code
appeared in SSLeay 0.9.1b (July 6, 1998).  The LICENSE file in that
release states that the Copyright of SSLeay belongs to Eric Young,
and we believe that Eric still maintained SSLeay himself at that time.
We have seen a small number of examples where Eric credited outside
contributors for code that he included in his distribution, including
citing Copyright notices and license headers as appropriate.  We
found no such hints regarding this code, so it is reasonable to
assume that he wrote this code himself.

Regarding subsequent changes and additions, i inspected the OpenSSL
git repository.

No code change; only Copyright and license comments are added.

22 months agovmd(8): implement zero-copy operations on virtqueues.
dv [Fri, 23 Dec 2022 19:25:22 +0000 (19:25 +0000)]
vmd(8): implement zero-copy operations on virtqueues.

The original virtio device implementation relied on allocating a
buffer on heap, copying the virtqueue from the guest, mutating the
copy, and then overwriting the virtqueue in the guest.

While the approach worked, it was both complex and added extra
overhead. On older hardware, switching to the zero-copy approach
can show a noticeable performance improvement for vionet devices.
An added benefit is this diff also reduces the amount of code in
vmd, which is always a welcome change.

In addition, change to talking about the queue pfn and not "address"
as the virtio-pci spec has drivers provide a 32-bit value representing
the physical page number of the location in guest memory, not the
linear address.

Original idea from dlg@ while working on re-adding async task queues.

ok dlg@, tested by many

22 months agoDocument the deprecated wrappers BIO_set_app_data(3) and BIO_get_app_data(3).
schwarze [Fri, 23 Dec 2022 17:52:32 +0000 (17:52 +0000)]
Document the deprecated wrappers BIO_set_app_data(3) and BIO_get_app_data(3).
Some code roams the wild still calling them.

22 months agoAdd detection of EPAN feature bit.
kettenis [Fri, 23 Dec 2022 17:46:49 +0000 (17:46 +0000)]
Add detection of EPAN feature bit.

ok deraadt@

22 months agoAvoid using 1GB mappings for the identity map that we use in the early
kettenis [Fri, 23 Dec 2022 17:31:30 +0000 (17:31 +0000)]
Avoid using 1GB mappings for the identity map that we use in the early
kernel bootstrap phase and when booting the secondary CPUs.  This avoids
accidentally mapping memory regions that should not be mapped (i.e. secure
memory) as all mapped memory can be accessed speculatively.

To allow the kernel to be loaded at arbitrary physical addresses (and
arbitrary virtual addresses in the future) make sure the code that builds
the page tables can handle mapping a block of memory that straddles a
1GB or 512GB boundary.  This involves using two pagetable pages at all
levels except the top level and changing the link_l1_pagetable function
to accept an entry count just like link_l0_pagetable already does.

ok patrick@

22 months agoMark BIO_buffer_get_num_lines(3) as intentionally undocumented.
schwarze [Fri, 23 Dec 2022 17:27:53 +0000 (17:27 +0000)]
Mark BIO_buffer_get_num_lines(3) as intentionally undocumented.
Contrary to what bio.h says, it does not *not* retrieve some "IO type",
whatever that is supposed to be, but it is a NOOP, and nothing uses it.
Despite its name, it is unrelated to BIO_f_buffer(3), and please
be careful to not confuse it with BIO_get_buffer_num_lines(3).

22 months agoMark BIO_f_nbio_test(3) as intentionally undocumented.
schwarze [Fri, 23 Dec 2022 16:59:39 +0000 (16:59 +0000)]
Mark BIO_f_nbio_test(3) as intentionally undocumented.
It exposes absurd functionality, and according to codesearch.debian.net,
it is unused except in openssl(1) s_client/s_server -nbio_test.

22 months agonew manual page BIO_s_datagram(3);
schwarze [Fri, 23 Dec 2022 15:59:34 +0000 (15:59 +0000)]
new manual page BIO_s_datagram(3);
feedback and OK tb@

22 months agoPrevent an iwx(4) firmware error when authentication to the AP times out.
stsp [Fri, 23 Dec 2022 11:29:32 +0000 (11:29 +0000)]
Prevent an iwx(4) firmware error when authentication to the AP times out.

Stop session protection before tearing down firmware state after failure
to authenticate. Firmware will panic if we remove the MAC/PHY binding
while session protection is active.

test + ok kevlo@

22 months ago- hostname.if can handle lladdr as well as if names now
jmc [Fri, 23 Dec 2022 07:37:21 +0000 (07:37 +0000)]
- hostname.if can handle lladdr as well as if names now
- mention that they can be used for dynamic addressing
- lower the reading order of multicast routing (it makes sense to place
this at the end)
- Xr route(8) up front of the route text, not the end
- use Xr rather than Pa where possible
- reorder the forwarding text

22 months agoremove "-p protocol" from the -r synopsis: it no longer makes sense
jmc [Fri, 23 Dec 2022 07:18:46 +0000 (07:18 +0000)]
remove "-p protocol" from the -r synopsis: it no longer makes sense

pointed out by pguemther
ok pguenther kn claudio

22 months agopoint readers, where relevant, to route(8) rather than netstat(1) or route(4);
jmc [Fri, 23 Dec 2022 07:16:54 +0000 (07:16 +0000)]
point readers, where relevant, to route(8) rather than netstat(1) or route(4);
remove some redundant info regarding netstat -r from ipcomp/ipsec

feedback claudio sthen
ok claudio kn sthen

22 months agodisable the use of the has in the pf state key lookup (for now).
dlg [Fri, 23 Dec 2022 07:14:55 +0000 (07:14 +0000)]
disable the use of the has in the pf state key lookup (for now).

anton@ says the previous commit breaks ipv6 related regress tests.
disabling the use of the hash in the state key compare gets it going
again while i can figure out what's going on.

22 months agowrap a line better
deraadt [Fri, 23 Dec 2022 05:35:08 +0000 (05:35 +0000)]
wrap a line better