Age | Commit message (Collapse) | Author |
|
|
|
These ktrace points do not seem useful any longer because the new
implementation of poll(2) and select(2) appears to work well.
OK deraadt@ mpi@
|
|
OK millert@ deraadt@
|
|
|
|
initial patch from Andreas Bartelt
ok deraadt@
|
|
code is MP safe and moves from ip6_local() to ip6_ours(). If there
are any options, store the chain offset and next protocol in a mbuf
tag. When dequeuing without tag, it is a regular IPv6 header. As
mbuf tags degrade performance, use them only if a hop-by-hop header
is present. Such packets are rare and pf drops them by default.
OK mvs@
|
|
|
|
This function will help to avoid code duplication when tcp_usrreq() will
be divided to multiple handlers.
ok bluhm@
|
|
|
|
|
|
This is the arm64 adaptation of stsp's (commitid: p55cmsVoEH0fRg77)
"add support for booting from RAID 1C softraid(4) volumes on amd64".
Tell the boot loader to decrypt 1C like C volumes and check the number of
disks in 1C like in 1C volumes -- no new code rquired.
Tested on SolidRun CEX7
OK stsp
NB: While kernel and boot loader support root on softraid on arm64,
installboot(8) does not, i.e. default installations still require manual
disk preparation for now.
|
|
|
|
|
|
handlers into it. We want to split existing (*pr_usrreq)() to multiple
short handlers for each PRU_ request as it was already done for
PRU_ATTACH and PRU_DETACH. This is the preparation step, (*pr_usrreq)()
split will be done with the following diffs.
Based on reverted diff from guenther@.
ok bluhm@
|
|
This doesn't work on MP systems. We do locked `t_flags' check just after
lockless check, so just remove it.
ok dlg@
|
|
OpenBSD/i386 doesn't actually support running on 386sx or 386dx CPUs
so we don't need to test whether we're running on one of these CPUs
anymore.
The 486 (which was launched in 1989) added a few new features over
the 386:
- an alignment check flag in EFLAGS
- 3 new userland instructions: bswap / cmpxchg / xadd
- 3 new kernel mode instructions: invd / wbinvd / invlpg
- new bits in CR0 (386 CPUs did not support ring0 write protection)
- new bits in CR3
In this diff, we remove the code that checks for the alignment check
flag as we've only supported Pentium (or newer) CPUs for some time.
The rest of the diff is about updating comments related to pre-486
CPUs. 2 files under arch/amd64 are updated to keep them in sync
with the arch/i386 updates.
ok mlarkin@, jsg@; tweak from miod@
|
|
|
|
ok miod@ millert@
|
|
ok miod@
|
|
ok miod@
|
|
unused since msdosfs_vfsops.c 1.95
ok miod@ millert@
|
|
ok mglocker@ miod@
|
|
After net/if.c:rev 1.661 ifioctl() doesn't take the net lock any more
around SIOCGIFMEDIA and SIOCSIFMEDIA, which broke cad_ioctl().
The same was already true about SIOCGIFSFFPAGE. Only release/reacquire
the net lock if warranted.
Input mvs@, ok miod@ mvs@ bluhm@
|
|
The only caller of db_ctf_decompress() passes a size_t for the length.
This eliminates sign comparison warnings without using casts.
OK jca@ tb@
|
|
ok mpi@ miod@
|
|
This is helpful for the following (*pr_usrreq)() split to multiple
handlers. But right now this makes code more readable.
Also add '#ifndef _SYS_SOCKETVAR_H_' to sys/socketvar.h. This prevents the
collisions when both sys/protosw.h and sys/socketvar.h are included
together. Both 'socket' and 'protosw' structures are required to be
defined before pru_*() wrappers, so we need to include sys/socketvar.h to
sys/protosw.h.
ok bluhm@
|
|
OK claudio@
|
|
swblk_t on OpenBSD.
reorder if condition in blst_meta_alloc(), in order to check if the node is
'Terminator' node first (and leave the loop).
DragonFlyBSD is unaffected by it as swblk_t is signed (and the first condition
isn't taken).
add a regress test for it.
while here, more the KASSERT() to KDASSERT(). it is useful but only with DEBUG.
ok miod@ todd@
|
|
ok stsp@, jmatthew@
|
|
tested by and ok aoyama@
|
|
|
|
Only boot-loader changes are needed. Both installboot(8) and
the kernel already do what is required to make this work.
ok kn@
Tested:
biosboot on vmm: kn, stsp
biosboot and efiboot on server hardware: stsp
|
|
partitions.
miod@ (re)discovered an off-by-one in some device size
calculations. Whether the ancient misbehaviour of some devices to
confuse number of sectors with highest valid sector address or
something newer.
Should fix miod@'s octeon boot disk.
|
|
clang via jsg@, ok jsg@
|
|
do nearly the same thing, so they should look similar.
OK sashan@
|
|
OK mvs@ jca@
CID 1519492
|
|
ok bluhm@
|
|
Unlink pflow(4) interface from `pflowif_list' before start destruction to
prevent pflow_output_process() being rescheduled. Also wait until running
pflow_output_process() task finished.
Problem reported and fix tested by Hrvoje Popovski.
ok bluhm@
|
|
to out of memory. Use a generic idropped counter for those.
OK mvs@
|
|
Buffer cache related struct vnode fields can be accessed in interrupt
context. Be more consistent with the use of splbio().
OK mpi@
|
|
Recent xenocara wsfb driver can treat LUNA's framebuffer "offset", but it
requires one more page by mmap() when we use offset.
Noticed and tested on nono emulator with 1bpp setting.
|
|
The IPv6 routing header type 0 check should modify *offp only in
case of an error, so that the generated icmp6 packet has the correct
pointer.
OK sashan@
|
|
ok deraadt@ miod@
|
|
ok miod@
|
|
Computing a per-CPU TSC skew value is error-prone, especially on
multisocket machines and VMs. My best guess is that larger latencies
appear to the current skew measurement test as TSC desync, and so the
TSC is demoted to a kernel timecounter on these machines or marked
non-monotonic.
This patch eliminates per-CPU TSC skew values. Instead of trying to
measure and correct for TSC desync we only try to detect desync, which
is less error-prone. This approach should allow a wider variety of
machines to use the TSC as a timecounter when running OpenBSD.
In the new sync test, both CPUs repeatedly try to detect whether their
TSC is trailing the other CPU's TSC. The upside to this approach is
that it yields no false positives. The downside to this approach is
that it takes more time than the current skew measurement test. Each
test round takes 1ms, and we run up to two rounds per CPU, so this
patch slows boot down by 2ms per AP.
If any CPU fails the sync test, the TSC is marked non-monotonic and a
different timecounter is activated. The TC_USER flag remains intact.
There is no middle ground where we fall back to only using the TSC in
the kernel.
Before running the test, we check for the IA32_TSC_ADJUST register and
reset it if necessary. This is a trivial way to work around firmware
bugs that desync the TSC before we reach the kernel. Unfortunately,
at the moment this register appears to only be available on Intel
processors. I cannot find an equivalent but differently-named MSR for
AMD processors.
Because there is no per-CPU skew value, there is also no concept of
TSC drift anymore.
Miscellaneous notes:
- This patch adds a new timecounter utility function, tc_reset_quality().
Used after sync test failure to mark the TSC non-monotonic.
- I have left TSC_DEBUG enabled for now. Unsure if we should leave it
enabled for release or not. If we disable it we no longer run the
sync test after failing it once. Running the test even after failure
provides information about the desync on every CPU.
- Taking 1ms per test round is fairly conservative. We can experiment
with and discuss shorter test rounds. My main goal with a relatively
long test round is ensuring VMs actually run the test. It would be
bad if a hypervisor interrupted the test for so long that it concealed
desync.
- The use of two test rounds is mostly a diagnostic tool: it would be
very strange if a CPU passed the first round but failed the second.
If we ever saw this in the wild it would indicate something odd.
- Most of the desync seen in test reports is on Ryzen CPUs. I
believe, but cannot prove, that this is due to a widespread
firmware bug on AMD motherboards. Hopefully AMD and/or the
downstream vendors fix it.
- Fixing TSC desync by writing the TSC directly with WRMSR is very
difficult. The TSC is a moving target incrementing very quickly and
compensating for WRMSR overhead is non-trivial. We can experiment
with this, but my confidence is low that we can make it work reliably.
Prompted by deraadt@ and kettenis@ in 2021. Shepherded along by
deraadt@ throughout. Reprompted by Yuichiro Naito several times.
With input from Yuichiro Naito, naddy@, sthen@, dv@, and deraadt@.
Tested by florian@, gnezdo@, sthen@, Josh Rickmar, dv@, Mohamed Aslan,
Hrvoje Popovski, Yuichiro Naito, semarie@, mlarkin@, asou@, jmatthew@,
Renato Aguiar, and Timo Myyra.
Patch v1: https://marc.info/?l=openbsd-tech&m=164330092208035&w=2
Patch v2: https://marc.info/?l=openbsd-tech&m=164558519712957&w=2
Patch v3: https://marc.info/?l=openbsd-tech&m=165698681018991&w=2
Patch v4: https://marc.info/?l=openbsd-tech&m=165835507113680&w=2
Patch v5: https://marc.info/?l=openbsd-tech&m=165923705118770&w=2
"just commit it" deraadt@
|
|
a uint64_t may not produce the (humanly) obvious result.
Cast one of them to a (uint64_t) in the hope of invoking the
appropriate int promotion god.
CID 1519495
|
|
validity is checked.
Found the hard way by kn@
Cluebats from millert@ and deraadt@.
Fix tested by and ok kn@
|
|
In the future, the clock interrupt will need a working timecounter to
accurately reschedule itself.
Move tc_init(9) up before cpu_startclock().
kettenis@ notes several other platforms need this same change. Maybe
we can do the rest all at once.
Tested by kettenis@.
Link: https://marc.info/?l=openbsd-tech&m=165343754512382&w=2
ok kettenis@
|
|
as it is still not ready for runtime use and probably needs further quirks.
Discussed with deraadt@
|
|
|