[PATCH] platform: generic: Pack the FDT after applying fixups

Anup Patel anup at brainfault.org
Tue Jul 22 23:56:49 PDT 2025


On Wed, Jul 23, 2025 at 5:09 AM Samuel Holland
<samuel.holland at sifive.com> wrote:
>
> This minimizes the size that will be reserved by the OS for the FDT, and
> it prevents the FDT buffer from containing uninitialized memory, which
> can be important for some simulation platforms and for attestation.
>
> Closes: https://github.com/riscv-software-src/opensbi/issues/388
> Signed-off-by: Samuel Holland <samuel.holland at sifive.com>

LGTM.

Reviewed-by: Anup Patel <anup at brainfault.org>

Regards,
Anup

> ---
>
>  platform/generic/platform.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/platform/generic/platform.c b/platform/generic/platform.c
> index 47e771ad..889d6905 100644
> --- a/platform/generic/platform.c
> +++ b/platform/generic/platform.c
> @@ -245,6 +245,8 @@ int generic_final_init(bool cold_boot)
>         fdt_fixups(fdt);
>         fdt_domain_fixup(fdt);
>
> +       fdt_pack(fdt);
> +
>         return 0;
>  }
>
> --
> 2.47.2
>
> base-commit: cc546e1a06930c5ebaf6e90a9a28dca4218f1954
> branch: up/fdt-pack
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list