From: Richard Henderson <rth@twiddle.net>
To: Sergey Fedorov <serge.fdrv@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] target-*: Advance pc after recognizing a breakpoint
Date: Mon, 19 Oct 2015 07:04:45 -1000 [thread overview]
Message-ID: <562522AD.4050101@twiddle.net> (raw)
In-Reply-To: <5624CE3A.3000505@gmail.com>
On 10/19/2015 01:04 AM, Sergey Fedorov wrote:
> On 19.10.2015 01:46, Richard Henderson wrote:
>> On 10/16/2015 04:08 AM, Sergey Fedorov wrote:
>>> On 16.10.2015 04:14, Richard Henderson wrote:
>>>> On 10/16/2015 03:36 AM, Peter Maydell wrote:
>>>>> On 14 October 2015 at 22:02, Richard Henderson <rth@twiddle.net>
>>>>> wrote:
>>>>>> On 10/15/2015 06:34 AM, Peter Maydell wrote:
>>>>>>>
>>>>>>> This is still the same cryptic comment we have in the
>>>>>>> targets which do do this. Can we have something
>>>>>>> that is a bit more explanatory about what is going on and
>>>>>>> why we need to do this, please?
>>>>>>
>>>>>>
>>>>>> Suggestions?
>>>>>
>>>>> ...well, I don't entirely understand the problem it's
>>>>> fixing, which is why I'm asking for a better comment :-)
>>>>
>>>> Heh. Fair enough. How about
>>>>
>>>> /* The address covered by the breakpoint must be included in
>>>> [tb->pc, tb->pc + tb->size) in order to for it to be
>>>> properly cleared -- thus we increment the PC here so that
>>>> the logic setting tb->size below does the right thing. */
>>>>
>>>> There are two edge cases that cause the problem with clearing that
>>>> could be described, but I think that the comment becomes too bulky, as
>>>> well as confuses the situation for someone cutting-and-pasting the
>>>> logic to a new port.
>>>
>>> Maybe we could rather fix that condition in
>>> tb_invalidate_phys_page_range()? It seems weird that it can't handle a
>>> zero-sized TB.
>>
>> We also need to be able to handle a TB which crosses a page. E.g. the
>> breakpoint is at the page boundary, and we fall through into it from
>> the top. This will be true on e.g. x86. This is not simply true for
>> breakpoint insertion/removal, but also page invalidation.
>>
>> The same fix, adding a byte to the size, handles this as well.
>
> It's clear except that instructions crossing a page boundary can be
> different in size. AFAIK, x86 instructions can be up to 15-byte long.
> What if only the very last byte of instruction crosses a page boundary?
Then only the last byte crosses? What's your point?
r~
next prev parent reply other threads:[~2015-10-19 17:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 22:10 [Qemu-devel] [PATCH] target-*: Advance pc after recognizing a breakpoint Richard Henderson
2015-10-14 9:04 ` Sergey Fedorov
2015-10-14 19:34 ` Peter Maydell
2015-10-14 21:02 ` Richard Henderson
2015-10-15 16:36 ` Peter Maydell
2015-10-16 1:14 ` Richard Henderson
2015-10-16 7:33 ` Peter Maydell
2015-10-16 14:08 ` Sergey Fedorov
2015-10-16 16:36 ` Sergey Fedorov
2015-10-16 18:03 ` Sergey Fedorov
2015-10-18 22:46 ` Richard Henderson
2015-10-19 11:04 ` Sergey Fedorov
2015-10-19 17:04 ` Richard Henderson [this message]
2015-10-19 17:26 ` Sergey Fedorov
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=562522AD.4050101@twiddle.net \
--to=rth@twiddle.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=serge.fdrv@gmail.com \
/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).