Re: [PATCH RFC v2 00/54] arch, mm: create a generic set_memory/change_page_attr core
From: Mike Rapoport
Date: Wed Dec 02 2026 - 02:52:50 EST
On Tue, Dec 01, 2026 at 04:09:55PM -0800, Dave Hansen wrote:
> On 11/26/26 03:14, Mike Rapoport (Microsoft) wrote:
> > x86's implementation is the most versatile and most battle tested and as
> > such it is the best base for the generic implementation: it preserves large
> > mappings when it can, it splits when it must, it handles the direct map
> > alias, it serializes against itself and it sanity checks the result. The
> > others are catching up one bug at a time 😉
>
> This is so sad. It's such a mess. :)
>
> To be honest, I wonder if we should just start fresh. Use the x86
> implementation to build a nice set of comprehensive tests and then try
> to build a new, generic set_memory from scratch.
I hesitated a lot about it.
I went with pulling x86 implementation into the core, as rfc v1 did it and
it was easier to continue from there :)
This way we start from something we know already works and in about 40
small(ish) steps make it into the generic core.
Also it reduces amount of churn, at least in x86, and makes it easier to
review for the most picky x86 maintainers ;-P
OTOH, there still gaps from where we want set_memory to be, the most
important is that a set_memory call leaves a range with mixed protections
if it fails midway. With a fresh core we can deal with it from day 1.
Starting fresh sounds good to me and I surely can make the next version
that way.
--
Sincerely yours,
Mike.