From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 5/5] HPET interaction with in-kernel PIT (v6) Date: Sun, 14 Jun 2009 11:53:28 +0300 Message-ID: <4A34BA88.7060204@redhat.com> References: <1244771206-19872-1-git-send-email-eak@us.ibm.com> <1244771206-19872-5-git-send-email-eak@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Beth Kon Return-path: Received: from mx2.redhat.com ([66.187.237.31]:50408 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751006AbZFNIx2 (ORCPT ); Sun, 14 Jun 2009 04:53:28 -0400 In-Reply-To: <1244771206-19872-5-git-send-email-eak@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Beth Kon wrote: > Signed-off-by: Beth Kon > > Please write a few words on what this patch does and why. > --- > arch/x86/include/asm/kvm.h | 1 + > arch/x86/kvm/i8254.c | 24 +++++++++++++++++++----- > arch/x86/kvm/i8254.h | 3 ++- > arch/x86/kvm/x86.c | 5 ++++- > 4 files changed, 26 insertions(+), 7 deletions(-) > > diff --git a/arch/x86/include/asm/kvm.h b/arch/x86/include/asm/kvm.h > index 708b9c3..3c44923 100644 > --- a/arch/x86/include/asm/kvm.h > +++ b/arch/x86/include/asm/kvm.h > @@ -235,6 +235,7 @@ struct kvm_guest_debug_arch { > > struct kvm_pit_state { > struct kvm_pit_channel_state channels[3]; > + u8 hpet_legacy_mode; > }; > This changes the ABI, breaking older binaries running on newer kernels, or newer binaries running on older kernels. > @@ -340,10 +340,20 @@ static void pit_load_count(struct kvm *kvm, int channel, u32 val) > } > } > > -void kvm_pit_load_count(struct kvm *kvm, int channel, u32 val) > +void kvm_pit_load_count(struct kvm *kvm, int channel, u32 val, int hpet_legacy_start) > { > + u8 saved_mode; > mutex_lock(&kvm->arch.vpit->pit_state.lock); > - pit_load_count(kvm, channel, val); > + 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 */ > + pit_load_count(kvm, channel, val); > + kvm->arch.vpit->pit_state.channels[0].mode = saved_mode; > + } else { > + if (!(channel == 0 && kvm->arch.vpit->pit_state.hpet_legacy_mode)) > + pit_load_count(kvm, channel, val); > Overindented. -- error compiling committee.c: too many arguments to function