Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Qi Zheng <qi.zheng@linux.dev>,
	akpm@linux-foundation.org, catalin.marinas@arm.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, muchun.song@linux.dev,
	pasha.tatashin@soleen.com, wangkefeng.wang@huawei.co
Subject: Re: [PATCH] arm64: mm: use ptep_clear() instead of pte_clear() in clear_flush()
Date: Fri, 11 Aug 2023 12:21:07 +0100	[thread overview]
Message-ID: <20230811112107.GE6993@willie-the-truck> (raw)
In-Reply-To: <CAOgjDMi6kTZUjEianbO670RQxJ8=JhHxkeci9NspSCRT5rPhYw@mail.gmail.com>

On Fri, Aug 11, 2023 at 07:16:20PM +0800, Qi Zheng wrote:
>    Will Deacon <[1]will@kernel.org>于2023年8月11日 周五19:03写道:
> 
>      On Thu, Aug 10, 2023 at 09:32:41AM +0000, Qi Zheng wrote:
>      > From: Qi Zheng <[2]zhengqi.arch@bytedance.com>
>      >
>      > In clear_flush(), the original pte may be a present entry, so we
>      should
>      > use ptep_clear() to let page_table_check track the pte clearing
>      operation,
>      > otherwise it may cause false positive in subsequent set_pte_at().
> 
>      Isn't this true for most users of pte_clear()? There are some in the
>      core
>      code, so could they trigger the false positive as well?
> 
>    No, the PTE entry in other places where pte_clear() is used is non-present
>    PTE. 
>    The page_table_check does not does track the pte operation in this case,
>    so it will not cause false positives.

Are you sure? For example, the call from flush_all_zero_pkmaps() in
highmem.c really looks like it's clearing a valid entry. Not that arm64
cares about highmem, but still.

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-08-11 11:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10  9:32 [PATCH] arm64: mm: use ptep_clear() instead of pte_clear() in clear_flush() Qi Zheng
2023-08-11  2:38 ` Qi Zheng
2023-08-11 11:03 ` Will Deacon
     [not found]   ` <CAOgjDMi6kTZUjEianbO670RQxJ8=JhHxkeci9NspSCRT5rPhYw@mail.gmail.com>
2023-08-11 11:21     ` Will Deacon [this message]
     [not found]       ` <CAOgjDMgVZXbEeA6O2yPR9N27JWCMNR3D7cgHJbmbfYYUdKF3eQ@mail.gmail.com>
2023-08-21 20:21         ` Andrew Morton
2023-08-22  2:23           ` Qi Zheng
2023-08-22  9:58           ` Will Deacon

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=20230811112107.GE6993@willie-the-truck \
    --to=will@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=pasha.tatashin@soleen.com \
    --cc=qi.zheng@linux.dev \
    --cc=wangkefeng.wang@huawei.co \
    --cc=zhengqi.arch@bytedance.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