From: Max Filippov <jcmvbkbc@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] qemu-softmmu aborted with "Bad ram pointer"
Date: Fri, 6 Jan 2017 07:24:05 -0800 [thread overview]
Message-ID: <CAMo8BfJCa63pARSvbQKytpAUFpZdACALpT+xaQV4UOEOnavJgg@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA-mQPT=pSNTfLqrvuBNX9QYggiMwyoHitV1c5LCVZv-2Q@mail.gmail.com>
On Fri, Jan 6, 2017 at 2:23 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 5 January 2017 at 22:52, Max Filippov <jcmvbkbc@gmail.com> wrote:
>> Hello,
>>
>> debugging XIP kernel running directly from CFI FLASH I've got to a point
>> where QEMU aborts with the message "Bad ram pointer 0xbb4".
>>
>> It turns out that that happens when QEMU tries to translate code from FLASH
>> immediately after the kernel has written to the FLASH address range:
>> writing to FLASH address range turns off romd_mode of its memory region:
>
> This sounds like
> https://lists.nongnu.org/archive/html/qemu-devel/2016-08/msg03273.html
Right. Strange that I haven't found it...
> It's a bug that we fail with this unhelpful message and abort,
> but the fix to the bug would only cause us to print the more
> useful "can't execute from a device" instead. You can't
> execute from a ROM that's not in ROMD mode, I'm afraid.
Yes, aborting is my main concern.
Shouldn't we do something like the following?
diff --git a/exec.c b/exec.c
index 8d4bb0e..d3f1818 100644
--- a/exec.c
+++ b/exec.c
@@ -381,7 +381,8 @@ static MemoryRegionSection
*phys_page_find(PhysPageEntry lp, hwaddr addr,
bool memory_region_is_unassigned(MemoryRegion *mr)
{
- return mr != &io_mem_rom && mr != &io_mem_notdirty && !mr->rom_device
+ return mr != &io_mem_rom && mr != &io_mem_notdirty
+ && !(mr->rom_device && mr->romd_mode)
&& mr != &io_mem_watch;
}
--
Thanks.
-- Max
next prev parent reply other threads:[~2017-01-06 15:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 22:52 [Qemu-devel] qemu-softmmu aborted with "Bad ram pointer" Max Filippov
2017-01-06 10:23 ` Peter Maydell
2017-01-06 15:24 ` Max Filippov [this message]
2017-01-06 16:15 ` Peter Maydell
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=CAMo8BfJCa63pARSvbQKytpAUFpZdACALpT+xaQV4UOEOnavJgg@mail.gmail.com \
--to=jcmvbkbc@gmail.com \
--cc=peter.maydell@linaro.org \
--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).