[PATCH RFC v2 08/54] x86/mm/pat: fail a split at an unexpected level with -EINVAL
Rik van Riel
riel at surriel.com
Thu Dec 3 09:03:44 PST 2026
On Thu, 2026-11-26 at 13:14 +0200, Mike Rapoport (Microsoft) wrote:
> __split_large_page() returns 1 when it encounters an unexpected
> level, or
> when another CPU split the large page first.
>
> split_large_page() frees the page table and returns 0 in both cases,
> and
> __change_page_attr() looks the address up and tries again. For an
> unexpected level it tries forever.
>
> Getting there would be a bug, because no mappings ever use P4D
> leaves.
> Still, a level CPA cannot split should fail the request rather than
> loop.
>
> Return -EINVAL for an unexpected level and pass it up to the caller.
>
> Signed-off-by: Mike Rapoport (Microsoft) <rppt at kernel.org>
>
Reviewed-by: Rik van Riel <riel at surriel.com>
--
All Rights Reversed.
More information about the linux-arm-kernel
mailing list