From: "Jan Beulich" Subject: Re: [PATCH v8 1/5] x86: allow reading MSR_IA32_TSC with XENPF_resource_op Date: Wed, 28 Jan 2015 15:42:34 +0000 Message-ID: <54C9117A020000780005A66C@mail.emea.novell.com> References: <1422432286-7276-1-git-send-email-chao.p.peng@linux.intel.com> <1422432286-7276-2-git-send-email-chao.p.peng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1422432286-7276-2-git-send-email-chao.p.peng@linux.intel.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Chao Peng Cc: wei.liu2@citrix.com, Ian.Campbell@citrix.com, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org, will.auld@intel.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 28.01.15 at 09:04, wrote: > + else > + { > + unsigned long irqflags; Some gcc versions can't figure out that this variable doesn't get used uninitialized, and hence warn about it. I fixed this while committing, at once changing the name to the more conventional "flags". Please be more careful with such conditional uses in the future. Jan > + /* > + * If next entry is MSR_IA32_TSC read, then the actual rdtscll > + * is performed together with current entry, with IRQ disabled. > + */ > + bool_t read_tsc = (i < ra->nr_done - 1 && > + unlikely(entry[1].idx == MSR_IA32_TSC)); > + > + 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;