From patchwork Thu Sep 22 12:13:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9345199 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 1D35F607D0 for ; Thu, 22 Sep 2016 12:29:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 100482AA5D for ; Thu, 22 Sep 2016 12:29:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04FE62AA5F; Thu, 22 Sep 2016 12:29:29 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 C6A6E2AA5D for ; Thu, 22 Sep 2016 12:29:27 +0000 (UTC) Received: from localhost ([::1]:43090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn382-0004TV-PR for patchwork-qemu-devel@patchwork.kernel.org; Thu, 22 Sep 2016 08:29:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2uL-00006Y-JN for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn2uH-0006dG-Jc for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:17 -0400 Received: from mail-lf0-f54.google.com ([209.85.215.54]:33229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn2uH-0006cW-CJ for qemu-devel@nongnu.org; Thu, 22 Sep 2016 08:15:13 -0400 Received: by mail-lf0-f54.google.com with SMTP id b71so38935806lfg.0 for ; Thu, 22 Sep 2016 05:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=283CAlMjE06Qmtf2CiAnRbx97gMFVxkj32E9vRM1/sc=; b=fUvNyLc6bDW7TtoHAxO/sOEAvt9AoyBXw9FhjV6RLW3ksLjDatHziT2yLWPxRxip70 Rflv8m3NsrGZ4WZs09qfFkKXJabD96U+eyniFavOgblzV8sfJXLxtO4z0WYNQ2MGY4xx R2nejHSs4Pa3q1MX9jLBdHDdphOi3NsGVnvQQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=283CAlMjE06Qmtf2CiAnRbx97gMFVxkj32E9vRM1/sc=; b=NivSfbS7LOBX4htWn9hGEwNvFjp00FqWEXu9qz1gkpG0DQyBsBAi96ArUzlx5ngDNn 7MccNh07gQYs8jnulzuc/k6F4gdWrTABVwlizqgkoxRpWi/mDneL7mNncSeDIGDiXeN0 QKYm0d4Aq2XRAALqYae6tI7YWBlNSyOuBCmB6W9bsP+ow0O/qEhxgxBNFhriSpgXWurQ 2eREVIZvpjyJ3ueiF1ukjXz9+ynNiUNNtwRDbwuKkDNmcYcZhrI4itFZdowTfx3NcQd7 yz8rv/AcdfA7DlCQNojkCt2PwinG5LlZeqOIki3KsQ6LiOVtlMKqsdyrgSGIOBp5AYF0 /D1w== X-Gm-Message-State: AE9vXwMudQ+AluliUVU64rSOVgIgvmN76ZGSdRigR/LCHoBDfx0zRjUtTIgLf+g5YDgg1REG X-Received: by 10.25.15.206 with SMTP id 75mr709661lfp.62.1474546452316; Thu, 22 Sep 2016 05:14:12 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id u14sm294378lja.11.2016.09.22.05.14.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Sep 2016 05:14:10 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Thu, 22 Sep 2016 15:13:36 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.215.54 Subject: [Qemu-devel] [PULL 16/26] 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: Peter Maydell , Michael Walle Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Michael Walle 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 Signed-off-by: Riku Voipio --- 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 3ad70f8..2aeda8a 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -4615,10 +4615,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;