kernel - refactor cpusync and pmap_inval code, fix lockup
* Simplify the cpusync API. The API now has only one initialization call,
one simplified rollup call, and two primary calls handling a single
function callback (instead of three callbacks).
cpusync_interlock() interlocks the specified set of cpus and ensures they
are running in a safe place, cpusync_deinterlock() executes the initialized
function on the cpu set and does not return until all cpus have completed
the operation.
* Simplify the pmap_inval per-platform API. pmap_inval_interlock() and
pmap_inval_deinterlock() now reflect similar functionality to the cpusync
API. pmap/pte operations are now synchronized when pmap_inval_deinterlock()
is called and not when pmap_inval_done() is called, reducing the range of
code which can execute while the cpu set is held quiescent.
pmap_inval_flush() has been removed. Critical section handling has also
been rearranged slightly in the pmap_inval* and cpusync* APIs.
* Fixes a cpusync lockup which occurs when the x86-64 pmap and pmap_inval
code is used to hold a cpu mask quiescent across complex subsystem calls.
Primarily accomplished by moving the synchronization out of
pmap_inval_flush() and into pmap_inval_deinterlock().
12 files changed: