[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH v2] plat/xen: arm: Initialize the bss section to 0
From: Dafna Hirschfeld <dafna3@xxxxxxxxx> Clear the bss section during boot so that it is initialized with 0. Additonally, we make sure with the linker script that all bss-related symbols are placed within the bss area marked with _end and __bss_start when the compile option "dropping of unused symbols" is enabled. Signed-off-by: Dafna Hirschfeld <dafna3@xxxxxxxxx> Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> --- plat/xen/arm/link32.lds | 2 +- plat/xen/arm/setup.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plat/xen/arm/link32.lds b/plat/xen/arm/link32.lds index 4508e05d..c5d83008 100644 --- a/plat/xen/arm/link32.lds +++ b/plat/xen/arm/link32.lds @@ -87,7 +87,7 @@ SECTIONS __bss_start = .; *(.bss) - *(.app.bss) + *(.bss.*) } _end = . ; diff --git a/plat/xen/arm/setup.c b/plat/xen/arm/setup.c index 4b9efe53..b91c0bdb 100644 --- a/plat/xen/arm/setup.c +++ b/plat/xen/arm/setup.c @@ -193,6 +193,13 @@ void _libxenplat_armentry(void *dtb_pointer, uint32_t physical_offset) { uk_pr_info("Entering from Xen (arm)...\n"); + /* Zero'ing out the bss section */ + /* + * TODO: It probably makes sense to move this to the early + * platform entry assembly code. + */ + memset(&__bss_start, 0, &_end - &__bss_start); + _init_dtb(dtb_pointer); _dtb_init_mem(physical_offset); /* relocates dtb */ uk_pr_info(" dtb: %p\n", HYPERVISOR_dtb); -- 2.11.0 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |