From patchwork Mon Jan 11 14:49:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 42629 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 7F286B7BF4 for ; Tue, 12 Jan 2010 02:30:43 +1100 (EST) Received: from localhost ([127.0.0.1]:58960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUME4-0000XX-5G for incoming@patchwork.ozlabs.org; Mon, 11 Jan 2010 10:30:40 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NUMAu-0007qh-PI for qemu-devel@nongnu.org; Mon, 11 Jan 2010 10:27:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NUMAp-0007nS-Bj for qemu-devel@nongnu.org; Mon, 11 Jan 2010 10:27:23 -0500 Received: from [199.232.76.173] (port=50727 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NUMAo-0007nJ-TS for qemu-devel@nongnu.org; Mon, 11 Jan 2010 10:27:18 -0500 Received: from mx20.gnu.org ([199.232.41.8]:10798) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NUMAn-0006RH-Ao for qemu-devel@nongnu.org; Mon, 11 Jan 2010 10:27:17 -0500 Received: from miranda.se.axis.com ([193.13.178.8]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NULfw-0006Ym-DY for qemu-devel@nongnu.org; Mon, 11 Jan 2010 09:55:25 -0500 Received: from edde (edgar.se.axis.com [10.93.151.1]) by miranda.se.axis.com (8.13.4/8.13.4/Debian-3sarge3) with SMTP id o0BEt734022026; Mon, 11 Jan 2010 15:55:07 +0100 Received: by edde (sSMTP sendmail emulation); Mon, 11 Jan 2010 15:49:56 +0100 From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Mon, 11 Jan 2010 15:49:49 +0100 Message-Id: <1263221391-3642-3-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.6.4.4 In-Reply-To: <1263221391-3642-2-git-send-email-edgar.iglesias@gmail.com> References: <1263221391-3642-1-git-send-email-edgar.iglesias@gmail.com> <1263221391-3642-2-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: "Edgar E. Iglesias" Subject: [Qemu-devel] [PATCH 2/4] ppc-40x: Correct check for Endian swapping TLB entries. 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 Bailout on 40x TLB entries with endianess swapping only if the entry is valid. Signed-off-by: Edgar E. Iglesias --- target-ppc/op_helper.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 3575b29..f905c64 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -3981,13 +3981,15 @@ void helper_4xx_tlbwe_hi (target_ulong entry, target_ulong val) tlb->size, TARGET_PAGE_SIZE, (int)((val >> 7) & 0x7)); } tlb->EPN = val & ~(tlb->size - 1); - if (val & 0x40) + if (val & 0x40) { tlb->prot |= PAGE_VALID; - else + if (val & 0x20) { + /* XXX: TO BE FIXED */ + cpu_abort(env, + "Little-endian TLB entries are not supported by now\n"); + } + } else { tlb->prot &= ~PAGE_VALID; - if (val & 0x20) { - /* XXX: TO BE FIXED */ - cpu_abort(env, "Little-endian TLB entries are not supported by now\n"); } tlb->PID = env->spr[SPR_40x_PID]; /* PID */ LOG_SWTLB("%s: set up TLB %d RPN " TARGET_FMT_plx " EPN " TARGET_FMT_lx