#
0ed1bf01 |
| 17-Sep-2023 |
cheloha <cheloha@openbsd.org> |
clockintr: remove clockintr_init(), clockintr_flags
All the state initialization once done in clockintr_init() has been moved to other parts of the kernel. It's a dead function. Remove it.
Likewi
clockintr: remove clockintr_init(), clockintr_flags
All the state initialization once done in clockintr_init() has been moved to other parts of the kernel. It's a dead function. Remove it.
Likewise, the clockintr_flags variable no longer sports any meaningful flags. Remove it. This frees up the CL_* flag namespace, which might be useful to the clockintr frontend if we ever need to add behavior flags to any of those functions.
show more ...
|
#
b3ef18bd |
| 14-Sep-2023 |
cheloha <cheloha@openbsd.org> |
clockintr: replace CL_RNDSTAT with global variable statclock_is_randomized
In order to separate the statclock from the clock interrupt subsystem we need to move all statclock state out into the broa
clockintr: replace CL_RNDSTAT with global variable statclock_is_randomized
In order to separate the statclock from the clock interrupt subsystem we need to move all statclock state out into the broader kernel.
Start by replacing the CL_RNDSTAT flag with a new global variable, "statclock_is_randomized", in kern_clock.c. Update all clockintr_init() callers to set the boolean instead of passing the flag.
Thread: https://marc.info/?l=openbsd-tech&m=169428749720476&w=2
show more ...
|
#
11d1f9b2 |
| 23-Aug-2023 |
cheloha <cheloha@openbsd.org> |
all platforms: separate cpu_initclocks() from cpu_startclock()
To give the primary CPU an opportunity to perform clock interrupt preparation in a machine-independent manner we need to separate the "
all platforms: separate cpu_initclocks() from cpu_startclock()
To give the primary CPU an opportunity to perform clock interrupt preparation in a machine-independent manner we need to separate the "initialization" parts of cpu_initclocks() from the "start the clock interrupt" parts. Currently, cpu_initclocks() does everything all at once, so there is no space for this MI setup.
Many platforms have more-or-less already done this separation by implementing a separate routine named "cpu_startclock()". This patch promotes cpu_startclock() from de facto standard to mandatory API.
- Prototype cpu_startclock() in sys/systm.h alongside cpu_initclocks(). The separation of responsibility between the two routines is a bit fuzzy but the basic guidelines are as follows:
+ cpu_initclocks() must initialize hz, stathz, and profhz, and call clockintr_init().
+ cpu_startclock() must call clockintr_cpu_init() and start the clock interrupt cycle on the calling CPU.
These guidelines will shift in the future, but that's the way things stand as of *this* commit.
- In initclocks(): first call cpu_initclocks(), then do MI setup, and last call cpu_startclock().
- On platforms where cpu_startclock() already exists: don't call cpu_startclock() from cpu_initclocks() anymore.
- On platforms where cpu_startclock() doesn't yet exist: implement it. Usually this is as simple as dividing cpu_initclocks() in two.
Tested on amd64 (i8254, lapic), arm64, i386 (i8254, lapic), macppc, mips64/octeon, and sparc64. Tested on arm/armv7 (agtimer(4)) by phessler@ and jmatthew@. Tested on m88k/luna88k by aoyama@. Tested on powerpc64 by gkoehler@ and mlarkin@. Tested on riscv64 by jmatthew@.
Thread: https://marc.info/?l=openbsd-tech&m=169195251322149&w=2
show more ...
|
#
671537bf |
| 25-Jul-2023 |
cheloha <cheloha@openbsd.org> |
statclock: move profil(2), GPROF code to profclock(), gmonclock()
This patch isolates profil(2) and GPROF from statclock(). Currently, statclock() implements both profil(2) and GPROF through a comp
statclock: move profil(2), GPROF code to profclock(), gmonclock()
This patch isolates profil(2) and GPROF from statclock(). Currently, statclock() implements both profil(2) and GPROF through a complex mechanism involving both platform code (setstatclockrate) and the scheduler (pscnt, psdiv, and psratio). We have a machine-independent interface to the clock interrupt hardware now, so we no longer need to do it this way.
- Move profil(2)-specific code from statclock() to a new clock interrupt callback, profclock(), in subr_prof.c. Each schedstate_percpu has its own profclock handle. The profclock is enabled/disabled for a given CPU when it is needed by the running thread during mi_switch() and sched_exit().
- Move GPROF-specific code from statclock() to a new clock interrupt callback, gmonclock(), in subr_prof.c. Where available, each cpu_info has its own gmonclock handle . The gmonclock is enabled/disabled for a given CPU via sysctl(2) in prof_state_toggle().
- Both profclock() and gmonclock() have a fixed period, profclock_period, that is initialized during initclocks().
- Export clockintr_advance(), clockintr_cancel(), clockintr_establish(), and clockintr_stagger() via <sys/clockintr.h>. They have external callers now.
- Delete pscnt, psdiv, psratio. From schedstate_percpu, also delete spc_pscnt and spc_psdiv. The statclock frequency is not dynamic anymore so these variables are now useless.
- Delete code/state related to the dynamic statclock frequency from kern_clockintr.c. The statclock frequency can still be pseudo-random, so move the contents of clockintr_statvar_init() into clockintr_init().
With input from miod@, deraadt@, and claudio@. Early revisions cleaned up by claudio. Early revisions tested by claudio@. Tested by cheloha@ on amd64, arm64, macppc, octeon, and sparc64 (sun4v). Compile- and boot- tested on i386 by mlarkin@. riscv64 compilation bugs found by mlarkin@. Tested on riscv64 by jca@. Tested on powerpc64 by gkoehler@.
show more ...
|
#
24ee467d |
| 04-Feb-2023 |
cheloha <cheloha@openbsd.org> |
timecounting: remove incomplete PPS support
The timecounting code has had stubs for pulse-per-second (PPS) polling since it was imported in 2004. At this point it seems unlikely that anyone is goin
timecounting: remove incomplete PPS support
The timecounting code has had stubs for pulse-per-second (PPS) polling since it was imported in 2004. At this point it seems unlikely that anyone is going to finish adding PPS support, so let's remove the stubs:
- Delete the dead tc_poll_pps() call from tc_windup(). - Remove all tc_poll_pps symbols from the kernel.
Link: https://marc.info/?l=openbsd-tech&m=167519035723210&w=2
ok miod@
show more ...
|
#
18cf9b3a |
| 17-Jan-2023 |
cheloha <cheloha@openbsd.org> |
agtimer(4/armv7): switch to clockintr
- Strip out custom hardclock/statclock scheduling code. - Remove debug evcount code. We can no longer differentiate between hardclock and statclock in the dr
agtimer(4/armv7): switch to clockintr
- Strip out custom hardclock/statclock scheduling code. - Remove debug evcount code. We can no longer differentiate between hardclock and statclock in the driver. - Wire up agtimer_intrclock.
With tweaks from miod@ and jca@. Tested by jca@ and kettenis@.
Link: https://marc.info/?l=openbsd-tech&m=167044965011140&w=2
ok kettenis@
show more ...
|
#
e3ee5e84 |
| 12-Mar-2022 |
mpi <mpi@openbsd.org> |
Constify struct cfattach.
ok patrick@
|
#
37e35e27 |
| 16-May-2021 |
jsg <jsg@openbsd.org> |
ansi
|
#
a4a50d96 |
| 25-Mar-2021 |
jsg <jsg@openbsd.org> |
remove uneeded includes in md armv7 files
based on include-what-you-use suggestions
|
#
8611d3cd |
| 23-Feb-2021 |
cheloha <cheloha@openbsd.org> |
timecounting: use C99-style initialization for all timecounter structs
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
timecounting: use C99-style initialization for all timecounter structs
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@
show more ...
|
#
2252d02c |
| 19-Jan-2021 |
kettenis <kettenis@openbsd.org> |
s/KHZ/kHz/ and reduce dmesg spam a bit
ok tb@, deraadt@
|
#
439fbd73 |
| 12-Jul-2020 |
naddy <naddy@openbsd.org> |
Use the full 32 bits for the miscellaneous armv7 timecounters. Checked against * ARM Architecture Reference Manual (agtimer) * ARM Cortex-A9 MPCore Technical Reference Manual (amptimer) * OMAP35x App
Use the full 32 bits for the miscellaneous armv7 timecounters. Checked against * ARM Architecture Reference Manual (agtimer) * ARM Cortex-A9 MPCore Technical Reference Manual (amptimer) * OMAP35x Applications Processor Technical Reference Manual (gptimer)
Artturi Alm had independently suggested this in the past.
show more ...
|
#
aca8cde2 |
| 11-Aug-2018 |
kettenis <kettenis@openbsd.org> |
Use MAXCPUS as the number of elements for the array of per-cpu data.
ok jsg@, patrick@
|
#
340fb6aa |
| 24-Sep-2016 |
kettenis <kettenis@openbsd.org> |
Remove a couple of unsused static inline functions. Also remove a comparis of an array to a null pointer that is always false. Found with clang.
ok jsg@
|
#
24e5cb75 |
| 10-Aug-2016 |
kettenis <kettenis@openbsd.org> |
Dynamically attach agtimer(4). Since agtimer(4) also provides the delay() function for platforms that have it, rework the code a bit such that it can be used before agtimer(4) attaches. Introduce a
Dynamically attach agtimer(4). Since agtimer(4) also provides the delay() function for platforms that have it, rework the code a bit such that it can be used before agtimer(4) attaches. Introduce a new agtimer_init() function that checks whether the CPU implements the Generic Timer feature and switches to agtimer_delay() if that feature is present. Call this function from the generic platform initialization code.
ok jsg@
show more ...
|
#
df7cbe9d |
| 05-Aug-2016 |
kettenis <kettenis@openbsd.org> |
Unmask the timer output signal for real.
ok patrick@, jsg@
|
#
e6a06f73 |
| 12-Dec-2015 |
mmcc <mmcc@openbsd.org> |
comment typo
|
#
bae369c3 |
| 06-Jun-2015 |
jsg <jsg@openbsd.org> |
Add some changes from Patrick Wildt in bitrig that are required to make the qemu cortex a15 useable without trustzone.
Establish the interrupt for the non-secure physical timer (30), in addition to
Add some changes from Patrick Wildt in bitrig that are required to make the qemu cortex a15 useable without trustzone.
Establish the interrupt for the non-secure physical timer (30), in addition to the secure physical timer (29).
Stop masking the timer output signal in the interrupt handler.
show more ...
|
#
4ccb6786 |
| 29-May-2015 |
jsg <jsg@openbsd.org> |
add some more cortex A ids
|
#
c83094e1 |
| 29-May-2015 |
jsg <jsg@openbsd.org> |
Remove unused bus space tags/handles. The generic timer uses the cp15 coprocessor space.
|
#
466195a2 |
| 09-Sep-2013 |
patrick <patrick@openbsd.org> |
Support for the ARM Generic Timer used in the Cortex-A7 and Cortex-A15.
|