From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyATW-0003lY-Ix for qemu-devel@nongnu.org; Mon, 29 Aug 2011 18:38:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QyATU-0001CK-Rc for qemu-devel@nongnu.org; Mon, 29 Aug 2011 18:38:38 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:34486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QyATU-0001Bl-LB for qemu-devel@nongnu.org; Mon, 29 Aug 2011 18:38:36 -0400 Message-ID: <4E5C14E0.9060800@web.de> Date: Tue, 30 Aug 2011 00:38:24 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4E5BB170.90305@redhat.com> <4E5BBB8A.50104@siemens.com> <4E5BBCCB.2020508@siemens.com> <4E5BE527.2010601@codemonkey.ws> <4E5C0161.6020209@redhat.com> In-Reply-To: <4E5C0161.6020209@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH] memory: Fix memory_region_get_ram_ptr for ROM devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: "qemu-devel@nongnu.org" On 2011-08-29 23:15, Avi Kivity wrote: > On 08/29/2011 10:14 PM, Anthony Liguori wrote: >>> OK, that was simple: It's still "pflash_cfi01/pflash_cfi02: convert to >>> memory API". >> >> >> Hrm, okay. Avi, maybe drop that patch and submit a v3? >> > > Of course. I'm sta^Wcontinuing to hate that pflash thing. It's not always the pflash... :) ---8<--- From: Jan Kiszka Mask out the sub-page bits that are used by ROM device for storing the io-index and the IO_MEM_ROMD flag. Signed-off-by: Jan Kiszka --- memory.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/memory.c b/memory.c index eb31fa8..57f0fa4 100644 --- a/memory.c +++ b/memory.c @@ -1063,7 +1063,7 @@ void *memory_region_get_ram_ptr(MemoryRegion *mr) assert(mr->terminates); - return qemu_get_ram_ptr(mr->ram_addr); + return qemu_get_ram_ptr(mr->ram_addr & TARGET_PAGE_MASK); } static void memory_region_update_coalesced_range(MemoryRegion *mr) -- 1.7.3.4