kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm: use PIT channel index in hpet_legacy_start mode
@ 2016-01-07 12:32 P J P
  2016-01-07 12:37 ` Yang Zhang
  0 siblings, 1 reply; 5+ messages in thread
From: P J P @ 2016-01-07 12:32 UTC (permalink / raw)
  To: kvm; +Cc: Paolo Bonzini, P J P

From: P J P <pjp@fedoraproject.org>

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'. Update it
to use 'channel' index parameter.

Signed-off-by: P J P <pjp@fedoraproject.org>
---
 arch/x86/kvm/i8254.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 08116ff..154e936 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -420,10 +420,11 @@ 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 */
-		saved_mode = kvm->arch.vpit->pit_state.channels[0].mode;
-		kvm->arch.vpit->pit_state.channels[0].mode = 0xff; /* disable timer */
+		saved_mode = kvm->arch.vpit->pit_state.channels[channel].mode;
+		/* disable timer */
+		kvm->arch.vpit->pit_state.channels[channel].mode = 0xff;
 		pit_load_count(kvm, channel, val);
-		kvm->arch.vpit->pit_state.channels[0].mode = saved_mode;
+		kvm->arch.vpit->pit_state.channels[channel].mode = saved_mode;
 	} else {
 		pit_load_count(kvm, channel, val);
 	}
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-07 13:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-07 12:32 [PATCH] kvm: use PIT channel index in hpet_legacy_start mode P J P
2016-01-07 12:37 ` Yang Zhang
2016-01-07 12:50   ` Paolo Bonzini
2016-01-07 13:28     ` P J P
2016-01-07 13:50       ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).