All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: kvm-ppc@vger.kernel.org
Subject: Re: [kvm-ppc-devel] [PATCH 1 of 2] Add MSR Wait state to
Date: Fri, 28 Mar 2008 21:43:05 +0000	[thread overview]
Message-ID: <1206740585.5432.29.camel@basalt> (raw)

On Fri, 2008-03-28 at 16:34 -0500, Jerone Young wrote:
> # HG changeset patch
> # User Jerone Young <jyoung5@us.ibm.com>
> # Date 1206720510 18000
> # Node ID e48cf2ad6c85c457ff64c04b83960fc305420842
> # Parent  1506aa38ddabb0bf73fff3ac3f3db5f9ef6458cc
> Add MSR Wait state to cpu_idle loop
> 
> This patch sets the wait state MSR when in the cpu_idle loop. This is
> mainly to help out virtualization solutions such as KVM. This way the
> virtualization soultion is able to tell if the guest kernel is idle.
> 
> Signed-off-by: Jerone Young <jyoung5@us.ibm.com>
> 
> diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
> --- a/arch/powerpc/kernel/idle.c
> +++ b/arch/powerpc/kernel/idle.c
> @@ -32,6 +32,8 @@
>  #include <asm/time.h>
>  #include <asm/machdep.h>
>  #include <asm/smp.h>
> +
> +static unsigned long msr_save;

Why is this global?

>  #ifdef CONFIG_HOTPLUG_CPU
>  /* this is used for software suspend, and that shuts down
> @@ -88,6 +90,10 @@ void cpu_idle(void)
>  				HMT_low();
>  				HMT_very_low();
>  			}
> +
> +			/* set wait state MSR */
> +			msr_save = mfmsr();
> +			mtmsr(msr_save|MSR_WE);
>  		}
> 
>  		HMT_medium();

The code you are modifying is common to all PowerPC kernels. Why didn't
you use the power_save() hook provided to you?

-- 
Hollis Blanchard
IBM Linux Technology Center


-------------------------------------------------------------------------
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

             reply	other threads:[~2008-03-28 21:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28 21:43 Hollis Blanchard [this message]
2008-03-28 21:55 ` [kvm-ppc-devel] [PATCH 1 of 2] Add MSR Wait state to Jerone Young
2008-03-28 22:16 ` 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=1206740585.5432.29.camel@basalt \
    --to=hollisb@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.