[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] xen/riscv: init bss section



Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
---
 xen/arch/riscv/setup.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 154bf3a0bc..593bb471a4 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -24,6 +24,18 @@ static void test_macros_from_bug_h(void)
     early_printk("WARN is most likely working\n");
 }
 
+static void __init init_bss(void)
+{
+    extern char __bss_start;
+    extern char __bss_end;
+    char *bss = &__bss_start;
+
+    while ( bss < &__bss_end ) {
+        *bss = 0;
+        bss++;
+    }
+}
+
 void __init noreturn start_xen(void)
 {
     /*
@@ -38,6 +50,8 @@ void __init noreturn start_xen(void)
 
     asm volatile( "mv %0, a1" : "=r" (dtb_base) );
 
+    init_bss();
+
     early_printk("Hello from C env\n");
 
     trap_init();
-- 
2.39.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.