From: Aurelien Jarno Date: Fri, 2 May 2008 15:02:23 +0000 (+0200) Subject: KVM: PIT: support mode 3 X-Git-Tag: kvm-69rc1~16 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=38df5142b94ffa8f09681ca3ad6f141e3a9b0b8c;p=users%2Fdwmw2%2Flinux.git KVM: PIT: support mode 3 The in-kernel PIT emulation ignores pending timers if operating under mode 3, which for example Hurd uses. This mode should output a square wave, high for (N+1)/2 counts and low for (N-1)/2 counts. As we only care about the resulting interrupts, the period is N, and mode 3 is the same as mode 2 with regard to interrupts. Signed-off-by: Aurelien Jarno Signed-off-by: Avi Kivity --- diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index fcd1825c2fd5a..fba0e4ebb8ebd 100644 --- a/arch/x86/kvm/i8254.c +++ b/arch/x86/kvm/i8254.c @@ -293,6 +293,7 @@ static void pit_load_count(struct kvm *kvm, int channel, u32 val) create_pit_timer(&ps->pit_timer, val, 0); break; case 2: + case 3: create_pit_timer(&ps->pit_timer, val, 1); break; default: