bitkeeper revision 1.1159.223.68 (4204a5090n9Cd2ll6YcdL3tK2uDu1A)
authormafetter@fleming.research <mafetter@fleming.research>
Sat, 5 Feb 2005 10:50:49 +0000 (10:50 +0000)
committermafetter@fleming.research <mafetter@fleming.research>
Sat, 5 Feb 2005 10:50:49 +0000 (10:50 +0000)
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
xen/common/schedule.c

index 5be947dc5a6efff46e41c2eb80bf234cf70e7d1a..ec215d5ed9a3fda253a819940c043e1c8826444e 100644 (file)
@@ -318,8 +318,6 @@ void __enter_scheduler(void)
     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);
@@ -369,6 +367,8 @@ void __enter_scheduler(void)
     
     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);