On 20.05.2026 11:18, Wandun Chen wrote:
> From: Wandun Chen <[email protected]>
>
> From: Wandun Chen <[email protected]>
>
> Add a 'dumpable' flag to struct reserved_mem so the kernel can decide
> whether a reserved area should be included in the kdump vmcore. Most
> reserved regions are owned by devices and do not contain data useful
> for kernel crash analysis, so excluding them by default is the right
> behaviour.
>
> Reusable CMA regions are different: pages in a CMA region are handed
> back to the buddy allocator and may contain key data for crash
> analysis, so set dumpable to true in rmem_cma_setup().
>
> Suggested-by: Rob Herring <[email protected]>
> Signed-off-by: Wandun Chen <[email protected]>
> Tested-by: Meijing Zhao <[email protected]>
> Link: https://lore.kernel.org/all/[email protected]/
Acked-by: Marek Szyprowski <[email protected]>
> ---
>  include/linux/of_reserved_mem.h | 1 +
>  kernel/dma/contiguous.c         | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/include/linux/of_reserved_mem.h b/include/linux/of_reserved_mem.h
> index e8b20b29fa68..55a67cee41ea 100644
> --- a/include/linux/of_reserved_mem.h
> +++ b/include/linux/of_reserved_mem.h
> @@ -15,6 +15,7 @@ struct reserved_mem {
>       phys_addr_t                     base;
>       phys_addr_t                     size;
>       void                            *priv;
> +     bool                            dumpable;
>  };
>  
>  struct reserved_mem_ops {
> diff --git a/kernel/dma/contiguous.c b/kernel/dma/contiguous.c
> index 03f52bd17120..eddec89eb414 100644
> --- a/kernel/dma/contiguous.c
> +++ b/kernel/dma/contiguous.c
> @@ -579,6 +579,7 @@ static int __init rmem_cma_setup(unsigned long node, 
> struct reserved_mem *rmem)
>               dma_contiguous_default_area = cma;
>  
>       rmem->priv = cma;
> +     rmem->dumpable = true;
>  
>       pr_info("Reserved memory: created CMA memory pool at %pa, size %ld 
> MiB\n",
>               &rmem->base, (unsigned long)rmem->size / SZ_1M);

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


Reply via email to