From patchwork Fri Sep 10 12:32:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 64387 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 671A4B70ED for ; Fri, 10 Sep 2010 22:32:51 +1000 (EST) Received: from localhost ([127.0.0.1]:59330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ou2me-0006B5-7w for incoming@patchwork.ozlabs.org; Fri, 10 Sep 2010 08:32:48 -0400 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 Received: from localhost (localhost [127.0.0.1]) by zimbra3.corp.accelance.fr (Postfix) with ESMTP id C2EC6374C1; Fri, 10 Sep 2010 14:32:07 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra3.corp.accelance.fr Received: from zimbra3.corp.accelance.fr ([127.0.0.1]) by localhost (zimbra3.corp.accelance.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BZQTY96BokOf; Fri, 10 Sep 2010 14:32:06 +0200 (CEST) Received: from tmonjalo-laptop.localnet (LPuteaux-156-15-47-90.w82-127.abo.wanadoo.fr [82.127.74.90]) by zimbra3.corp.accelance.fr (Postfix) with ESMTPSA id BC14D373FE; Fri, 10 Sep 2010 14:32:06 +0200 (CEST) From: Thomas Monjalon Organization: Open Wide To: qemu-devel@nongnu.org Date: Fri, 10 Sep 2010 14:32:05 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.35-ARCH; KDE/4.5.1; i686; ; ) 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 Message-Id: <201009101432.06340.thomas.monjalon@openwide.fr> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Bug 608107 <608107@bugs.launchpad.net> Subject: [Qemu-devel] [PATCH] target-ppc: clear MSR_POW on interrupt X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);