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

Re: [Xen-devel] [PATCH 10/11] xen/arch/x86: clarify domid == 0 checks



>>> On 15.04.13 at 15:47, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx> wrote:
> On 04/15/2013 04:51 AM, Jan Beulich wrote:
>>>>> On 12.04.13 at 23:04, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx> wrote:
>>> --- a/xen/arch/x86/time.c
>>> +++ b/xen/arch/x86/time.c
>>> @@ -1928,7 +1928,7 @@ void tsc_set_info(struct domain *d,
>>>                     uint32_t tsc_mode, uint64_t elapsed_nsec,
>>>                     uint32_t gtsc_khz, uint32_t incarnation)
>>>   {
>>> -    if ( is_idle_domain(d) || (d->domain_id == 0) )
>>> +    if ( is_idle_domain(d) || is_hardware_domain(d) || is_control_domain(d)
>>> )
>>>       {
>>>           d->arch.vtsc = 0;
>>>           return;
>>> @@ -2005,7 +2005,7 @@ static void dump_softtsc(unsigned char key)
>>>                  "warp=%lu (count=%lu)\n", tsc_max_warp, tsc_check_count);
>>>       for_each_domain ( d )
>>>       {
>>> -        if ( d->domain_id == 0 && d->arch.tsc_mode == TSC_MODE_DEFAULT )
>>> +        if ( is_hardware_domain(d) && d->arch.tsc_mode == TSC_MODE_DEFAULT 
>>> )
>>>               continue;
>>>           printk("dom%u%s: mode=%d",d->domain_id,
>>>                   is_hvm_domain(d) ? "(hvm)" : "", d->arch.tsc_mode);
>>
>> I am of the opinion that the two checks should match, i.e. the
>> second one should also become is_hardware || is_control. But
>> I say this without really recalling why Dom0 is being special cased
>> here in the first place.
> 
> Since this is just an output function, my best guess is to avoid displaying
> dom0 statistics that aren't relevant for a query that is intended for domUs,
> so it doesn't really matter what is tested.

Right now it doesn't, but the ultimate goal is for is_control_domain()
and is_hardware_domain() to check different aspects. The latter
seems to be the correct fit here, so I suppose the first check above
should also test just that.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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