From: Keir Fraser Subject: Re: Workaround for buggy PIT Date: Wed, 15 Mar 2006 22:44:06 +0000 Message-ID: <173de780108e1a38d174d8ce07e76134@cl.cam.ac.uk> References: <441705EE.8050503@altap.cz> <4418707A.3000601@altap.cz> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4418707A.3000601@altap.cz> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tomas Kopal Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 15 Mar 2006, at 19:52, Tomas Kopal wrote: > I was printing out real diff values (detecting min and max over periods > of time) and it varied about 40% around the latch value. I didn't want > to get too many false positives, so I set it to double the expected > value. As the problematic values tend to be quite high, I think this is > a safe threshold. 40% range is huge, given that Xen disables interrupts only for very short periods of time. If you think that the timer ends up corrupting its count value, but continues counting in the mode we originally programmed it to, there would be no need for your patch to reprogram the timer. We could just clamp diff and let the timer continue to free-run from whatever value it corrupted itself to. Would that simpler patch, with no reprogramming, work for you? I agree with your suspicion that this may be a channel-0 problem. The 40% value range points at some serious weirdness. As for other timer problems -- the really common one (latched reads do not latch, so you get inconsistent 16-bit reads) don't long-term affect our time stability. We end up out by a few hundred microseconds on that read of the clock, but the 16-bit timer value doesn't wrap or anything really bad like that, so we can recover. Phew. :-) -- Keir