From: Keir Fraser Date: Fri, 26 Oct 2007 09:55:50 +0000 (+0100) Subject: LAPIC timer accounting fix X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14828^2~32 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7ce59f734046248232a3827b5e4e6f16795f8331;p=xen.git 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 Signed-off-by: Gary Grebus --- 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;