Skip to content

Commit 516c50c

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM fix from Paolo Bonzini: "A simple fix. I'm sending it before the merge window, because it refines a patch found in your master branch but not yet in the kvm/next branch that is destined for 4.5" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: kvm: x86: only channel 0 of the i8254 is linked to the HPET
2 parents 496b0b5 + e5e57e7 commit 516c50c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

arch/x86/kvm/i8254.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ void kvm_pit_load_count(struct kvm *kvm, int channel, u32 val, int hpet_legacy_s
420420
u8 saved_mode;
421421
if (hpet_legacy_start) {
422422
/* save existing mode for later reenablement */
423+
WARN_ON(channel != 0);
423424
saved_mode = kvm->arch.vpit->pit_state.channels[0].mode;
424425
kvm->arch.vpit->pit_state.channels[0].mode = 0xff; /* disable timer */
425426
pit_load_count(kvm, channel, val);

arch/x86/kvm/x86.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3606,7 +3606,8 @@ static int kvm_vm_ioctl_set_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps)
36063606
sizeof(kvm->arch.vpit->pit_state.channels));
36073607
kvm->arch.vpit->pit_state.flags = ps->flags;
36083608
for (i = 0; i < 3; i++)
3609-
kvm_pit_load_count(kvm, i, kvm->arch.vpit->pit_state.channels[i].count, start);
3609+
kvm_pit_load_count(kvm, i, kvm->arch.vpit->pit_state.channels[i].count,
3610+
start && i == 0);
36103611
mutex_unlock(&kvm->arch.vpit->pit_state.lock);
36113612
return 0;
36123613
}

0 commit comments

Comments
 (0)