qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] exec.c: Fix subpage memory access to RAM Memory


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH] exec.c: Fix subpage memory access to RAM MemoryRegion
Date: Tue, 29 Nov 2011 18:46:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0

On 11/29/2011 06:19 PM, Andreas Färber wrote:
> Am 29.11.2011 15:00, schrieb Avi Kivity:
> > On 11/29/2011 02:47 PM, Andreas Färber wrote:
> >>>  
> >>>      addr += mmio->region_offset[idx];
> >>>      idx = mmio->sub_io_index[idx];
> >>> +    if (unlikely(idx == IO_MEM_RAM)) {
> >>> +        ram_addr_t raddr = /*mmio->base |*/ addr;
> >>> +        void *ptr = qemu_get_ram_ptr(raddr);
> >>
> >> ...and/or this seems to lead to "Bad RAM pointer" (or so) when there's
> >> ELF code loaded into the subpage at that address despite being IO_MEM_RAM?
> >> (Seen, e.g., if for RL78 I increase the page size from 12 to 16.)
> >>
> > 
> > addr is relative to the start of the page, instead of the start of the
> > region.  You can use mmio->region_offset[idx] to compensate.
>
> That's exactly what the first line of the snippet above does, no?
> (sorry, there's still a confusing comment from an earlier attempt)
>

Depends on whether ->region_offset has the right value or not, where's
the code that adjusts it?  For your case that does f00-fff it should be
-0xf00 + ram_addr (of the start of the region).

-- 
error compiling committee.c: too many arguments to function




reply via email to

[Prev in Thread] Current Thread [Next in Thread]