From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] VPMU issue on Nehalem cpus Date: Mon, 22 Nov 2010 09:28:57 +0000 Message-ID: References: <4CEA439E020000780002396B@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4CEA439E020000780002396B@vpn.id2.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich , Dietmar Hahn Cc: xen-devel@lists.xensource.com, Haitao Shan List-Id: xen-devel@lists.xenproject.org On 22/11/2010 09:19, "Jan Beulich" wrote: >>>> + val = msr_content & ((1 << num_gen_pmc) - 1); >>> >>> What's the point of masking if the subsequent loop looks at the >>> bottom so many bits only anyway? >> >> Bits 0-31 flag the overflow of the general counters (currently max 4) and >> 32-63 >> flag the overflow of the fixed counter (currently max 3). >> Yes the first mask is not necessary, maybe a comment would be better? > > Neither is the second mask (below) - the shift is all that's really > needed. Afaic, a comment doesn't seem necessary, but Keir > may by of different opinion here. It's clear from the code that the mask operation is unnecessary. No code comment required. -- Keir