ARMv8: setting stack limit when booting cores
authorReto Achermann <reto.achermann@inf.ethz.ch>
Thu, 16 Mar 2017 12:25:51 +0000 (13:25 +0100)
committerReto Achermann <reto.achermann@inf.ethz.ch>
Thu, 16 Mar 2017 12:25:51 +0000 (13:25 +0100)
Signed-off-by: Reto Achermann <reto.achermann@inf.ethz.ch>

usr/drivers/cpuboot/arch/armv8/boot_arch.c

index ef0fa97..ab70eb9 100644 (file)
@@ -712,7 +712,6 @@ errval_t spawn_xcore_monitor(coreid_t coreid, hwid_t hwid,
     DEBUG("DATAMEM: %lx, %zu kb\n", monitor_mem.frameid.base,
                  monitor_mem.frameid.bytes >> 10);
 
-
     /*
      * The layout is:
      *  [ARMv8 CORE DATA]
@@ -725,6 +724,9 @@ errval_t spawn_xcore_monitor(coreid_t coreid, hwid_t hwid,
         return err;
     }
 
+    DEBUG("STACKMEM: %lx, %zu kb\n", stack_mem.frameid.base,
+            stack_mem.frameid.bytes >> 10);
+
 
     /* Load cpu */
     genvaddr_t boot_entry, cpu_driver_entry;
@@ -741,6 +743,12 @@ errval_t spawn_xcore_monitor(coreid_t coreid, hwid_t hwid,
 
     core_data->boot_magic = ARMV8_BOOTMAGIC_PSCI;
     core_data->cpu_driver_stack = stack_mem.frameid.base + stack_mem.frameid.bytes - 16;
+    core_data->cpu_driver_stack_limit = stack_mem.frameid.base + BASE_PAGE_SIZE;
+
+    DEBUG("kernel stack: 0x%" PRIxLPADDR"..0x%" PRIxLPADDR "\n",
+            core_data->cpu_driver_stack_limit,
+            core_data->cpu_driver_stack);
+
     core_data->cpu_driver_entry = cpu_driver_entry;