From patchwork Thu May 13 14:16:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 52486 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 B25F1B7E2D for ; Fri, 14 May 2010 00:22:16 +1000 (EST) Received: from localhost ([127.0.0.1]:33921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCZIh-0007Vg-4p for incoming@patchwork.ozlabs.org; Thu, 13 May 2010 10:22:11 -0400 Received: from [140.186.70.92] (port=48767 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OCZDh-0004is-BA for qemu-devel@nongnu.org; Thu, 13 May 2010 10:17:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OCZDb-0005X6-4Q for qemu-devel@nongnu.org; Thu, 13 May 2010 10:17:01 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:59223) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OCZDa-0005W4-OI for qemu-devel@nongnu.org; Thu, 13 May 2010 10:16:55 -0400 Received: from smtp06.web.de ( [172.20.5.172]) by fmmailgate02.web.de (Postfix) with ESMTP id CC4FC1608D32C; Thu, 13 May 2010 16:16:53 +0200 (CEST) Received: from [88.64.22.236] (helo=localhost.localdomain) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1OCZDZ-0005eQ-03; Thu, 13 May 2010 16:16:53 +0200 From: Jan Kiszka To: qemu-devel@nongnu.org Date: Thu, 13 May 2010 16:16:47 +0200 Message-Id: <02a76f27b38bc9ecfd00b8a3d2c5920cbb7495e5.1273760202.git.jan.kiszka@web.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX1+R+xvaRcwgCM8cje5bFragLOWGZ3yKHz4CvftI PqboxAKrWsQ/GQrgAi4eyJlfWMyvxmlr/DXwHTeXe8vzJkJh9f cVz5ewvSY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Michael Walle Subject: [Qemu-devel] [PATCH 3/4] cfi: Mark flash memory executable 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 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 --- 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)