From: Richard Henderson <richard.henderson@linaro.org>
To: Kenneth Lee <Kenneth-Lee-2012@foxmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: Does the page boundary check still necessary?
Date: Wed, 15 Feb 2023 16:52:24 -1000	[thread overview]
Message-ID: <36dbc1bd-cf2d-ad74-8432-c9550e1a0aa4@linaro.org> (raw)
In-Reply-To: <tencent_242293DEBEFE0102C8F4654A993A7531D308@qq.com>
On 2/15/23 16:28, Kenneth Lee wrote:
> On Wed, Feb 15, 2023 at 04:26:18PM -1000, Richard Henderson wrote:
>> Date: Wed, 15 Feb 2023 16:26:18 -1000
>> From: Richard Henderson <richard.henderson@linaro.org>
>> To: Kenneth Lee <Kenneth-Lee-2012@foxmail.com>
>> Cc: qemu-devel@nongnu.org
>> Subject: Re: Does the page boundary check still necessary?
>> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
>>   Thunderbird/102.7.1
>>
>> On 2/15/23 15:45, Kenneth Lee wrote:
>>>>> Now the chained TBs have been link with tb_link_page(), the chain will
>>>>> be rebuilt if it is invalidate on page. So why is this check still there?
>>>>
>>>> Even for a guest which doesn't use paging, and therefore does not need to
>>>> worry about memory maps changing, we still enable breakpoints and
>>>> watchpoints on a per-page basis.
>>>>
>>>
>>> Thank you. So is this the only reason? May I write a fine grained
>>> checking to remove this limitation?
>>
>> No.
>>
> Why?
When breakpoints change, we discard all translations on the affected page, similarly to 
how we handle writes from self-modifying code.  If you link from further away, then TBs 
won't be invalidated properly when breakpoints change.  For most guests, this isn't a 
limitation because we also have to care for modifications to page tables, so we can't 
allow such links anyway.
I have no idea what you're trying to accomplish that's different from existing guests.
r~
next prev parent reply	other threads:[~2023-02-16  2:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15  8:39 Does the page boundary check still necessary? Kenneth Lee
2023-02-15 17:27 ` Richard Henderson
2023-02-16  1:45   ` Kenneth Lee
2023-02-16  2:26     ` Richard Henderson
2023-02-16  2:28       ` Kenneth Lee
2023-02-16  2:52         ` Richard Henderson [this message]
2023-02-16  9:35           ` Kenneth Lee
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=36dbc1bd-cf2d-ad74-8432-c9550e1a0aa4@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=Kenneth-Lee-2012@foxmail.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).