[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5] new config option vtsc_tolerance_khz to avoid TSC emulation



>>> On 27.03.18 at 11:26, <olaf@xxxxxxxxx> wrote:
> @@ -2149,8 +2154,26 @@ void tsc_set_info(struct domain *d,
>           * When a guest is created, gtsc_khz is passed in as zero, making
>           * d->arch.tsc_khz == cpu_khz. Thus no need to check incarnation.
>           */
> +        disable_vtsc = d->arch.tsc_khz == cpu_khz;
> +
> +        if ( tsc_mode == TSC_MODE_DEFAULT && gtsc_khz &&
> +             d->arch.vtsc_tolerance_khz )
> +        {
> +            uint32_t khz_diff;
> +
> +            khz_diff = cpu_khz > gtsc_khz ?
> +                       cpu_khz - gtsc_khz : gtsc_khz - cpu_khz;

abs() (or some variant of it, like __builtin_absl(), seeing that we
don't appear to have any abstraction right now)?

> +            disable_vtsc = khz_diff <= d->arch.vtsc_tolerance_khz;
> +
> +            printk(XENLOG_G_INFO "%s: d%u: host has %lu kHz,"

d%d

> +                   " domU expects %u kHz,"
> +                   " difference of %u is %s tolerance of %u\n",
> +                   __func__, d->domain_id, cpu_khz, gtsc_khz, khz_diff,

Please omit __func__ (or use dprintk() or gdprintk()).

Other than these cosmetic remarks this looks reasonable to me
(including the underlying concept), but of course I'd like to hear
Andrew's opinion whether this addresses his previously raised
concerns.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.