From patchwork Fri Jul 22 15:18:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 9243791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8D3CD60757 for ; Fri, 22 Jul 2016 15:18:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FCBF27C0B for ; Fri, 22 Jul 2016 15:18:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7498027FA5; Fri, 22 Jul 2016 15:18:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B8D6927C0B for ; Fri, 22 Jul 2016 15:18:54 +0000 (UTC) Received: from localhost ([::1]:47916 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQcE1-0007b6-Er for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Jul 2016 11:18:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQcDe-0007b0-KO for qemu-devel@nongnu.org; Fri, 22 Jul 2016 11:18:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQcDZ-0000Vb-IU for qemu-devel@nongnu.org; Fri, 22 Jul 2016 11:18:30 -0400 Received: from ssl.serverraum.org ([213.133.101.245]:33953) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQcDZ-0000UZ-8G; Fri, 22 Jul 2016 11:18:25 -0400 Received: from mwalle01.kse.adk.loc (unknown [194.25.174.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id AB66A22361; Fri, 22 Jul 2016 17:18:19 +0200 (CEST) Authentication-Results: ssl.serverraum.org; dmarc=none header.from=walle.cc DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1469200700; bh=y3hHKJ3Xw8/9sEk2o4/IzuqKA/qRFvJ5o2PNLJhfYgo=; h=From:To:Cc:Subject:Date:From; b=AysMaGyumwczcI/l/WOzOzSK/crIe0qMj38Nqluej38tcnBUtqWVTn1PTCiRO20vI M06HHrIdno8jsz4pcnWScRUR0eaLQfkc5txr3vDytgYHtG6YUpzCmkk3LK5wqWNKV2 3q01xx+lTgyfLTG0vFxtCIhjuRz/ladQ55wm+1TQ= From: Michael Walle To: Riku Voipio Date: Fri, 22 Jul 2016 17:18:05 +0200 Message-Id: <1469200685-13695-1-git-send-email-michael@walle.cc> X-Mailer: git-send-email 2.1.4 X-Virus-Scanned: clamav-milter 0.99.2 at web X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 213.133.101.245 Subject: [Qemu-devel] [PATCH] linux-user: ppc64: set MSR_CM bit for BookE 2.06 MMU 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: Michael Walle , qemu-ppc@nongnu.org, Alexander Graf , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 64 bit user mode doesn't work for the e5500 core because the MSR_CM bit is not set which enables the 64 bit mode for this MMU model. Memory addresses are truncated to 32 bit, which results in "Invalid data memory access" error messages. Fix it by setting the MSR_CM bit for this MMU model. Signed-off-by: Michael Walle Reviewed-by: Alexander Graf --- This is a kind of a v2 patch. The did the fix in the wrong place: http://lists.nongnu.org/archive/html/qemu-devel/2016-07/msg05409.html linux-user/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 462e820..bac2cb0 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -4626,10 +4626,11 @@ int main(int argc, char **argv, char **envp) int i; #if defined(TARGET_PPC64) + int flag = (env->insns_flags2 & PPC2_BOOKE206) ? MSR_CM : MSR_SF; #if defined(TARGET_ABI32) - env->msr &= ~((target_ulong)1 << MSR_SF); + env->msr &= ~((target_ulong)1 << flag); #else - env->msr |= (target_ulong)1 << MSR_SF; + env->msr |= (target_ulong)1 << flag; #endif #endif env->nip = regs->nip;