Re: [PATCH] x86/sev: Fix kmemleak false positive for the RMP segment descriptors

From: Dave Hansen

Date: Mon Nov 02 2026 - 17:54:25 EST


On 11/2/26 14:30, Breno Leitao wrote:
> On Mon, Nov 02, 2026 at 12:48:16PM -0800, Dave Hansen wrote:
>> On 11/2/26 08:49, Breno Leitao wrote:
>>> Register the table with kmemleak, so it is scanned like any other
>>> object.
>>>
>>> kmemleak_alloc() registers a block of memory with kmemleak, so kmemleak
>>> scans it and counts pointers into it, do it with rmp_segment_table.
>> Why don't we just kmalloc() the thing?
> That would do the work as well, if this is an option.

I don't see a reason it needs to be allocated directly by the page
allocator. My friendly LLM agrees with me. kmalloc(PAGE_SIZE) aligns to
page boundaries and has for years.

BTW, there's almost no reason to use the page allocator directly these days.