From 126482f3e84d575cab9570375e8f6e08b83237e8 Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Sun, 19 Nov 2023 22:54:23 -0800 Subject: [PATCH] [Yellowstone] Release init caps after loading. This was incredibly helpful for finding cases where we were using uninitialized memory as it causes a lot more pages to be reused early. --- sys/yellowstone/yellowstone.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sys/yellowstone/yellowstone.cpp b/sys/yellowstone/yellowstone.cpp index c2c5773..a7b9571 100644 --- a/sys/yellowstone/yellowstone.cpp +++ b/sys/yellowstone/yellowstone.cpp @@ -13,14 +13,6 @@ #include "yellowstone_server.h" glcr::ErrorCode SpawnProcess(z_cap_t vmmo_cap, z_cap_t yellowstone_cap) { - uint64_t vaddr; - // FIXME: Probably unmap this and remove the cap ownership. - RET_ERR(ZAddressSpaceMap(gSelfVmasCap, 0, vmmo_cap, &vaddr)); - return SpawnProcessFromElfRegion(vaddr, yellowstone_cap); -} - -glcr::ErrorCode SpawnProcessDeleteCap(z_cap_t vmmo_cap, - z_cap_t yellowstone_cap) { OwnedMemoryRegion region = OwnedMemoryRegion::FromCapability(vmmo_cap); return SpawnProcessFromElfRegion(region.vaddr(), yellowstone_cap); } @@ -66,7 +58,7 @@ uint64_t main(uint64_t port_cap) { check(vfs_client->OpenFile(req, resp)); ASSIGN_OR_RETURN(YellowstoneClient client3, server->CreateClient()); - check(SpawnProcessDeleteCap(resp.memory(), client3.Capability())); + check(SpawnProcess(resp.memory(), client3.Capability())); } }