Re: [PATCH 0/2] x86/mm/pat: HIGHMEM pages in set_pages_array_*()

From: Christian

Date: Fri Nov 20 2026 - 11:45:52 EST


Hi Dave,

On 11/20/26 07:13, Dave Hansen wrote:
> I'll say, though, for something this obscure, I really need to be
> convinced that it's not going to regress anything. I also want to know
> that you'll be around to help us fix this if you break something.
>
> Please spend some time on the changelogs and please do double-check that
> there wasn't a better way to have done this. Human, please. No LLMs.

Thanks for the honest answer, that's fair.

About the AI part: English is not my first language (I'm from Spain),
and I mostly use AI tools to translate between Spanish and English. The
work itself is mine. I found this bug on my own tablet, I traced it
myself, and I'm going through it one step at a time. And yes, I'll be
around. If this breaks something, I'll help fix it.

I understand your concern about AI, and I won't send you unchecked junk.
I'm sorry if my first reply came across that way. From now on I'll work
in the way that suits you best.

You asked me to check if there was a better way, and for patch 1 there
is one. Up to v4.20, __change_page_attr() and cpa_process_alias()
returned early for a HIGHMEM page in a page array. Commit 16ebf031e8ab
("x86/mm/cpa: Add __cpa_addr() helper") moved that check into
__cpa_addr(), which now returns 0 for those pages, so the 0 goes on
into the page table lookup and ends up in __cpa_process_fault(). So v2
will put the early return back where it was, with a Fixes: tag, instead
of adding a special case to __cpa_process_fault(). I have tried it with
the vgem reproducer, with and without HIGHMEM, and both buffers map
fine.

For patch 2 I still want to look at the other option: TTM never passes
HIGHMEM pages to set_pages_array_*() at all, so maybe the callers should
keep WC buffers out of HIGHMEM instead of PAT tracking them. I'll
explain whichever way I pick in the changelog.

I'll take my time with v2 and rewrite the changelogs properly. Before
sending it I will check every claim three times and run the reproducer
again on each version.

Best regards,
Christian