bao-hypervisor icon indicating copy to clipboard operation
bao-hypervisor copied to clipboard

Feature request: Option to force copy of binary image

Open gschwaer opened this issue 3 years ago • 0 comments

I ran into a hard to debug situation: In a config.c I specified the same VM_IMAGE for multiple VMs, assuming this would be copied into an allocated memory region. However if the memory region where the entry address lies is not physically placed, the image will be mapped to the image in the config blob instead. So my two VMs where sharing the data sections in the binary and strange side effects started to appear.

Feature request: When running identical binaries on different cores the binary has to be included in the config multiple times, which bloats the config binary (e.g., 4x identical Linux kernel binary). Introducing a flag to force a copy would reduce the size of the config blob drastically in those cases.

I tried to implement that in vm_map_img_rgn but it didn't seem to work like this (freeze after boot):

if (reg->place_phys) {
->
if (reg->place_phys || config->image.force_copy) {

I guess I'm missing something, but couldn't figure out what.

gschwaer avatar Dec 10 '20 16:12 gschwaer