[PATCH] arm64: contpte: fix set_access_flags() no-op check for SMMU/ATS faults

James Houghton jthoughton at google.com
Wed Mar 4 20:31:20 PST 2026


On Tue, Mar 3, 2026 at 1:40 PM Piotr Jaroszynski
<pjaroszynski at nvidia.com> wrote:
>
> On Mon, Mar 02, 2026 at 11:19:46PM -0800, James Houghton wrote:
> > This is similar (sort of) to a HugeTLB page fault loop I stumbled upon
> > a while ago[1]. (I wonder if there have been more cases like this.)
>
> I see that your commit 3c0696076aad ("arm64: mm: Always make sw-dirty
> PTEs hw-dirty in pte_modify") from that discussion was picked up and
> it's very relevant for the hugetlb exposure question. With your patch,
> do we have a guarantee that sw-dirty implies hw-dirty in all cases? If
> yes, then there should be no exposure for that path. But it still makes
> sense to make it more explicit.

At the time, I was unsure that the patch made it *impossible* for
Linux to ever write sw-dirty hw-clean PTEs, but, after that patch,
such a write would have to somehow avoid pte_modify(). That seems
unlikely; that was satisfactory for me at the time.

I thought (and still think) that explicitly fixing the HugeTLB path
would be a good idea. I think that patch wasn't taken because it
wasn't necessary to fix the bug I was staring at.

So if you want to take the patch to the HugeTLB path[2] or improve it
in a v2 here, please do!

Thanks!

[2] https://lore.kernel.org/all/20231204172646.2541916-2-jthoughton@google.com/

> > [1] https://lore.kernel.org/all/20231204172646.2541916-1-jthoughton@google.com



More information about the linux-arm-kernel mailing list