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

Re: [Xen-devel] [PATCH 1/4] x86: Begin to remove TSC mode PVRDTSCP



>>> On 15.11.18 at 22:47, <andrew.cooper3@xxxxxxxxxx> wrote:
> For more historical context, see
>   c/s c17b36d5dc792cfdf59b6de0213b168bec0af8e8
>   c/s 04656384a1b9714e43db850c51431008e23450d8
> 
> PVRDTSCP was an attempt to provide Xen-aware userspace with a stable monotonic
> clock, and enough information for said userspace to cope with frequency
> changes across migrate.  However, the PVRDTSCP infrastructure has resulted in
> very tangled code, and non-architectural behaviour even in non-PVRDTSCP 
> cases.
> 
> Seeing as the functionality has been replaced entirely by improvements in PV
> clocks (including being plumbed into the VDSO nowadays), or alternatively by
> hardware TSC scaling features, and no-one is aware of any remaining users of
> this mode, take the opportunity to remove it.

With "remaining" suitably replaced to express that none are known to
ever have existed in the wild ...

> For now, introduce an upper range check on the toolstack setting to
> XEN_DOMCTL_settscinfo, and exclude TSC_MODE_PVRDTSCP from selection.
> (Arguably, its a bug that this hypercall previously accepted any value and
> turned into a nop).  This will catch and cleanly reject attempts to migrate in
> a VM configured to use PVRDTSCP, rather than letting it run and have the wrong
> timing mode.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
albeit I think this ...

> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -970,7 +970,8 @@ long arch_do_domctl(
>          break;
>  
>      case XEN_DOMCTL_settscinfo:
> -        if ( d == currd ) /* no domain_pause() */
> +        if ( d == currd || /* no domain_pause() */
> +             domctl->u.tsc_info.tsc_mode > TSC_MODE_NEVER_EMULATE )

... would better be left to tsc_set_info().

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®.