QEMU simulation: Passing drive to CAmkES ARM VM
Hi, I am currently booting a initramfs as the VM so that I later would be able to switch root to a filesystem disk that allows for larger storage and has other software installed that I want inside the VM. I have started the simulate script with a few variants of the following line (Passing the virtio device was a guess since the virtio-net device is supported for networking for the VM. I have also tried to pass only the drive part but it has the same result.): sudo ./simulate --extra-qemu-args="-device virtio-blk-pci,drive=drive0 -drive file=filesystem/testimage,format=raw,if=none,id=drive0" However there are no devices appearing in /dev/ that seem to be the drive passed to qemu such as sdaX or vdaX. There is no output from running "fdisk -l" either. So therefore I wonder if this kind of passthrough is supported by seL4? I have tried to find documentation that relates passing a disk to the VM in seL4 but have not found anything yet. This was done for the qemu-arm-virt platform if that has some significance regarding platform support. Best regards, Olof
On Thu, Jun 3, 2021 at 6:38 PM Olof Holmberg
Hi,
I am currently booting a initramfs as the VM so that I later would be able to switch root to a filesystem disk that allows for larger storage and has other software installed that I want inside the VM.
I have started the simulate script with a few variants of the following line (Passing the virtio device was a guess since the virtio-net device is supported for networking for the VM. I have also tried to pass only the drive part but it has the same result.):
sudo ./simulate --extra-qemu-args="-device virtio-blk-pci,drive=drive0 -drive file=filesystem/testimage,format=raw,if=none,id=drive0"
However there are no devices appearing in /dev/ that seem to be the drive passed to qemu such as sdaX or vdaX. There is no output from running "fdisk -l" either.
So therefore I wonder if this kind of passthrough is supported by seL4? I have tried to find documentation that relates passing a disk to the VM in seL4 but have not found anything yet. This was done for the qemu-arm-virt platform if that has some significance regarding platform support.
Hi Olof, Do you see the device come up if you perform `lspci` in the guest? The PCI bus should be being passed directly through to the guest by default, so adding a virtio-blk-pci should also get passed through. What commands do you use to create the testimage?
Best regards, Olof _______________________________________________ Devel mailing list -- devel@sel4.systems To unsubscribe send an email to devel-leave@sel4.systems
Hi Kent, The 'lspci' command is currently not available when simulating the initramfs, I can try to add it if necessary. The device does not show up when running: / (initramfs) # cut -f1,2,18 /proc/bus/pci/devices 0000 5e140042 0008 1af4a111 0010 1af4a111 I did however test adding the drive when simulating the usual linux image that is used for the examples for seL4 (the qemu-arm-virt image in the camkes-vm-images project) and the drive shows up as a device at least (I could not find it as a disk though): (buildroot) # lspci 00:00.0 Class 0600: 5e14:0042 00:02.0 Class 0100: 1af4:1001 <---(Red Hat, Inc. Virtio block device) 00:01.0 Class 0200: 1af4:1000 00:00.0 Class 0600: 1b36:0008 00:01.0 Class 0005: 1af4:a111 So it seems to be related to the initramfs since the driver does not show up. If there are necessary init scripts added to the linux images used in the seL4 projects these are definitely missing. The initramfs is pretty much the standard one from a yocto-linux build and the image loaded as drive is a root file system with python3 and some added pip installs from the same yocto-linux build. The testimage was created in the following way: $ qemu-img convert vm-qemuarm64.ext testimage (where the ext4 file is the filesystem from the yocto build) If details from the yocto build is necessary I can provide them as well but you probably have to specify what you want to know since it is a lot of scripts and recipes used in the build. One thing that I noticed differ is in the init scripts of both the yocto initramfs and the default seL4 qemu-arm-virt image. Both mounts the devtmpfs but the seL4 qemu-arm-virt image runs a init script contained in /sbin/init. I do not know what the script contains since it was a binary but if it contains some initialization required for seL4 VMs that might be the issue. I have also attempted to passthrough ethernet through qemu with virtio and it has the same result. The "eth0" device is visible in the qemu-arm-virt image but not in the yocto initramfs. So it is not only the disk passthrough that has issues which might be helpful. /Olof
participants (2)
-
Kent Mcleod
-
Olof Holmberg