Re: [RFC][PATCH v3 15/16] kmemdump: Add Kinfo backend driver

From: Alexey Klimov

Date: Tue Sep 16 2025 - 01:49:17 EST


On Fri Sep 12, 2025 at 4:08 PM BST, Eugen Hristev wrote:

[..]

> --- /dev/null
> +++ b/mm/kmemdump/kinfo.c
> @@ -0,0 +1,293 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + *
> + * Copyright 2002 Rusty Russell <rusty@xxxxxxxxxxxxxxx> IBM Corporation
> + * Copyright 2021 Google LLC
> + * Copyright 2025 Linaro Ltd. Eugen Hristev <eugen.hristev@xxxxxxxxxx>
> + */
> +#include <linux/platform_device.h>
> +#include <linux/kallsyms.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_reserved_mem.h>
> +#include <linux/kmemdump.h>
> +#include <linux/module.h>
> +#include <linux/utsname.h>

Could you please check if the headers are sorted here
and in all other patches in this series?

Also module.h is duplicated.

[..]

> +static int build_info_set(const char *str, const struct kernel_param *kp)
> +{
> + struct kernel_all_info *all_info = kinfo->all_info_addr;

here ^^

> + size_t build_info_size;
> +
> + if (kinfo->all_info_addr == 0 || kinfo->all_info_size == 0)
> + return -ENAVAIL;
> +
> + all_info = (struct kernel_all_info *)kinfo->all_info_addr;

Maybe assignment of all_info on declaration in the beginning of this function
is not needed then?

> + build_info_size = sizeof(all_info->info.build_info);
> +
> + memcpy(&all_info->info.build_info, str, min(build_info_size - 1,
> + strlen(str)));
> + update_kernel_all_info(all_info);
> +
> + if (strlen(str) > build_info_size) {
> + pr_warn("%s: Build info buffer (len: %zd) can't hold entire string '%s'\n",
> + __func__, build_info_size, str);
> + return -ENOMEM;
> + }
> +
> + return 0;
> +}

[...]

Best regards,
Alexey