Re: [PATCH v2 1/1] x86/boot/compressed: Fix avoiding memmap in physical KASLR

From: Dave Hansen

Date: Thu Oct 23 2025 - 16:29:15 EST


On 10/22/25 16:37, Michal Clapinski wrote:
...
> But it would not disable physical KASLR for:
> memmap=1G!4G memmap=1G!5G memmap=1G!6G memmap=1G!7G memmap=1G!8G
> since the whole function would be called 5 times and the last `if`
> would never trigger.

I'm missing something about how this works.

The:

static int i;

is static so should be keeping state across function calls. For the
purposes of checking 'i', why does it matter if the function is called
one time with 5 arguments or 5 times with 1? Doesn't 'i' end up at the
same value either way?