13.2. Secondary disk
A simpler and possibly less overhead alternative to 9P would be to generate a secondary disk image with the benchmark you want to rebuild.
Then you can umount
and re-mount on guest without reboot.
To build the secondary disk image run build-disk2:
./build-disk2
This will put the entire out_rootfs_overlay_dir
into a squashfs filesystem.
Then, if that filesystem is present, ./run
will automatically pass it as the second disk on the command line.
For example, from inside QEMU, you can mount that disk with:
mkdir /mnt/vdb mount /dev/vdb /mnt/vdb /mnt/vdb/lkmc/c/hello.out
To update the secondary disk while a simulation is running to avoid rebooting, first unmount in the guest:
umount /mnt/vdb
and then on the host:
# Edit the file. vim userland/c/hello.c ./build-userland ./build-disk2
and now you can re-run the updated version of the executable on the guest after remounting it.
gem5 fs.py support for multiple disks is discussed at: https://stackoverflow.com/questions/50862906/how-to-attach-multiple-disk-images-in-a-simulation-with-gem5-fs-py/51037661#51037661