>> 2: APIC timer >> a: V09 uses hrtimer for LAPIC timer, apic->timer.last_update is >> updated every time when __apic_timer_fn is invoked at time of the APIC >> timer fired. This impose an accumulated difference since the fire time >> is already some ns later after expected time. >> Xen solve this issue by increase apic->timer.last_update with >> the PERIOD, i.e. APIC_BUS_CYCLE_NS * apic->timer.divide_count * >> APIC_TMICT.
In theory you're right but in practice, if many hrtimers pop between TMCCT read than this is insignificant. But, I tend to agree and since this calculation is done anyway in the timer function. >> b: Seems current approach starts hrtimer whenever APIC_TMICT is >> updated. Should we check APIC_LVT to see if it is masked here? (instead >> of doing in its callback function:__apic_timer_fn). Also why APIC_TMCCT I'm not sure the spec says something about not running the timer while the LVTT is masked. Since it is checked anyway in the timer_fn it is practically identical. This also free us of starting/stopping the timer on mask changes. >> is updated here? I think TMCCT is reloaded only when it reaches 0 and >> LVTT works in periodic mode. Good catch. As Greg pointed out below, it is a code he inherited from me and I inherited from Xen. Did you check the apic spec w.r.t TMCCT value on TMICT updates? >> c: I didn't see LVTT mask status refelect the hrtimer >> cancel/start, do I miss something? Since the timer_fn check the mask it should be covered as explained above. Do you see any issues with it? >I inherited most of lapic.c from Dor, and I believe he inherited most of >it from an older version of Xen. While I have come to understand much >of the inner workings of the LAPIC during the course of developing this >patch, the timer is still a relative enigma to me. Therefore, I do not >have any comment as to the reasons why something was done here the way >it was, nor to the validity of the problems you are highlighting. >Perhaps Dor will know. HTH ;) > >But that being said, patches against v09 to fix problems you see are >always welcome. > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel