From bbe9a23060e956d68357adc2740e5df190009a7d Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Tue, 22 Jul 2025 16:39:20 -0700 Subject: [PATCH] platform: generic: Pack the FDT after applying fixups 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 Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20250722233923.1356605-1-samuel.holland@sifive.com Signed-off-by: Anup Patel --- 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; }