Replies: 3 comments 3 replies
-
The reason for giving access to 8 virtio devices is that these devices reside on the same 4K page. Because Bao's main IO isolation primitive is virtual memory, this is the granularity we have. I don't remember the exact details, but I believe we chose the first 8 devices because when you configure a virtio device in qemu's command line, it assigns the devices to these virtio MMIO "slots" in order. We create two devices in the demo's command line (console and net), this means qemu will assign them the first and second slots. To assign them to linux, we have to assign all the other that reside in the same page. Technically, we could remove the other six from the guest' dtb.
I'm guessing the hvc are all the virtio devices Linux sees. And as I explained, probably the console is assigned to the first slot, which is mapped to hvc0. Again, I don't remember the exact details. But could you explain why this is a problem and exactly what is it out are trying to achieve? Maybe we could be of more assistance. |
Beta Was this translation helpful? Give feedback.
-
What's more, even change the value of .phys also matters the result, only |
Beta Was this translation helpful? Give feedback.
-
The answer to this is quite straightforward. Virtio devices are essentially DMA devices. However, these are not connected to an IOMMU (or if there is a virtio-iommu, Bao does not support it). Therefore, we need to configure identity mappings for the guest so that they work correctly. If you remove the identity mapping (i.e., setting the place phys options with phys == base) , Bao places the guest in a different physical address, and devices will be given the wrong addresses by the guest.
This is just a choice for the configuration. We could chose another physical address to place the guest. Just change it in the device tree and make sure in the guest region configuration .base is the same as .phys |
Beta Was this translation helpful? Give feedback.
-
I saw dts and config.c of linux, qemu-aarch64 demo, there are 8 virtio device, I don't know why chose this 8 device, not other virtio device. Actually, there are lots of virtio device in the dtb I dumped from qemu, I tried to change some virtio in bao, and the linux demo just can't run, neither when I try to dwindle virtio numbers, could anyone tell me the rule when chose virtio device? I guess 4 device for virtio-console and other 4 device for virtio-net, just guess, XD...
What's more, why the bootargs in dts is 'hvc0', actually I saw 8 hvc in directory /dev, which is /dev/hvc0 ~ /dev/hvc7.
Beta Was this translation helpful? Give feedback.
All reactions