PC platform: init_physical_id_heap(): align range end to 4KB
It is not necessary for the end of a physical memory range to be
aligned to 2MB, a 4KB alignment is OK.
This change increases physical memory availability for the kernel
by ~2.5 MB.
@@ -302,10 +302,10 @@ static id_heap init_physical_id_heap(heap h)
if (e->type == REGION_PHYSICAL) {
/* Align for 2M pages */
u64 base = e->base;
- u64 end = base + e->length - 1;
+ u64 end = base + e->length;
u64 page2m_mask = MASK(PAGELOG_2M);
base = (base + page2m_mask) & ~page2m_mask;
- end &= ~page2m_mask;
+ end &= ~MASK(PAGELOG);
if (base >= end)
continue;
u64 length = end - base;
