enarx-archive / sallyport

API for the hypervisor-microkernel boundary
Apache License 2.0
7 stars 6 forks source link

feat: add tech dependent boot info #5

Closed haraldh closed 3 years ago

haraldh commented 3 years ago
npmccallum commented 3 years ago

I assume that this is just transitional. If keepldr is just an elf loader, the kernel should know its own initial memory size. Right? We should get away from the keepldr passing any information to the guest (besides sallyport).

haraldh commented 3 years ago

I assume that this is just transitional. If keepldr is just an elf loader, the kernel should know its own initial memory size. Right? We should get away from the keepldr passing any information to the guest (besides sallyport).

The shim does not really know the code size, nor the exact size of the memory the loader mapped into guest physical memory. Of course, it can assume, it's the known shim size + the code size after parsing the code elf headers to get a guess for the code size.

npmccallum commented 3 years ago

The shim does not really know the code size, nor the exact size of the memory the loader mapped into guest physical memory. Of course, it can assume, it's the known shim size + the code size after parsing the code elf headers to get a guess for the code size.

Can't it calculate the size by walking the page tables? If I remember correctly there is a present bit.

haraldh commented 3 years ago

The shim does not really know the code size, nor the exact size of the memory the loader mapped into guest physical memory. Of course, it can assume, it's the known shim size + the code size after parsing the code elf headers to get a guess for the code size.

Can't it calculate the size by walking the page tables? If I remember correctly there is a present bit.

No, because the page tables are provided by the shim, not the loader and have identity mapping with 1GiB huge pages for simplicity.

npmccallum commented 3 years ago

No, because the page tables are provided by the shim, not the loader and have identity mapping with 1GiB huge pages for simplicity.

Who decides how much memory keepldr should allocate? It should be the shim (in the ELF somewhere).

haraldh commented 3 years ago

ok, seems we don't need all of this.. will open a new PR with syscall related stuff