From: Jerone Young Date: Fri, 28 Mar 2008 21:34:06 +0000 Subject: [kvm-ppc-devel] [PATCH 1 of 2] Add MSR Wait state to cpu_idle loop Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org # HG changeset patch # User Jerone Young # 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 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 #include #include + +static unsigned long msr_save; #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(); ------------------------------------------------------------------------- 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