From: Jerone Young <jyoung5@us.ibm.com>
To: kvm-ppc@vger.kernel.org
Subject: Re: [kvm-ppc-devel] [PATCH 2 of 2] Add PowerPC KVM guest
Date: Wed, 02 Apr 2008 19:26:45 +0000 [thread overview]
Message-ID: <1207164405.12998.8.camel@thinkpadL> (raw)
In-Reply-To: <1206741014.5432.36.camel@basalt>
On Wed, 2008-04-02 at 14:23 -0500, Hollis Blanchard wrote:
> On Wednesday 02 April 2008 13:07:55 Jerone Young wrote:
> > # HG changeset patch
> > # User Jerone Young <jyoung5@us.ibm.com>
> > # Date 1207159658 18000
> > # Node ID f3f6c082021e9a3a515f140763b6ba2b677e8b34
> > # Parent 007c135cb5f14f5eb025c103623c2ebfcc76ab11
> > 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 <jyoung5@us.ibm.com>
> >
> > 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
> >
> > int kvm_cpu_has_interrupt(struct kvm_vcpu *v)
> > {
> > - /* XXX implement me */
> > - return 0;
> > + return (v->arch.pending_exceptions);
> > }
> >
> > int kvm_arch_vcpu_runnable(struct kvm_vcpu *v)
> > {
> > - return 1;
> > + return !(v->arch.msr & MSR_WE);
> > }
> >
> > /* Check if we are ready to deliver the interrupt */
> > @@ -342,6 +341,25 @@ int kvmppc_handle_exit(struct kvm_run *r
> > default:
> > BUG();
> > }
> > +
> > + /* 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);
> > + }
> > +
> > break;
> >
> > case BOOKE_INTERRUPT_DATA_STORAGE:
>
> I've commented on this several times, by email and in person, and you told me
> that you would move this code inside emulate_instruction().
No I was saying that the code was going to go after emulate_instructions
was run. Not in the emulate_instruction function. That is where the code
has been placed just after the function is run.
Did you want in in the emulate_instruction function ?
>
-------------------------------------------------------------------------
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
next prev parent reply other threads:[~2008-04-02 19:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 21:50 [kvm-ppc-devel] [PATCH 2 of 2] Add PowerPC KVM guest Hollis Blanchard
2008-03-28 22:35 ` Jerone Young
2008-03-31 16:35 ` Hollis Blanchard
2008-04-02 16:56 ` Jerone Young
2008-04-02 19:26 ` Jerone Young [this message]
2008-04-15 16:14 ` Jerone Young
2008-04-15 18:29 ` Jerone Young
2008-04-15 19:09 ` Jerone Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1207164405.12998.8.camel@thinkpadL \
--to=jyoung5@us.ibm.com \
--cc=kvm-ppc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.