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

Re: [Xen-devel] [PATCH 1/6] x86/pvh: fix TSC mode setup for PVH Dom0



On Fri, Oct 12, 2018 at 09:34:35AM -0600, Jan Beulich wrote:
> >>> On 09.10.18 at 11:42, <roger.pau@xxxxxxxxxx> wrote:
> > A PVH Dom0 might use TSC scaling or other HVM specific TSC
> > adjustments, so only short-circuit the TSC setup for a classic PV
> > Dom0.
> 
> How that?

If the hardware supports hvm_tsc_scaling_supported
d->arch.hvm.tsc_scaling_ratio would be left uninitialized for a PVH
Dom0, leading to wrong scaling being applied.

hvm_domain_initialise also attempts to set
d->arch.hvm.tsc_scaling_ratio but AFAICT this is bogus, for a PVH Dom0
this lead to a non-working PV clock, only tsc_set_info seems to set
the correct values (also note the logic difference in setting
d->arch.hvm.tsc_scaling_ratio from hvm_domain_initialise or
tsc_set_info).

> > --- a/xen/arch/x86/time.c
> > +++ b/xen/arch/x86/time.c
> > @@ -2125,7 +2125,7 @@ void tsc_set_info(struct domain *d,
> >  {
> >      ASSERT(!is_system_domain(d));
> >  
> > -    if ( is_hardware_domain(d) )
> > +    if ( is_pv_domain(d) && is_hardware_domain(d) )
> 
> This code path is reachable only from arch_domain_create()
> (setting defaults) and XEN_DOMCTL_settscinfo (which Dom0 can't
> issue against itself). So either there's some important part missing
> from the description, or I fail to see what use this change is. Hmm,
> on a platform where host_tsc_is_safe() returns false the setting
> of defaults would have an effect, but I think the description
> should then say so, instead of giving the impression that the
> functionality would become available in full.

This is called from arch_domain_create with the defaults, which is
called during PVH Dom0 construction. What might be relevant for a PVH
Dom0 is the last chunk of the function, the code inside the
is_hvm_domain check.

Thanks, Roger.

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