Re: [PATCH] mm/secretmem: disable under HIGHMEM

From: David Hildenbrand (Arm)

Date: Thu Jul 16 2026 - 06:08:15 EST


On 7/15/26 16:58, Mike Rapoport wrote:
> On Wed, Jul 15, 2026 at 03:49:39PM +0200, David Hildenbrand (Arm) wrote:
>> On 7/15/26 15:44, Mike Rapoport wrote:
>>>
>>> No, I mean what Brendan's patch did:
>>>
>>> config SECRETMEM
>>> default y
>>> bool "Enable memfd_secret() system call" if EXPERT
>>> - depends on ARCH_HAS_SET_DIRECT_MAP
>>> + depends on ARCH_HAS_SET_DIRECT_MAP && !HIGHMEM
>>>
>>> We can change gfp_mask as well for the sake of pedancy
>>
>> Why not change the gfp mask only then?
>
> Citing myself from a few emails back:
>
>>> But still with kmap() and friends not being an NOP the promise "kernel does
>>> not map this memory" does not hold.

So you're saying that kmap() would perform a mapping for a non-highmem page?

static inline void *kmap(struct page *page)
{
void *addr;

might_sleep();
if (!PageHighMem(page))
addr = page_address(page);
else
addr = kmap_high(page);
kmap_flush_tlb((unsigned long)addr);
return addr;
}

I'm missing something important.

--
Cheers,

David