vmbase: Move stack to end of writable_data
Instead of imposing an arbitrary size for the stack, allows clients to
query a validated address range of a given size with boot_stack_range(),
which places the stack at the largest address possible, extending
downwards (common on AArch64).
Keep allocating 40 pages of stack in vmbase_example, rialto, and pvmfw.
Bug: 279209532
Bug: 270684188
Test: atest vmbase_example.integration_test
Test: atest rialto_test
Test: atest MicrodroidTests
Change-Id: If205ccd4fa408e32e5533b880a85f4cccbd3f005
diff --git a/vmbase/sections.ld b/vmbase/sections.ld
index 9ed2455..8118363 100644
--- a/vmbase/sections.ld
+++ b/vmbase/sections.ld
@@ -89,11 +89,10 @@
bss_end = .;
} >writable_data
+ init_stack_pointer = ORIGIN(writable_data) + LENGTH(writable_data);
.stack (NOLOAD) : ALIGN(4096) {
- boot_stack_begin = .;
- . += 40 * 4096;
- . = ALIGN(4096);
- boot_stack_end = .;
+ stack_limit = .;
+ . = init_stack_pointer;
} >writable_data
/*