[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCHv5 43/46] plat/kvm: Swith away from boot stack
From: Wei Chen <Wei.Chen@xxxxxxx> The boot stack is used for system initialization. This size is limited, after we have done the initialization, we should switch away from it as soon as possible. We will use the memory top as the new stack's top address. Signed-off-by: Wei Chen <Wei.Chen@xxxxxxx> --- plat/kvm/arm/entry64.S | 11 +++++++++++ plat/kvm/arm/setup.c | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/plat/kvm/arm/entry64.S b/plat/kvm/arm/entry64.S index fdbd295..7cfb5aa 100644 --- a/plat/kvm/arm/entry64.S +++ b/plat/kvm/arm/entry64.S @@ -99,3 +99,14 @@ ENTRY(_libkvmplat_entry) ldr x0, =_dtb b _libkvmplat_start END(_libkvmplat_entry) + +ENTRY(_libkvmplat_newstack) + /* Setup new stack */ + mov sp, x0 + + /* Setup parameter for _libkvmplat_entry2 */ + mov x0, x2 + + /* Branch to _libkvmplat_entry2 */ + br x1 +END(_libkvmplat_newstack) diff --git a/plat/kvm/arm/setup.c b/plat/kvm/arm/setup.c index a0b1f50..f18ba05 100644 --- a/plat/kvm/arm/setup.c +++ b/plat/kvm/arm/setup.c @@ -36,6 +36,9 @@ static char cmdline[MAX_CMDLINE_SIZE]; smcc_psci_callfn_t smcc_psci_call; +extern void _libkvmplat_newstack(uint64_t stack_start, + void (*tramp)(void *), void *arg); + static void _init_dtb(void *dtb_pointer) { int ret; @@ -173,6 +176,11 @@ enocmdl: strcpy(cmdline, CONFIG_UK_NAME); } +static void _libkvmplat_entry2(void *arg __attribute__((unused))) +{ + ukplat_entry_argp(NULL, (char *)cmdline, strlen(cmdline)); +} + void _libkvmplat_start(void *dtb_pointer) { _init_dtb(dtb_pointer); @@ -193,4 +201,13 @@ void _libkvmplat_start(void *dtb_pointer) uk_printd(DLVL_INFO, "pagetable start: %p\n", _libkvmplat_pagetable); uk_printd(DLVL_INFO, " heap start: %p\n", _libkvmplat_heap_start); uk_printd(DLVL_INFO, " stack top: %p\n", _libkvmplat_stack_top); + + /* + * Switch away from the bootstrap stack as early as possible. + */ + uk_printd(DLVL_INFO, "Switch from bootstrap stack to stack @%p\n", + _libkvmplat_stack_top); + + _libkvmplat_newstack((uint64_t) _libkvmplat_stack_top, + _libkvmplat_entry2, NULL); } -- 2.17.1 _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |