aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hvm/vpt.c
diff options
context:
space:
mode:
authorKeir Fraser <keir@xensource.com>2007-10-26 10:55:50 +0100
committerKeir Fraser <keir@xensource.com>2007-10-26 10:55:50 +0100
commit7ce59f734046248232a3827b5e4e6f16795f8331 (patch)
treeadb98d7c63488600af8b3390d0886a500239245e /xen/arch/x86/hvm/vpt.c
parentd73a484a61f03d5e14b62f4374436e4d8e759894 (diff)
downloadxen-7ce59f734046248232a3827b5e4e6f16795f8331.tar.gz
xen-7ce59f734046248232a3827b5e4e6f16795f8331.tar.bz2
xen-7ce59f734046248232a3827b5e4e6f16795f8331.zip
LAPIC timer accounting fix
Offset emulated local APIC timer so it doesn't tick during guest's timer related processing. Otherwise, guests using the local APIC for process accounting can see long sequences of process ticks incorrectly charged to interrupt processing. Signed-off-by: Ben Guthro <bguthro@virtualron.com> Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
Diffstat (limited to 'xen/arch/x86/hvm/vpt.c')
-rw-r--r--xen/arch/x86/hvm/vpt.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 9ce8991594..ec0ac0b11c 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -307,6 +307,13 @@ void create_periodic_time(
pt->period_cycles = (u64)period * cpu_khz / 1000000L;
pt->one_shot = one_shot;
pt->scheduled = NOW() + period;
+ /*
+ * Offset LAPIC ticks from other timer ticks. Otherwise guests which use
+ * LAPIC ticks for process accounting can see long sequences of process
+ * ticks incorrectly accounted to interrupt processing.
+ */
+ if ( is_lvtt(v, irq) )
+ pt->scheduled += period >> 1;
pt->cb = cb;
pt->priv = data;