qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Avi Kivity <avi@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] exec.c: Fix subpage memory access to RAM MemoryRegion
Date: Tue, 29 Nov 2011 17:19:10 +0100	[thread overview]
Message-ID: <4ED505FE.2090808@suse.de> (raw)
In-Reply-To: <4ED4E56C.9090507@redhat.com>

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)

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2011-11-29 16:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-28 15:06 [Qemu-devel] [PATCH] exec.c: Fix subpage memory access to RAM MemoryRegion Andreas Färber
2011-11-28 17:17 ` Avi Kivity
2011-11-28 22:39   ` Andreas Färber
2011-11-29  9:52     ` Avi Kivity
2011-11-30 15:34       ` Andreas Färber
2011-11-29 12:47 ` Andreas Färber
2011-11-29 14:00   ` Avi Kivity
2011-11-29 16:19     ` Andreas Färber [this message]
2011-11-29 16:46       ` Avi Kivity
2011-11-30 16:22         ` Andreas Färber
2011-12-01  9:24           ` Avi Kivity

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=4ED505FE.2090808@suse.de \
    --to=afaerber@suse.de \
    --cc=avi@redhat.com \
    --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).