| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
This avoids errors that can arise when multiple cores update the
variable at the same time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The timecounter struct is large and I think it may change in the
future. Changing it later will be easier if we use C99-style
initialization for all timecounter structs. It also makes reading the
code a bit easier.
For reasons I cannot explain, switching to C99-style initialization
sometimes changes the hash of the resulting object file, even though
the resulting struct should be the same. So there is a binary change
here, but only sometimes. No behavior should change in either case.
I can't compile-test this everywhere but I have been staring at the
diff for days now and I'm relatively confident this will not break
compilation. Fingers crossed.
ok gnezdo@
|
|
|
|
|
|
|
|
|
| |
On OpenBSD/mips64, the kernel is compiled with -mno-abicalls. This
disables gp-relative addressing and essentially makes gp a spare
register in the kernel. Hence it is unnecessary to initialize gp when
entering the kernel. The _gp symbol is not needed either.
Suggested by miod@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The global "tickadj" variable is a remnant of the old NTP adjustment
code we used in the kernel before the current timecounter subsystem
was imported from FreeBSD circa 2004 or 2005.
Fifteen years hence it is completely vestigial and we can remove it.
We probably should have removed it long ago but I guess it slipped
through the cracks. FreeBSD removed it in 2002:
https://cgit.freebsd.org/src/commit/?id=e1d970f1811e5e1e9c912c032acdcec6521b2a6d
NetBSD and DragonflyBSD can probably remove it, too.
We export tickadj via the kern.clockrate sysctl(2), so update sysctl.2
and sysctl(8) accordingly. Hypothetically this change could break
someone's sysctl(8) parsing script. I don't think that's very likely.
ok mvs@
|
|
|
|
|
| |
This moves the pmap closer to MP-safety. A similar change has already
been made on some other architectures.
|
|
|
|
|
|
|
| |
Simplify MD code and reduce the amount of recursion into the signal code
which helps when dealing with locks.
ok cheloha@, deraadt@
|
|
|
|
|
| |
minor refactorings to narrow KERNEL_LOCK just around uvm_fault()
ok kettenis
|
|
|
|
|
| |
need to do it
ok kettenis
|
|
|
|
|
|
| |
copyoutstr(9) should bail out properly if they are called with
a length of 0.
ok visa
|
|
|
|
| |
OK deraadt@
|
|
|
|
| |
OK deraadt@
|
|
|
|
| |
ok kettenis
|
|
|
|
| |
The header is being pulled via uvm_extern.h -> uvm_map.h
|
|
|
|
|
| |
because refreshcreds() may sleep in pool_put(). Subtle isn't it...
ok visa kettenis
|
|
|
|
|
|
|
|
| |
This should be sufficient for identifying pivoted ROP. Doing so for other
traps is at best opportunistic for finding a straight-running ROP chain,
but the added (and rare) sleeping point has proven to be dangerous.
Discussed at length with kettenis and mortimer.
ok mortimer kettenis mpi
|
|
|
|
| |
ok kettenis@, visa@
|
|
|
|
|
|
|
|
|
|
|
| |
system would deadlock when a CPU gets blocked by the mutex while another
CPU is waiting for the first CPU to finish a rendezvous request.
This possibly fixes some hangs on sgi. There should be no effect on
loongson and octeon because their interrupt code is sloppy with masking
of IPIs.
While here, rename the rendezvous mutex to better reflect its use.
|
|
|
|
| |
OK visa@
|
|
|
|
| |
OK naddy@; no objections from kettenis@
|
|
|
|
| |
OK deraadt@, visa@
|
|
|
|
|
|
|
|
|
|
|
| |
This makes the cycle counter usable as timecounter on multiprocessor
machines.
Idea from Linux.
Tested on CN5020, CN6120, CN7130 and CN7360.
Looks reasonable to kettenis@
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to
userland via libc eliberating processes from the need for a context
switch everytime they want to count the passage of time.
If a timecounter clock can be exposed to userland than it needs to set
its tc_user member to a non-zero value. Tested with one or multiple
counters per architecture.
The timing data is shared through a pointer found in the new ELF
auxiliary vector AUX_openbsd_timekeep containing timehands information
that is frequently updated by the kernel.
Timing differences between the last kernel update and the current time
are adjusted in userland by the tc_get_timecount() function inside the
MD usertc.c file.
This permits a much more responsive environment, quite visible in
browsers, office programs and gaming (apparently one is are able to fly
in Minecraft now).
Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others!
OK from at least kettenis@, cheloha@, naddy@, sthen@
|
|
|
|
|
|
|
|
| |
functionality is provided by <sys/stdarg.h> using compiler builtins.
Tested in a ports bulk build on amd64 by naddy@
OK naddy@ mpi@
|
| |
|
|
|
|
|
|
|
| |
Use CP0 Count as a basis. Also take noise from virtual memory activity
by including BadVAddr.
OK deraadt@ dlg@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rnd.c uses nanotime to get access to some bits that change quickly
between events that it can mix into the entropy pool. it doesn't
use nanotime to get a monotonically increasing set or ordered and
accurate timestamps, it just wants something with bits that change.
there's been discussions for years about letting rnd use a clock
that's super fast to read, but not necessarily accurate, but it
wasn't until recently that i figured out it wasn't interested in
time at all, so things like keeping a fast clock coherent between
cpu cores or correct according to ntp is unecessary. this means we
can just let rnd read the cycle counters on cpus and things will
be fine. cpus with cycle counters that vary in their speed and
arent kept consistent between cores may even be desirable in this
context.
so this is the first step in converting rnd.c to reading cycle
counter. it copies the nanotime backend to each arch, and they can
replace it with something MD as a second step later on.
djm@ suggested rnd_messybytes, but we landed on cpu_rnd_messybits.
thanks to visa for his eyes.
ok deraadt@ visa@
deraadt@ says he will help handle any MD fallout that occurs.
|
|
|
|
|
|
| |
conversion steps). it only contains kernel prototypes for 4 interfaces,
all of which legitimately belong in sys/systm.h, which are already included
by all enqueue_randomness() users.
|
|
|
|
|
|
| |
Nothing uses the header anymore.
OK deraadt@ mpi@
|
|
|
|
|
|
|
|
|
|
|
|
| |
This lets the kernel detect retguard traps and send SIGABRT instead
of SIGEMT.
SIGEMT does not indicate correctly the nature of the error (stack
overflow, violation of control flow). It can confuse the user to restart
the program without further investigation.
Prompted by and OK deraadt@
OK mortimer@
|
|
|
|
|
| |
ok deraadt@, mpi@, visa@
ok cheloha@ as well (would have preferred in new file for this code)
|
|
|
|
|
|
|
| |
This allows changing RTC drivers from <mips64/dev/clockvar.h>
to <dev/clock_subr.h> API.
OK kettenis@
|
|
|
|
|
|
|
| |
the file system such that implementations can use it to guess the right
century.
ok mpi@
|
|
|
|
|
|
|
|
| |
amd64/arm64/armv7/hppa/i386/macppc/sparc64 and move it to the end of
mips64_machdep.c. Wrap the existing tod_get and tod_set hooks into
something that can be used as a todr_handle.
ok visa@
|
|
|
|
|
|
|
|
| |
Upgrade stacktrace_save() to stacktrace_save_at() on architectures where
the latter is missing. Define stacktrace_save() as an inline function
in header <sys/stacktrace.h> to reduce duplication of code.
OK mpi@
|
|
|
|
|
|
|
|
|
|
| |
require the debugger on most architectures, and the separation makes the
code easier to use from other subsystems.
The function definitions are still conditional to DDB. However, that
should not matter for now.
OK deraadt@, mpi@
|
|
|
|
| |
OK miod@
|
|
|
|
| |
OK mpi@
|
|
|
|
|
|
| |
Rename variables for clarity while here.
OK mpi@
|
|
|
|
|
|
|
|
| |
a panic related to vararg function sppp_auth_send(). The vararg code
generated by clang assumes 16-byte stack alignment.
pppoe(4)-induced panic seen by many on octeon
Fix from miod@
|
| |
|
|
|
|
| |
ok dlg@, jasper@
|
|
|
|
| |
64-bit unsigned arithmetic.
|
|
|
|
|
| |
saving work with the twisted code that clang occasionally emits; stack
frame setup can happen very late after blocks of conditional code.
|
|
|
|
| |
because the next frame is in userspace.
|
|
|
|
|
|
| |
userret() must be called on trap() exit to deliver it, rather than
repeating the same cause infinitely. discovered by George Koehler
ok kettenis bluhm visa
|
| |
|
|
|
|
|
|
| |
of soft interrupts are lower than priorities of hard interrupts.
This allows the delivery of hard interrupts while soft interrupts
are masked.
|
| |
|