Received: from [140.186.70.92] (port=59108 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ou2m4-0006AP-VM for qemu-devel@nongnu.org; Fri, 10 Sep 2010 08:32:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ou2m2-0003jJ-Mx for qemu-devel@nongnu.org; Fri, 10 Sep 2010 08:32:12 -0400 Received: from zimbra3.corp.accelance.fr ([213.162.49.233]:33482) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ou2m2-0003iI-HX for qemu-devel@nongnu.org; Fri, 10 Sep 2010 08:32:10 -0400 From: Thomas Monjalon Date: Fri, 10 Sep 2010 14:32:05 +0200 References: <20100721085316.10710.28700.malonedeb@soybean.canonical.com> <20100721085317.10710.79353.malone@soybean.canonical.com> In-Reply-To: <20100721085317.10710.79353.malone@soybean.canonical.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201009101432.06340.thomas.monjalon@openwide.fr> Subject: [Qemu-devel] [PATCH] target-ppc: clear MSR_POW on interrupt List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Bug 608107 <608107@bugs.launchpad.net> From: till <608107@bugs.launchpad.net> According to FreeScale's 'Programming Environments Manual for 32-bit Implementations of the PowerPC Architecture' [MPCFPE32B, Rev.3, 9/2005], section 6.5, table 6-7, an interrupt resets MSR_POW to zero but qemu-0.12.4 fails to do so. Resetting the bit is necessary in order to bring the processor out of power management since otherwise it goes to sleep right away in the exception handler, i.e., it is impossible to leave PM-mode. https://bugs.launchpad.net/qemu/+bug/608107 Signed-off-by: till <608107@bugs.launchpad.net> Acked-by: Thomas Monjalon --- target-ppc/helper.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/target-ppc/helper.c b/target-ppc/helper.c index f66fb30..0bb353e 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -2578,6 +2578,7 @@ static inline void powerpc_excp(CPUState *env, int excp_model, int excp) if (new_msr & ((1 << MSR_IR) | (1 << MSR_DR))) tlb_flush(env, 1); /* reload MSR with correct bits */ + new_msr &= ~((target_ulong)1 << MSR_POW); new_msr &= ~((target_ulong)1 << MSR_EE); new_msr &= ~((target_ulong)1 << MSR_PR); new_msr &= ~((target_ulong)1 << MSR_FP);