]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86: re-enable VCPUOP_register_vcpu_time_memory_area
authorJan Beulich <jbeulich@suse.com>
Mon, 27 May 2013 06:59:38 +0000 (08:59 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 27 May 2013 06:59:38 +0000 (08:59 +0200)
By moving the call to update_vcpu_system_time() out of schedule() into
arch-specific context switch code, the original problem of the function
accessing the wrong domain's address space goes away (obvious even from
patch context, as update_runstate_area() does similar copying).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/arm/domain.c
xen/arch/x86/domain.c
xen/arch/x86/hvm/hvm.c
xen/common/schedule.c

index ee12b5f08fe30bc0150bd47fd603eabc4922ee37..4c434a1b63e64187f164a3298eb978cd9bd8f41e 100644 (file)
@@ -232,6 +232,9 @@ static void schedule_tail(struct vcpu *prev)
 
     if ( prev != current )
         update_runstate_area(current);
+
+    /* Ensure that the vcpu has an up-to-date time base. */
+    update_vcpu_system_time(current);
 }
 
 static void continue_new_vcpu(struct vcpu *prev)
index 161d1b34d7e5097e8316b7ac99fba2b2d246640e..5c89197692a474ba518c4d01a8410262728f7f21 100644 (file)
@@ -966,11 +966,6 @@ arch_do_vcpu_op(
 
     switch ( cmd )
     {
-    /*
-     * XXX Disable for 4.0.0: __update_vcpu_system_time() writes to the given
-     * virtual address even when running in another domain's address space.
-     */
-#if 0
     case VCPUOP_register_vcpu_time_memory_area:
     {
         struct vcpu_register_time_memory_area area;
@@ -989,7 +984,6 @@ arch_do_vcpu_op(
 
         break;
     }
-#endif
 
     case VCPUOP_get_physid:
     {
@@ -1457,6 +1451,9 @@ void context_switch(struct vcpu *prev, struct vcpu *next)
     if (prev != next)
         update_runstate_area(next);
 
+    /* Ensure that the vcpu has an up-to-date time base. */
+    update_vcpu_system_time(next);
+
     schedule_tail(next);
     BUG();
 }
index bcf96093d4719b0f925ea08297a1fbc51eb24f77..a962ce253db4ea05e2aa6521b965108d6f29e9e0 100644 (file)
@@ -3191,6 +3191,7 @@ static long hvm_vcpu_op(
     case VCPUOP_set_singleshot_timer:
     case VCPUOP_stop_singleshot_timer:
     case VCPUOP_register_vcpu_info:
+    case VCPUOP_register_vcpu_time_memory_area:
         rc = do_vcpu_op(cmd, vcpuid, arg);
         break;
     default:
@@ -3249,6 +3250,7 @@ static long hvm_vcpu_op_compat32(
     case VCPUOP_set_singleshot_timer:
     case VCPUOP_stop_singleshot_timer:
     case VCPUOP_register_vcpu_info:
+    case VCPUOP_register_vcpu_time_memory_area:
         rc = compat_vcpu_op(cmd, vcpuid, arg);
         break;
     default:
index e52660236a1173900b5cc4e8fa5f714e51d045c3..a8398bd9ed4827564bed4346e1fdfbb98ec5907e 100644 (file)
@@ -1231,8 +1231,6 @@ static void schedule(void)
     if ( next_slice.migrated )
         evtchn_move_pirqs(next);
 
-    /* Ensure that the domain has an up-to-date time base. */
-    update_vcpu_system_time(next);
     vcpu_periodic_timer_work(next);
 
     context_switch(prev, next);