From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerone Young Date: Wed, 02 Apr 2008 16:56:52 +0000 Subject: Re: [kvm-ppc-devel] [PATCH 2 of 2] Add PowerPC KVM guest Message-Id: <1207155412.9783.1.camel@thinkpadL> List-Id: References: <1206741014.5432.36.camel@basalt> In-Reply-To: <1206741014.5432.36.camel@basalt> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On Wed, 2008-04-02 at 11:17 +0200, Christian Ehrhardt wrote: > Jerone Young wrote: > > Add PowerPC KVM guest wait handling support > > > > This patch handles a guest that is in a wait state. This ensures that the guest is not allways eating up 100% cpu when it is idle. > > > > Signed-off-by: Jerone Young > > > > diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c > > --- a/arch/powerpc/kvm/powerpc.c > > +++ b/arch/powerpc/kvm/powerpc.c > > @@ -164,13 +164,12 @@ void kvmppc_dump_vcpu(struct kvm_vcpu *v > [...] > > > + /* handle guest vcpu that is in wait state */ > > + /* XXX eventually replace with kvm_vcpu_block() */ > > + if (vcpu->arch.msr & MSR_WE) { > > ### > > + DECLARE_WAITQUEUE(wait, current); > > + > > + add_wait_queue(&vcpu->wq, &wait); > > + > > + while (!kvm_cpu_has_interrupt(vcpu) > > + && !signal_pending(current) > > + && !kvm_arch_vcpu_runnable(vcpu)) { > > + > > + set_current_state(TASK_INTERRUPTIBLE); > > + schedule(); > > + } > > + > > + __set_current_state(TASK_RUNNING); > > + remove_wait_queue(&vcpu->wq, &wait); > ### > > We talked about calling kvm_vcpu_block here which does the same. What has become of it? > I mean the check is the same now and the waitqueues too. The only difference is vcpu_load/put which calls kvm_arch_vcpu_load/put which are noops for us. > I the issues are only caused by the prempt/lockign stuff there - ?is it? - this could either changed there in kvm_vcpu_block e.g. with a ifdef, a runtime if or by moving that to the architectures which support these stuff. > The reason for not using kvm_vcpu_block is that I couldn't figure out in enough time how to get the premempt notify stuff to work. We really don't even need it, but it's used in kvm_vcpu_block and I just don't have the time to figure out what all is needed for it to work. > > + } > > > > /* Do some exit accounting. */ > > ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ kvm-ppc-devel mailing list kvm-ppc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-ppc-devel