Re: [PATCH v2 20/22] mm/page_alloc: implement __GFP_UNMAPPED|__GFP_ZERO allocations
From: Brendan Jackman
Date: Fri May 15 2026 - 13:01:10 EST
On Wed May 13, 2026 at 5:00 PM UTC, Vlastimil Babka (SUSE) wrote:
>> #define PAGE_KERNEL __pgprot_mask(__PAGE_KERNEL | _ENC)
>> +#define PAGE_KERNEL_NOGLOBAL __pgprot_mask(__PAGE_KERNEL_NOGLOBAL | _ENC)
>> #define PAGE_KERNEL_NOENC __pgprot_mask(__PAGE_KERNEL | 0)
>> #define PAGE_KERNEL_RO __pgprot_mask(__PAGE_KERNEL_RO | _ENC)
>> #define PAGE_KERNEL_EXEC __pgprot_mask(__PAGE_KERNEL_EXEC | _ENC)
>
> Should this be part of earlier mermap x86 patches?
Maybe it could be in the patch that implements
arch_mermap_pgprot_allowed()? This is the first patch that actually uses
PAGE_KERNEL_NOGLOBAL though since mermap code just cares that you didn't
set _PAGE_GLOBAL.
>> diff --git a/mm/Kconfig b/mm/Kconfig
>> index e4cb52149acad..05b2bb841d0e0 100644
>> --- a/mm/Kconfig
>> +++ b/mm/Kconfig
>> @@ -1506,7 +1506,14 @@ config MERMAP_KUNIT_TEST
>> If unsure, say N.
>>
>> config PAGE_ALLOC_UNMAPPED
>> - bool "Support allocating pages that aren't in the direct map" if COMPILE_TEST
>> - default COMPILE_TEST
>> + bool "Support allocating pages that aren't in the direct map"
>> + depends on MERMAP
>> +
>> +config PAGE_ALLOC_KUNIT_TESTS
>> + tristate "KUnit tests for the page allocator" if !KUNIT_ALL_TESTS
>> + depends on KUNIT
>> + default KUNIT_ALL_TESTS
>> + help
>> + Builds KUnit tests for the page allocator.
>
> This belongs to the next patch?
Oops, thanks.