Re: [PATCHv6 11/17] mm/hugetlb: Remove fake head pages

David Hildenbrand (Arm)
2026-02-07T21:25:38Z

On 2/7/26 21:16, Usama Arif wrote:
>
>> +
>> int __meminit vmemmap_populate_hvo(unsigned long addr, unsigned long end,
>> int node, unsigned long headsize)
>> {
>> + unsigned long maddr, len, tail_pfn;
>> + unsigned int order;
>> pte_t *pte;
>> - unsigned long maddr;
>> +
>> + len = end - addr;
>> + order = ilog2(len * sizeof(struct page) / PAGE_SIZE);
>
>
> This doesnt work for ARM. For len = 32 (2MB contiguous-PTE hugetlb on arm64):
> ilog2(32 * 64 / 65536) = ilog2(2048 / 65536) = ilog2(0) which is undefined.

HVO should not be possible for that size, and we should never reach that
point, no?

Remember that for HVO, the metadata must span at least two pages.

--
Cheers,

David