Re: [PATCH 1/1] x86/ioremap: Use is_vmalloc_addr in iounmap

Thomas Gleixner
2024-08-13T20:37:41Z

On Tue, Aug 13 2024 at 10:20, Thomas Gleixner wrote:

> On Tue, Aug 13 2024 at 11:33, Alistair Popple wrote:
>>> On Mon, Aug 12 2024 at 12:03, Thomas Gleixner wrote:
>>>
>>> +#ifndef PHYSMEM_END
>>> +# define PHYSMEM_END (1UL << (MAX_PHYSMEM_BITS-PAGE_SHIFT))
>>
>> However I think this should be:
>>
>> # define PHYSMEM_END ((1UL << MAX_PHYSMEM_BITS) - 1)
>
> Bah.

Aside of that the x86 define must not be inside
CONFIG_DYNAMIC_MEMORY_LAYOUT, it needs to be:

#ifdef CONFIG_RANDOMIZE_MEMORY
# define PHYSMEM_END physmem_end
#endif

because CONFIG_DYNAMIC_MEMORY_LAYOUT is also selected by 5-level page
tables independent of KASLR. It does not need an else clause either
because that is covered by the generic fallback.

I'll send out a proper patch later.

Thanks,

tglx