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>
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). */
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) )
return;