[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCHv4 39/43] plat/kvm: Swith away from boot stack
Hi Wei, Title: Swith/Switch/ Cheers, On 06/07/18 10:03, Wei Chen wrote: 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 2ef7e2d..62a91de 100644 --- a/plat/kvm/arm/entry64.S +++ b/plat/kvm/arm/entry64.S @@ -69,3 +69,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 b7f3e47..079a67d 100644 --- a/plat/kvm/arm/setup.c +++ b/plat/kvm/arm/setup.c @@ -49,6 +49,9 @@ void *_libkvmplat_dtb;int psci_method; +extern void _libkvmplat_newstack(uint64_t stack_start,+ void (*tramp)(void *), void *arg); + static void _init_dtb(void *dtb_pointer) { int ret; @@ -171,6 +174,11 @@ static void _init_cpufeatures(void) /* TODO */ }+static void _libkvmplat_entry2(void *arg __attribute__((unused)))+{ + ukplat_entry_argp(NULL, cmdline, sizeof(cmdline)); +} + void _libkvmplat_start(void *dtb_pointer) { _init_dtb(dtb_pointer); @@ -191,4 +199,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); } -- Julien Grall _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |