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 <[EMAIL PROTECTED]>
> 
> 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
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to