Re: [PATCH] KVM: arm64: Drop sort_memblock_regions()
From: Will Deacon
Date: Thu Mar 13 2025 - 07:27:13 EST
On Tue, Mar 11, 2025 at 02:37:18PM +1000, Gavin Shan wrote:
> Drop sort_memblock_regions() and avoid sorting the copied memory
> regions to be ascending order on their base addresses, because the
> source memory regions should have been sorted correctly when they
> are added by memblock_add() or its variants.
>
> This is generally reverting commit a14307f5310c ("KVM: arm64: Sort
> the hypervisor memblocks"). No functional changes intended.
>
> Signed-off-by: Gavin Shan <gshan@xxxxxxxxxx>
> ---
> arch/arm64/kvm/pkvm.c | 19 -------------------
> 1 file changed, 19 deletions(-)
It's not especially obvious from the memblock API that the memblocks
are sorted and so for_each_mem_region() will traverse the regions in
order. But it does appear to be true, so I suppose this is fine:
Acked-by: Will Deacon <will@xxxxxxxxxx>
Will