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/rialto/src/main.rs b/rialto/src/main.rs
index 6b87e01..4163428 100644
--- a/rialto/src/main.rs
+++ b/rialto/src/main.rs
@@ -34,6 +34,7 @@
 use vmbase::{layout, main, power::reboot};
 
 const SZ_1K: usize = 1024;
+const SZ_4K: usize = 4 * SZ_1K;
 const SZ_64K: usize = 64 * SZ_1K;
 const SZ_1M: usize = 1024 * SZ_1K;
 const SZ_1G: usize = 1024 * SZ_1M;
@@ -82,7 +83,7 @@
     let reg_text = into_memreg(&layout::text_range());
     let reg_rodata = into_memreg(&layout::rodata_range());
     let reg_scratch = into_memreg(&layout::scratch_range());
-    let reg_stack = into_memreg(&layout::boot_stack_range());
+    let reg_stack = into_memreg(&layout::stack_range(40 * SZ_4K));
 
     debug!("Preparing kernel page table.");
     debug!("  dev:    {}-{}", reg_dev.start(), reg_dev.end());