qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Fedorov <serge.fdrv@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2 2/2] target-arm: Fix CPU breakpoint handling
Date: Fri, 9 Oct 2015 18:55:06 +0300	[thread overview]
Message-ID: <5617E35A.2030800@gmail.com> (raw)
In-Reply-To: <CAFEAcA8cNhPaW3vm+bU9RcXzMqW43JaGRj3O1VZtwA2mmBZhcQ@mail.gmail.com>

On 09.10.2015 17:04, Peter Maydell wrote:
> On 9 October 2015 at 14:59, Sergey Fedorov <serge.fdrv@gmail.com> wrote:
>> On 08.10.2015 21:40, Peter Maydell wrote:
>>> Annoying corner case which I don't think we need to handle necessarily:
>>> if you set a breakpoint on a 32-bit Thumb instruction which spans a page
>>> boundary, and the second page is not present, we will end up taking the
>>> page fault when I think we should take the breakpoint. I can't think
>>> of a way to get that right, so just commenting that it isn't handled
>>> right would do.
>> Could you please point out the piece of code which will generate the
>> page fault? Maybe I will give it a thought :)
> When you call arm_ldl_code() and friends, they will end up longjmp()ing
> out of the codegen phase if the load faults. This then turns into a
> guest-visible fault in the usual way.
>
> To avoid this you'd need to instead call functions which return
> a transaction status, but then:
>  (a) you need to restructure the translate.c code so it can
>  deal with the idea of backing out if the instruction isn't
>  actually present
>  (b) this still wouldn't work for linux-user mode, where we
>  don't have any way to say "do a memory access, but let me know
>  if it would fail rather than longjmping"

Thank you for the explanation, Peter. I see, if we do insn translation
then we take the page fault instead of the CPU breakpoint. As of user
mode, can we actually set any CPU breakpoint? If not, as I guess, then
(b) is not applicable to the possible solution that you have described.

Best regards,
Sergey

  reply	other threads:[~2015-10-09 15:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-28 10:07 [Qemu-devel] [PATCH v2 0/2] target-arm: Fix breakpoint handling Sergey Fedorov
2015-09-28 10:07 ` [Qemu-devel] [PATCH v2 1/2] target-arm: Fix GDB " Sergey Fedorov
2015-10-08 18:20   ` Peter Maydell
2015-09-28 10:07 ` [Qemu-devel] [PATCH v2 2/2] target-arm: Fix CPU " Sergey Fedorov
2015-10-08 18:40   ` Peter Maydell
2015-10-09 13:53     ` Sergey Fedorov
2015-10-09 14:00       ` Peter Maydell
2015-10-09 14:03         ` Sergey Fedorov
2015-10-09 13:59     ` Sergey Fedorov
2015-10-09 14:04       ` Peter Maydell
2015-10-09 15:55         ` Sergey Fedorov [this message]
2015-10-09 15:59           ` Peter Maydell
2015-10-09 16:31         ` Sergey Fedorov
2015-10-12 12:41     ` Sergey Fedorov
2015-10-12 13:22       ` 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=5617E35A.2030800@gmail.com \
    --to=serge.fdrv@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).