[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Does the page boundary check still necessary?
From: |
Kenneth Lee |
Subject: |
Re: Does the page boundary check still necessary? |
Date: |
Thu, 16 Feb 2023 17:35:13 +0800 |
On Wed, Feb 15, 2023 at 04:52:24PM -1000, Richard Henderson wrote:
> Date: Wed, 15 Feb 2023 16:52:24 -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 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.
Thank you for the clarification. You are right. It is senseless to the
current guests. I just consider a guest with some hint to the main
sequence of the code. It jumps out of range constantely. Maybe I can
find other way to solve the problem.
Thanks again.
>
>
> r~
--
-Kenneth Lee (Hisilicon)