mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/time: scale host TSC in pvclock properly
This patch makes the pvclock return the scaled host TSC and corresponding scaling parameters to HVM domains if guest TSC is not emulated and TSC scaling is enabled. Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
This commit is contained in:
1 parent
52fd9a46f6
commit
eab8a90be7
1 file changed
+12
-4
+12
-4
@@ -815,10 +815,18 @@ static void __update_vcpu_system_time(struct vcpu *v, int force)
|
||||
}
|
||||
else
|
||||
{
|
||||
tsc_stamp = t->local_tsc_stamp;
|
||||
|
||||
_u.tsc_to_system_mul = t->tsc_scale.mul_frac;
|
||||
_u.tsc_shift = (s8)t->tsc_scale.shift;
|
||||
if ( has_hvm_container_domain(d) && cpu_has_tsc_ratio )
|
||||
{
|
||||
tsc_stamp = hvm_funcs.scale_tsc(v, t->local_tsc_stamp);
|
||||
_u.tsc_to_system_mul = d->arch.vtsc_to_ns.mul_frac;
|
||||
_u.tsc_shift = d->arch.vtsc_to_ns.shift;
|
||||
}
|
||||
else
|
||||
{
|
||||
tsc_stamp = t->local_tsc_stamp;
|
||||
_u.tsc_to_system_mul = t->tsc_scale.mul_frac;
|
||||
_u.tsc_shift = t->tsc_scale.shift;
|
||||
}
|
||||
}
|
||||
|
||||
_u.tsc_timestamp = tsc_stamp;
|
||||
|
||||