Bug fix to the scheduler for writable page tables.
Don't flush the writable page tables inside __enter_scheduler()
until after we've committed to switching to another domain.
Here's the problem: if enough debugging messages are enabled (for
example, shadow mode and/or writable page tables messages), then we
can get into a situation where we *always* visit
__enter_scheduler() after every page fault and/or hypercall. If we
flush the writable page tables every time we take a page fault,
we'll never end up actually getting into the domain with write
permissions enabled to its page table.
Signed-off-by: michael.fetterman@cl.cam.ac.uk
task_slice_t next_slice;
s32 r_time; /* time for new dom to run */
- cleanup_writable_pagetable(prev);
-
perfc_incrc(sched_run);
spin_lock_irq(&schedule_data[cpu].schedule_lock);
perfc_incrc(sched_ctx);
+ cleanup_writable_pagetable(prev);
+
#if defined(WAKE_HISTO)
if ( !is_idle_task(next) && next->wokenup ) {
ulong diff = (ulong)(now - next->wokenup);