Patchwork memory: Fix memory_region_get_ram_ptr for ROM devices

login
register
mail settings
Submitter Jan Kiszka
Date Aug. 29, 2011, 10:38 p.m.
Message ID <4E5C14E0.9060800@web.de>
Download mbox | patch
Permalink /patch/112163/
State New
Headers show

Comments

Jan Kiszka - Aug. 29, 2011, 10:38 p.m.
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 <jan.kiszka@siemens.com>

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 <jan.kiszka@siemens.com>
---
 memory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Avi Kivity - Aug. 30, 2011, 8:21 a.m.
On 08/30/2011 01:38 AM, Jan Kiszka wrote:
> 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... :)

I'm willing to hate rom_device equally.  There's enough to go round.

> ---8<---
>
> From: Jan Kiszka<jan.kiszka@siemens.com>
>
> Mask out the sub-page bits that are used by ROM device for storing the
> io-index and the IO_MEM_ROMD flag.

Applied; thanks for the help.  With this, everything works, yes?
Jan Kiszka - Aug. 30, 2011, 11:26 a.m.
On 2011-08-30 10:21, Avi Kivity wrote:
> On 08/30/2011 01:38 AM, Jan Kiszka wrote:
>> 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... :)
> 
> I'm willing to hate rom_device equally.  There's enough to go round.
> 
>> ---8<---
>>
>> From: Jan Kiszka<jan.kiszka@siemens.com>
>>
>> Mask out the sub-page bits that are used by ROM device for storing the
>> io-index and the IO_MEM_ROMD flag.
> 
> Applied; thanks for the help.  With this, everything works, yes?

Yes, at least for me.

Jan

Patch

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)