public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Jerone Young <jyoung5@us.ibm.com>
Cc: kvm-ppc-devel@lists.sourceforge.net, kvm-devel@lists.sourceforge.net
Subject: Re: [kvm-ppc-devel] [PATCH 2 of 3] Add PowerPC KVM guest wait handling support
Date: Fri, 25 Apr 2008 08:56:03 -0500	[thread overview]
Message-ID: <200804250856.04031.hollisb@us.ibm.com> (raw)
In-Reply-To: <60c9ee8343f554ad90d3.1209102963@thinkpadL>

On Friday 25 April 2008 00:56:03 Jerone Young wrote:
> 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/emulate.c b/arch/powerpc/kvm/emulate.c
> --- a/arch/powerpc/kvm/emulate.c
> +++ b/arch/powerpc/kvm/emulate.c
> @@ -265,6 +265,11 @@ int kvmppc_emulate_instruction(struct kv
>  		case 146:                                       /* mtmsr */
>  			rs = get_rs(inst);
>  			kvmppc_set_msr(vcpu, vcpu->arch.gpr[rs]);
> +			
> +			/* handle guest vcpu that is in wait state */
> +			if (vcpu->arch.msr & MSR_WE) {
> +				kvm_vcpu_block(vcpu);
> +			}
>  			break;
> 
>  		case 163:                                       /* wrteei */

So if I apply this patch and not #3, the guest will put itself to sleep and 
never wake up? You need to combine patches 2 and 3.

Also, for completeness, you should add the same test to the rfi emulation, 
which could (theoretically) also set MSR[WE].

-- 
Hollis Blanchard
IBM Linux Technology Center

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

  reply	other threads:[~2008-04-25 13:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-25  5:56 [PATCH 0 of 3] Fix guest eating 100% cpu when guest is idle on PowerPC Jerone Young
2008-04-25  5:56 ` [PATCH 1 of 3] Add idle wait support for 44x platforms Jerone Young
2008-04-25  5:56 ` [PATCH 2 of 3] Add PowerPC KVM guest wait handling support Jerone Young
2008-04-25 13:56   ` Hollis Blanchard [this message]
2008-04-25  5:56 ` [PATCH 3 of 3] Add premption handlers & properly wake sleeping guest Jerone Young
2008-04-25 13:52   ` [kvm-ppc-devel] " Hollis Blanchard
2008-04-25 14:00 ` [kvm-ppc-devel] [PATCH 0 of 3] Fix guest eating 100% cpu when guest is idle on PowerPC Hollis Blanchard
2008-04-25 16:34   ` 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=200804250856.04031.hollisb@us.ibm.com \
    --to=hollisb@us.ibm.com \
    --cc=jyoung5@us.ibm.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=kvm-ppc-devel@lists.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox