WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: Question on virtual HPET's behavior

To: "Shan, Haitao" <haitao.shan@xxxxxxxxx>
Subject: [Xen-devel] Re: Question on virtual HPET's behavior
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Wed, 26 Dec 2007 13:52:50 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 26 Dec 2007 05:46:30 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <823A93EED437D048963A3697DB0E35DEFD37B9@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AchHvBbtVyfWSh9jR1ygGG/txsMeigACoOB5
Thread-topic: Question on virtual HPET's behavior
User-agent: Microsoft-Entourage/11.3.6.070618
My reading of the (really bad) specification doc is that in periodic mode writes to the comparator register change the period only, unless VAL_SET_CNF is set in which case only the comparator counter value is set. The Linux HPET code agrees with this interpretation — it writes to the comparator register twice. Do you have an example of an OS that assumes different HPET behaviour?

 -- Keir

On 26/12/07 12:37, "Shan, Haitao" <haitao.shan@xxxxxxxxx> wrote:

Here hpet.period is updated only when timer 0 is in periodic mode and SET_VAL is not set. But from HPET spec 1.0a, I can not find the reason. The spec provides a recommended sequence to reset main counter and comparator.

If the software resets the main counter, the value in the comparator’s value register needs to reset as well. This can be done by setting the n_VAL_SET_CNF bit. Again, to avoid race conditions, this should be done with the main counter halted. The following usage model is expected:

1) Software clears the GLOBAL_ENABLE_CNF bit to prevent any interrupts

2) Software Clears the main counter by writing a value of 00000000h to it.

3) Software sets the TIMER0_VAL_SET_CNF bit.

4) Software writes the new value in the TIMER0_COMPARATOR_VAL register

5) Software sets the GLOBAL_ENABLE_CNF bit to enable interrupts.

What will the result is system software only writes the comparator once after set SET_VAL like the above sequence?

Can you give me some hints? Thanks in advance!

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel