qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: qemu-devel@nongnu.org
Cc: Michael Walle <michael@walle.cc>
Subject: [Qemu-devel] [PATCH 3/4] cfi: Mark flash memory executable
Date: Thu, 13 May 2010 16:16:47 +0200	[thread overview]
Message-ID: <02a76f27b38bc9ecfd00b8a3d2c5920cbb7495e5.1273760202.git.jan.kiszka@web.de> (raw)
In-Reply-To: <cover.1273760202.git.jan.kiszka@web.de>
In-Reply-To: <cover.1273760202.git.jan.kiszka@web.de>

Add the new IO_MEM_EXEC flag to all cfi01/02 memory regions to allow
execution from them in any state.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
---
 hw/pflash_cfi01.c |    9 +++++----
 hw/pflash_cfi02.c |    2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
index 20fe93d..50f6598 100644
--- a/hw/pflash_cfi01.c
+++ b/hw/pflash_cfi01.c
@@ -90,7 +90,7 @@ static void pflash_timer (void *opaque)
         pfl->wcycle = 2;
     } else {
         cpu_register_physical_memory(pfl->base, pfl->total_len,
-                        pfl->off | IO_MEM_ROMD | pfl->fl_mem);
+                        pfl->off | IO_MEM_ROMD | IO_MEM_EXEC | pfl->fl_mem);
         pfl->wcycle = 0;
     }
     pfl->cmd = 0;
@@ -247,7 +247,8 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
 
     if (!pfl->wcycle) {
         /* Set the device in I/O access mode */
-        cpu_register_physical_memory(pfl->base, pfl->total_len, pfl->fl_mem);
+        cpu_register_physical_memory(pfl->base, pfl->total_len,
+                                     pfl->fl_mem | IO_MEM_EXEC);
     }
 
     switch (pfl->wcycle) {
@@ -403,7 +404,7 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
 
  reset_flash:
     cpu_register_physical_memory(pfl->base, pfl->total_len,
-                    pfl->off | IO_MEM_ROMD | pfl->fl_mem);
+                    pfl->off | IO_MEM_ROMD | IO_MEM_EXEC | pfl->fl_mem);
 
     pfl->bypass = 0;
     pfl->wcycle = 0;
@@ -587,7 +588,7 @@ pflash_t *pflash_cfi01_register(target_phys_addr_t base, ram_addr_t off,
     }
     pfl->off = off;
     cpu_register_physical_memory(base, total_len,
-                    off | pfl->fl_mem | IO_MEM_ROMD);
+                    off | pfl->fl_mem | IO_MEM_ROMD | IO_MEM_EXEC);
 
     pfl->bs = bs;
     if (pfl->bs) {
diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c
index 8195d91..6bc58b4 100644
--- a/hw/pflash_cfi02.c
+++ b/hw/pflash_cfi02.c
@@ -75,7 +75,7 @@ struct pflash_t {
 
 static void pflash_register_memory(pflash_t *pfl, int rom_mode)
 {
-    unsigned long phys_offset = pfl->fl_mem;
+    unsigned long phys_offset = pfl->fl_mem | IO_MEM_EXEC;
     int i;
 
     if (rom_mode)
-- 
1.6.0.2

  parent reply	other threads:[~2010-05-13 14:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-13 14:16 [Qemu-devel] [PATCH 0/4] Fix the lazy CFI mode switch Jan Kiszka
2010-05-13 14:16 ` [Qemu-devel] [PATCH 1/4] cfi02: Fix a debug print Jan Kiszka
2010-05-13 14:16 ` [Qemu-devel] [PATCH 2/4] Add support for execution from ROMs in IO device mode Jan Kiszka
2010-05-13 19:23   ` Jamie Lokier
2010-05-13 20:10     ` Jan Kiszka
2010-05-13 20:24       ` Jan Kiszka
2010-05-13 14:16 ` Jan Kiszka [this message]
2010-05-13 14:16 ` [Qemu-devel] [PATCH 4/4] cfi02: Use timer-based ROM mode switch Jan Kiszka

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=02a76f27b38bc9ecfd00b8a3d2c5920cbb7495e5.1273760202.git.jan.kiszka@web.de \
    --to=jan.kiszka@web.de \
    --cc=michael@walle.cc \
    --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).