[PATCH for-next 1/2] book3s64/radix : Handle error conditions properly in radix_vmemmap_populate

Ritesh Harjani (IBM) ritesh.list at gmail.com
Mon May 5 17:36:21 AEST 2025


Donet Tom <donettom at linux.ibm.com> writes:

> Error conditions are not handled properly if altmap is not present
> and PMD_SIZE vmemmap_alloc_block_buf fails.
>
> In this patch, if vmemmap_alloc_block_buf fails in the non-altmap
> case, we will fall back to the base mapping.
>

We are trying to create mappings for vmemmap area. In this, we first try
to allocate pmd entry using vmemmap_alloc_block_buf() of PMD_SIZE. If we
couldn't allocate, we should definitely fallback to base page mapping. 

Looks good to me. Feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list at gmail.com>


-ritesh

> Signed-off-by: Donet Tom <donettom at linux.ibm.com>
> ---
>  arch/powerpc/mm/book3s64/radix_pgtable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/mm/book3s64/radix_pgtable.c b/arch/powerpc/mm/book3s64/radix_pgtable.c
> index 9f764bc42b8c..3d67aee8c8ca 100644
> --- a/arch/powerpc/mm/book3s64/radix_pgtable.c
> +++ b/arch/powerpc/mm/book3s64/radix_pgtable.c
> @@ -1173,7 +1173,7 @@ int __meminit radix__vmemmap_populate(unsigned long start, unsigned long end, in
>  				vmemmap_set_pmd(pmd, p, node, addr, next);
>  				pr_debug("PMD_SIZE vmemmap mapping\n");
>  				continue;
> -			} else if (altmap) {
> +			} else {
>  				/*
>  				 * A vmemmap block allocation can fail due to
>  				 * alignment requirements and we trying to align
> -- 
> 2.48.1


More information about the Linuxppc-dev mailing list