All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Chao Peng <chao.p.peng@linux.intel.com>
Cc: wei.liu2@citrix.com, Ian.Campbell@citrix.com,
	stefano.stabellini@eu.citrix.com,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org,
	will.auld@intel.com, keir@xen.org
Subject: Re: [PATCH v5 2/6] x86: allow reading MSR_IA32_TSC with XENPF_resource_op
Date: Fri, 23 Jan 2015 08:58:32 +0000	[thread overview]
Message-ID: <54C21B48020000780005894A@mail.emea.novell.com> (raw)
In-Reply-To: <20150123084206.GE28428@pengc-linux.bj.intel.com>

>>> On 23.01.15 at 09:42, <chao.p.peng@linux.intel.com> 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

  reply	other threads:[~2015-01-23  8:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 11:19 [PATCH v5 0/6] enable Memory Bandwidth Monitoring (MBM) for VMs Chao Peng
2015-01-21 11:19 ` [PATCH v5 1/6] x86: allow IRQ to be disabled for resource access Chao Peng
2015-01-22 11:18   ` Jan Beulich
2015-01-21 11:19 ` [PATCH v5 2/6] x86: allow reading MSR_IA32_TSC with XENPF_resource_op Chao Peng
2015-01-22 11:20   ` Jan Beulich
2015-01-22 12:53     ` Chao Peng
2015-01-22 13:36       ` Jan Beulich
2015-01-22 14:03         ` Andrew Cooper
2015-01-22 14:09           ` Jan Beulich
2015-01-23  8:42             ` Chao Peng
2015-01-23  8:58               ` Jan Beulich [this message]
2015-01-21 11:19 ` [PATCH v5 3/6] tools: add routine to get CMT L3 event mask Chao Peng
2015-01-21 11:19 ` [PATCH v5 4/6] tools: correct coding style for psr Chao Peng
2015-01-21 11:19 ` [PATCH v5 5/6] tools: code refactoring for MBM Chao Peng
2015-01-21 11:19 ` [PATCH v5 6/6] tools, docs: add total/local memory bandwith monitoring Chao Peng
2015-01-21 11:28 ` [PATCH v5 0/6] enable Memory Bandwidth Monitoring (MBM) for VMs Jan Beulich
2015-01-22  1:12   ` Chao Peng
2015-01-22  7:59     ` Jan Beulich
2015-01-22 10:36       ` Chao Peng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54C21B48020000780005894A@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=chao.p.peng@linux.intel.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=will.auld@intel.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.