qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: KONRAD Frederic <frederic.konrad@adacore.com>
To: qemu-devel@nongnu.org
Cc: rth@twiddle.net, mark.cave-ayland@ilande.co.uk,
	KONRAD Frederic <frederic.konrad@adacore.com>
Subject: [Qemu-devel] [RFC PATCH] sparc: fix leon3 casa instruction when MMU is disabled
Date: Thu,  1 Mar 2018 15:22:53 +0100	[thread overview]
Message-ID: <1519914173-31868-1-git-send-email-frederic.konrad@adacore.com> (raw)

Since the commit af7a06bac7d3abb2da48ef3277d2a415772d2ae8:
`casa [..](10), .., ..` triggers a data access exception when the MMU
is disabled.

This fixes this wrong behavior.

Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
---

Notes:
    There is an other way to do that: emiting the instruction with a
    MMU_PHYS_IDX when the MMU is disabled. I can switch to that if it's a
    prefered method.

 target/sparc/mmu_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c
index f8886ae..3cebf50 100644
--- a/target/sparc/mmu_helper.c
+++ b/target/sparc/mmu_helper.c
@@ -100,7 +100,7 @@ static int get_physical_address(CPUSPARCState *env, hwaddr *physical,
 
     is_user = mmu_idx == MMU_USER_IDX;
 
-    if (mmu_idx == MMU_PHYS_IDX) {
+    if ((mmu_idx == MMU_PHYS_IDX) || ((env->mmuregs[0] & MMU_E) == 0)) {
         *page_size = TARGET_PAGE_SIZE;
         /* Boot mode: instruction fetches are taken from PROM */
         if (rw == 2 && (env->mmuregs[0] & env->def.mmu_bm)) {
-- 
1.8.3.1

             reply	other threads:[~2018-03-01 14:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 14:22 KONRAD Frederic [this message]
2018-03-01 16:10 ` [Qemu-devel] [RFC PATCH] sparc: fix leon3 casa instruction when MMU is disabled Richard Henderson

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=1519914173-31868-1-git-send-email-frederic.konrad@adacore.com \
    --to=frederic.konrad@adacore.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).