On 19 April 2017 at 14:34, Jiahuan Zhang <[email protected]> wrote: > But from the source code, I found the main characteristic of virtio-serial > is that, > virtio-serial can create multiple serial ports and each port has a pair of > control virt-queues and > a pair of guest input/output virt-queues.
Its main characteristic is that the data transfer is over the standard virtio channel (ie a ring buffer in guest memory). That's why it's fast. > Its "have_data" callback function enables multi-byte data transfer from > guest. > And it is not in a tranditional device emulation format. > I mean that no exact IO region is emulated for it. It's a PCI device, it has registers the same way PCI devices do. (Or for virtio-mmio, it has MMIO registers like other MMIO devices). > Without Linux kernel driver, I don't know how to manipulate it. You can look at the virtio spec if you want to do direct work with virtio devices. Programming one isn't any more complicated than any other high-data-transfer device (like a modern ethernet card, for instance). > For the time being, I enable the guest app to send data to > the pl011's data register directly via a pointer, as you see that in the > code above. > > This is why I am thinking if adding a transmit buffer in pl011 for guest > writing > is a feasible alternative. Well, anything like this is never going to be of interest to QEMU upstream, because PL011s don't work like that. Virtio is our answer to "what is the most efficient way to transfer data from a guest to a host in a virtual machine", so we don't need to reinvent that wheel. The chances are that ad-hoc modifications to the PL011 will end up being slower than virtio. thanks -- PMM
