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

Re: [Xen-devel] [PATCH v5 2/6] x86: allow reading MSR_IA32_TSC with XENPF_resource_op



>>> On 23.01.15 at 09:42, <chao.p.peng@xxxxxxxxxxxxxxx> wrote:
> Except that MSR_IA32_TSC will looks heterogeneous. But since we already
> treat it as a special case, I have no problem here. And if we do so,
> even the first patch to add irq_disable ability is not needed. Sounds to
> me that the MSR_IA32_TSC read should always imply irq disabled. Codes
> would be like this:

Looks reasonable, minus some formatting issues and ...

>         case XEN_RESOURCE_OP_MSR_READ:
>             if ( unlikely(entry->idx == MSR_IA32_TSC) )
>             { 
>                 entry->val = get_s_time_fixed(tsc);
>                 ret = 0;
>             }   
>             else
>             {
>                 bool_t  read_tsc = 0;
>                 if ( i < ra->nr_done - 1 ) 
>                 {   
>                     xenpf_resource_entry_t *next = ra->entries + i + 1;
>                     if ( unlikely(next->idx == MSR_IA32_TSC) )

... this simply being entry[1].idx.

Jan

>                         read_tsc = 1;
>                 }
> 
>                 if ( unlikely(read_tsc) )
>                     local_irq_save(irqflags);
> 
>                 ret = rdmsr_safe(entry->idx, entry->val);
> 
>                 if ( unlikely(read_tsc) )
>                 {
>                     rdtscll(tsc);
>                     local_irq_restore(irqflags);
>                 }
>             }
>             break;
>         case XEN_RESOURCE_OP_MSR_WRITE:
> 
> Chao




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