qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: [Qemu-devel] [PATCH 2/4] ppc-40x: Correct check for Endian swapping TLB entries.
Date: Mon, 11 Jan 2010 15:49:49 +0100	[thread overview]
Message-ID: <1263221391-3642-3-git-send-email-edgar.iglesias@gmail.com> (raw)
In-Reply-To: <1263221391-3642-2-git-send-email-edgar.iglesias@gmail.com>

Bailout on 40x TLB entries with endianess swapping only if the entry
is valid.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
---
 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
-- 
1.6.4.4

  reply	other threads:[~2010-01-11 15:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11 14:49 [Qemu-devel] [PATCH 0/4] PPC 40x MMU fixes Edgar E. Iglesias
2010-01-11 14:49 ` [Qemu-devel] [PATCH 1/4] ppc-40x: Get TLB attributes from TLBLO Edgar E. Iglesias
2010-01-11 14:49   ` Edgar E. Iglesias [this message]
2010-01-11 14:49     ` [Qemu-devel] [PATCH 3/4] ppc-40x: Correct decoding of zone protection bits Edgar E. Iglesias
2010-01-11 14:49       ` [Qemu-devel] [PATCH 4/4] ppc-40x: Correct ESR for zone protection faults Edgar E. Iglesias

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1263221391-3642-3-git-send-email-edgar.iglesias@gmail.com \
    --to=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).