From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: [PATCH] x86: don't write_tsc() non-zero values on CPUs updating only the lower 32 bits Date: Fri, 15 Apr 2011 08:08:42 +0100 Message-ID: <4DA80B1A020000780003C875@vpn.id2.novell.com> References: <4DA73CBD020000780003BBB0@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" , "winston.l.wang" List-Id: xen-devel@lists.xenproject.org >>> On 14.04.11 at 18:48, Keir Fraser wrote: > On 14/04/2011 17:28, "Jan Beulich" wrote: >> The only case not handled was if the TSC >> overflowed 64 bits during the process - I considered this case >> hypothetical only. >>=20 >> The final write of tsc+4*delta was basically an attempt to restore >> the value that would have been there if we didn't fiddle with it. >=20 > But the write is actually tsc + 4*(s32)(tmp-tsc), and tmp has 1U<<32 = ORed > into it (because it was read after your second write to the TSC. Perhaps = we > should just write back the full original tsc and call that good enough? Again, note the (s32) cast. Jan