From patchwork Fri Jul 1 06:41:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 642836 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rgn4d4mLjz9sDG for ; Fri, 1 Jul 2016 16:46:25 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b=RlXlD3NZ; dkim-atps=neutral Received: from localhost ([::1]:53972 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIsDX-0003UA-Jv for incoming@patchwork.ozlabs.org; Fri, 01 Jul 2016 02:46:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIs7i-0003aw-KY for qemu-devel@nongnu.org; Fri, 01 Jul 2016 02:40:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIs7g-0003GX-Hg for qemu-devel@nongnu.org; Fri, 01 Jul 2016 02:40:21 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:39132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIs7g-0003FP-4Q; Fri, 01 Jul 2016 02:40:20 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3rgmxS0xPlz9t0Z; Fri, 1 Jul 2016 16:40:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1467355212; bh=BDFypJLCgLkDvE/rm8jNYV0oPqy6QKoZvzUAM+SDu30=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RlXlD3NZVwCGw+aPpg4F4FElTraVqlT4hkON4Bjhx2uyJZqfN1ZfzQCAF7GHmIjgi uK/FFk/VOWGzjOTHcInVokEaHcD72W6D+aCmILR0DVZIMapyaPp9aszdkUbueVogrw IhYc8hy815byUqT9NwC1ZLao9BXvhp305YZ+EdS8= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 1 Jul 2016 16:41:41 +1000 Message-Id: <1467355319-28406-6-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467355319-28406-1-git-send-email-david@gibson.dropbear.id.au> References: <1467355319-28406-1-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 05/23] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Benjamin Herrenschmidt The architecture specifies that any instruction that sets MSR:PR will also set MSR:EE, IR and DR. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Cédric Le Goater Signed-off-by: David Gibson --- target-ppc/helper_regs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h index 8fc0934..8fdfa5c 100644 --- a/target-ppc/helper_regs.h +++ b/target-ppc/helper_regs.h @@ -136,6 +136,10 @@ static inline int hreg_store_msr(CPUPPCState *env, target_ulong value, /* Change the exception prefix on PowerPC 601 */ env->excp_prefix = ((value >> MSR_EP) & 1) * 0xFFF00000; } + /* If PR=1 then EE, IR and DR must be 1 */ + if ((value >> MSR_PR) & 1) { + value |= (1 << MSR_EE) | (1 << MSR_DR) | (1 << MSR_IR); + } #endif env->msr = value; hreg_compute_hflags(env);