From: Richard Henderson <rth@twiddle.net>
To: Emmanuel Blot <eblot.ml@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Single stepping & GDB on ARM
Date: Tue, 17 Sep 2013 09:15:16 -0700 [thread overview]
Message-ID: <52388014.2090401@twiddle.net> (raw)
In-Reply-To: <CAKJJEPw0Vons4fYpAhHNszxiFVys_9xgkrOjGeP6wBJnKJFjFA@mail.gmail.com>
On 09/17/2013 03:02 AM, Emmanuel Blot wrote:
> There is a piece of code I'm not sure to understand, in
> get_page_addr_code(CPUArchState *env1, target_ulong addr)
>
> …
> if (unlikely(env1->tlb_table[mmu_idx][page_index].addr_code !=
> (addr & TARGET_PAGE_MASK))) {
> cpu_ldub_code(env1, addr);
> }
> pd = env1->iotlb[mmu_idx][page_index] & ~TARGET_PAGE_MASK;
> mr = iotlb_to_region(pd);
> if (memory_region_is_unassigned(mr))
> …
>
> cpu_ldub_code() leads to call io_mem_read() which may trigger a
> unassigned_mem_read().
> In this case, the invalid mem access is always considered as a data
> access, whereas it is an execution access if I'm not mistaken.
>
> In other words, before
> get_page_addr_code:memory_region_is_unassigned() is tested and
> get_page_addr_code:do_unassigned_access() gets a "chance" to be called
> as an "instruction" invalid access, another unsigned access is
> triggered with a "data" invalid access.
>
> Did I miss something here?
No miss. That cpu_ldub_code ought to be just a straight tlb fill,
rather than a read with discarded result. E.g. the
tlb_fill(env, addr, READ_ACCESS_TYPE, mmu_idx, retaddr);
line from exec/softmmu_template.h.
r~
prev parent reply other threads:[~2013-09-17 16:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-17 8:47 [Qemu-devel] Single stepping & GDB on ARM Emmanuel Blot
2013-09-17 8:51 ` Peter Maydell
2013-09-17 10:02 ` Emmanuel Blot
2013-09-17 16:15 ` Richard Henderson [this message]
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=52388014.2090401@twiddle.net \
--to=rth@twiddle.net \
--cc=eblot.ml@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).