kvm: x86: only channel 0 of the i8254 is linked to the HPET
While setting the KVM PIT counters in 'kvm_pit_load_count', if
'hpet_legacy_start' is set, the function disables the timer on
channel[0], instead of the respective index 'channel'. This is
because channels 1-3 are not linked to the HPET. Fix the caller
to only activate the special HPET processing for channel 0.
Reported-by: P J P <pjp@fedoraproject.org>
Fixes: 0185604c2d
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
@@ -420,6 +420,7 @@ void kvm_pit_load_count(struct kvm *kvm, int channel, u32 val, int hpet_legacy_s
|
||||
u8 saved_mode;
|
||||
if (hpet_legacy_start) {
|
||||
/* save existing mode for later reenablement */
|
||||
WARN_ON(channel != 0);
|
||||
saved_mode = kvm->arch.vpit->pit_state.channels[0].mode;
|
||||
kvm->arch.vpit->pit_state.channels[0].mode = 0xff; /* disable timer */
|
||||
pit_load_count(kvm, channel, val);
|
||||
|
Reference in New Issue
Block a user