From: Marcelo T. <mto...@re...> - 2008-04-30 16:20:46
|
The in-kernel PIT emulation ignores pending timers if operating under mode 4, which for example DragonFlyBSD uses (and Plan9 too, apparently). Mode 4 seems to be similar to one-shot mode, other than the fact that it starts counting after the next CLK pulse once programmed, while mode 1 starts counting immediately, so add a FIXME to enhance precision. Fixes https://sourceforge.net/tracker/?func=detail&atid=893831&aid=1952988&group_id=180599 Signed-off-by: Marcelo Tosatti <mto...@re...> Acked-by: Sheng Yang <she...@in...> diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 908520c..1646102 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -288,6 +288,8 @@ static void pit_load_count(struct kvm *kvm, int channel, u32 val) * mode 1 is one shot, mode 2 is period, otherwise del timer */ switch (ps->channels[0].mode) { case 1: + /* FIXME: enhance mode 4 precision */ + case 4: create_pit_timer(&ps->pit_timer, val, 0); break; case 2: |