|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] x86/time: Don't use virtual TSC if host and guest frequencies are equal
On 03/17/2017 03:48 AM, Jan Beulich wrote:
>>>> On 16.03.17 at 20:35, <boris.ostrovsky@xxxxxxxxxx> wrote:
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -2051,17 +2051,12 @@ void tsc_set_info(struct domain *d,
>> d->arch.vtsc_offset = get_s_time() - elapsed_nsec;
>> d->arch.tsc_khz = gtsc_khz ?: cpu_khz;
>> set_time_scale(&d->arch.vtsc_to_ns, d->arch.tsc_khz * 1000);
>> - /*
>> - * In default mode use native TSC if the host has safe TSC and:
>> - * HVM/PVH: host and guest frequencies are the same (either
>> - * "naturally" or via TSC scaling)
>> - * PV: guest has not migrated yet (and thus arch.tsc_khz ==
>> cpu_khz)
>> - */
>> +
>> + ASSERT(incarnation || d->arch.tsc_khz == cpu_khz);
> Hmm, is this valid for other than TSC_MODE_DEFAULT?
It is valid for all modes but I thought that the ASSERT is really only
"interesting" for DEFAULT and ALWAYS_EMULATE since this is when we
decide whether or not to set vtsc.
Since I need to rebase this anyway (due to PVH1 removal) I can move this
down right after the switch if you feel it would be useful.
-boris
>
> Jan
>
>> if ( tsc_mode == TSC_MODE_DEFAULT && host_tsc_is_safe() &&
>> - (has_hvm_container_domain(d) ?
>> - (d->arch.tsc_khz == cpu_khz ||
>> - hvm_get_tsc_scaling_ratio(d->arch.tsc_khz)) :
>> - incarnation == 0) )
>> + (d->arch.tsc_khz == cpu_khz ||
>> + (has_hvm_container_domain(d) &&
>> + hvm_get_tsc_scaling_ratio(d->arch.tsc_khz))) )
>> {
>> case TSC_MODE_NEVER_EMULATE:
>> d->arch.vtsc = 0;
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |