All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/02] pvrdtscp: move the place of write_rdtscp_aux()
@ 2009-12-11 11:53 Xu, Dongxiao
  2009-12-11 14:51 ` Dan Magenheimer
  0 siblings, 1 reply; 4+ messages in thread
From: Xu, Dongxiao @ 2009-12-11 11:53 UTC (permalink / raw)
  To: xen-devel@lists.xensource.com; +Cc: Keir Fraser

[-- Attachment #1: Type: text/plain, Size: 425 bytes --]

 Pvrdtscp: move write_rdtscp_aux() to paravirt_ctxt_switch_to()
 - Currently write_rdtscp_aux() is placed in update_vcpu_system_time(), which
is called by schedule() before context_switch(). This will break the HVM guest
TSC_AUX state because at this point, MSR hasn't beed saved for HVM guests.So
put the function in the point when a PV vcpu is really scheduled in. 

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>

[-- Attachment #2: 01-write-pvrdtscp-tsc-aux.patch --]
[-- Type: application/octet-stream, Size: 1624 bytes --]

Pvrdtscp: move write_rdtscp_aux() to paravirt_ctxt_switch_to()
 - Currently write_rdtscp_aux() is placed in update_vcpu_system_time(), which
is called by schedule() before context_switch(). This will break the HVM guest
TSC_AUX state because at this point, MSR hasn't beed saved for HVM guests.So
put the function in the point when a PV vcpu is really scheduled in. 

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>

diff -r 7f611de6b93c xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Tue Dec 08 14:14:27 2009 +0000
+++ b/xen/arch/x86/domain.c	Fri Dec 11 12:02:49 2009 +0800
@@ -1298,6 +1298,10 @@ static void paravirt_ctxt_switch_to(stru
         write_debugreg(6, v->arch.guest_context.debugreg[6]);
         write_debugreg(7, v->arch.guest_context.debugreg[7]);
     }
+
+    if ( (v->domain->arch.tsc_mode ==  TSC_MODE_PVRDTSCP) &&
+         boot_cpu_has(X86_FEATURE_RDTSCP) )
+        write_rdtscp_aux(v->domain->arch.incarnation);
 }
 
 /* Update per-VCPU guest runstate shared memory area (if registered). */
diff -r 7f611de6b93c xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Tue Dec 08 14:14:27 2009 +0000
+++ b/xen/arch/x86/time.c	Fri Dec 11 12:02:49 2009 +0800
@@ -831,10 +831,6 @@ static void __update_vcpu_system_time(st
                                 &d->arch.ns_to_vtsc);
     else
         tsc_stamp = t->local_tsc_stamp;
-
-    if ( (d->arch.tsc_mode ==  TSC_MODE_PVRDTSCP) &&
-         boot_cpu_has(X86_FEATURE_RDTSCP) )
-        write_rdtscp_aux(d->arch.incarnation);
 
     /* Don't bother unless timestamps have changed or we are forced. */
     if ( !force && (u->tsc_timestamp == tsc_stamp) )


[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-12-11 16:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-11 11:53 [PATCH 01/02] pvrdtscp: move the place of write_rdtscp_aux() Xu, Dongxiao
2009-12-11 14:51 ` Dan Magenheimer
2009-12-11 15:31   ` Xu, Dongxiao
2009-12-11 16:14     ` Dan Magenheimer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.