Questions on DeviceState and Virtio infrastructure
Hi, QEMU folks
I know that I might have a bad title for this post, but I just don't have better idea for the title.
I'm developing virtio support for Xen pv guest, hoping to reuse the virtio infrastructure in qemu, i.e. I'm planning to use qemu as "virtio backend" for Xen pv. And qemu can be run as pv backend if proper "machine" option is given.
Maybe you've known that Xen pv guest utilizes Xenbus/Xenstore to configure its paravirt devices. So I'm to configure virtio devices with Xenbus/Xenstore as well. But in nowdays XenDevice in qemu does not include a DeviceState. To my understanding, it is not connected to qemu's internal buses or whatever (correct me if I'm wrong, I'm relatively new to qemu).
Here is the problem, say I'm to implement virtio nic for Xen pv guest, I use Xenbus to probe and initialize the device. When doing initialization, I am to reuse virtio_net_init, which takes DeviceState as the first argument -- but I just don't have one in XenDevice. All I need is to use qemu's virtio infrastructure.
What's the purpose of this DeviceState argument?
If I just construct my own DeviceState and pass it to virtio_net_init, what will happen? Will qemu emulates virtio nic as usual?
Thanks.
Wei.
Quoted 10 lines · Wei Liu
Hi, QEMU folks
I know that I might have a bad title for this post, but I just don't have better idea for the title.
I'm developing virtio support for Xen pv guest, hoping to reuse the virtio infrastructure in qemu, i.e. I'm planning to use qemu as "virtio backend" for Xen pv. And qemu can be run as pv backend if proper "machine" option is given.
Quoted 6 lines
Maybe you've known that Xen pv guest utilizes Xenbus/Xenstore to configure its paravirt devices. So I'm to configure virtio devices with Xenbus/Xenstore as well. But in nowdays XenDevice in qemu does not include a DeviceState. To my understanding, it is not connected to qemu's internal buses or whatever (correct me if I'm wrong, I'm relatively new to qemu).
I'm not a huge fan of adding multiple different transports for virtio if we don't have to. IIRC Xen PV guests can do PCI device assignment, right? That means there is a PCI bus for them which we could reuse to run virtio-pci on.
By then, you'd get all the virtio code for free and don't have to worry about maintaining yet another transport (which _is_ cumbersome)
Alex
Quoted 16 lines
Here is the problem, say I'm to implement virtio nic for Xen pv guest, I use Xenbus to probe and initialize the device. When doing initialization, I am to reuse
virtio_net_init, which takes DeviceState as the first argument -- but I just don't have one in XenDevice. All I need is to use qemu's virtio infrastructure.What's the purpose of this DeviceState argument?
If I just construct my own DeviceState and pass it to
virtio_net_init, what will happen? Will qemu emulates virtio nic as usual?Thanks.
Wei.
Quoted 20 lines · Alexander Graf
Quoted 10 lines · Wei Liu
Hi, QEMU folks
I know that I might have a bad title for this post, but I just don't have better idea for the title.
I'm developing virtio support for Xen pv guest, hoping to reuse the virtio infrastructure in qemu, i.e. I'm planning to use qemu as "virtio backend" for Xen pv. And qemu can be run as pv backend if proper "machine" option is given.
Quoted 6 lines
Maybe you've known that Xen pv guest utilizes Xenbus/Xenstore to configure its paravirt devices. So I'm to configure virtio devices with Xenbus/Xenstore as well. But in nowdays XenDevice in qemu does not include a DeviceState. To my understanding, it is not connected to qemu's internal buses or whatever (correct me if I'm wrong, I'm relatively new to qemu).
Quoted 4 lines
I'm not a huge fan of adding multiple different transports for virtio if we don't have to. IIRC Xen PV guests can do PCI device assignment, right? That means there is a PCI bus for them which we could reuse to run virtio-pci on.
By then, you'd get all the virtio code for free and don't have to worry about maintaining yet another transport (which _is_ cumbersome)
Good point, I will check this.
I thought that Xen pv pci assignment is only used for pci passthrough. But I will check the possibility to assign pv backend to guest.
Stefano, how would you say about this?
Wei.
Quoted 26 lines · Wei Liu
Quoted 20 lines · Alexander Graf
Quoted 10 lines · Wei Liu
Hi, QEMU folks
I know that I might have a bad title for this post, but I just don't have better idea for the title.
I'm developing virtio support for Xen pv guest, hoping to reuse the virtio infrastructure in qemu, i.e. I'm planning to use qemu as "virtio backend" for Xen pv. And qemu can be run as pv backend if proper "machine" option is given.
Quoted 6 lines
Maybe you've known that Xen pv guest utilizes Xenbus/Xenstore to configure its paravirt devices. So I'm to configure virtio devices with Xenbus/Xenstore as well. But in nowdays XenDevice in qemu does not include a DeviceState. To my understanding, it is not connected to qemu's internal buses or whatever (correct me if I'm wrong, I'm relatively new to qemu).
Quoted 4 lines
I'm not a huge fan of adding multiple different transports for virtio if we don't have to. IIRC Xen PV guests can do PCI device assignment, right? That means there is a PCI bus for them which we could reuse to run virtio-pci on.
By then, you'd get all the virtio code for free and don't have to worry about maintaining yet another transport (which _is_ cumbersome)
Quoted 6 lines
Good point, I will check this.
I thought that Xen pv pci assignment is only used for pci passthrough. But I will check the possibility to assign pv backend to guest.
Stefano, how would you say about this?
Yes, the PCI bus is an empty PCI bus created by xen-pcifront and it is only used for PCI passthrough. It couldn't be used as is for virtio-pci.
Quoted 26 lines · Stefano Stabellini
Quoted 25 lines · Wei Liu
Quoted 18 lines · Alexander Graf
Quoted 10 lines · Wei Liu
Hi, QEMU folks
I know that I might have a bad title for this post, but I just don't have better idea for the title.
I'm developing virtio support for Xen pv guest, hoping to reuse the virtio infrastructure in qemu, i.e. I'm planning to use qemu as "virtio backend" for Xen pv. And qemu can be run as pv backend if proper "machine" option is given.
Quoted 6 lines
Maybe you've known that Xen pv guest utilizes Xenbus/Xenstore to configure its paravirt devices. So I'm to configure virtio devices with Xenbus/Xenstore as well. But in nowdays XenDevice in qemu does not include a DeviceState. To my understanding, it is not connected to qemu's internal buses or whatever (correct me if I'm wrong, I'm relatively new to qemu).
Quoted 4 lines
I'm not a huge fan of adding multiple different transports for virtio if we don't have to. IIRC Xen PV guests can do PCI device assignment, right? That means there is a PCI bus for them which we could reuse to run virtio-pci on.
By then, you'd get all the virtio code for free and don't have to worry about maintaining yet another transport (which _is_ cumbersome)
Good point, I will check this.
Quoted 7 lines
Quoted 4 lines
I thought that Xen pv pci assignment is only used for pci passthrough. But I will check the possibility to assign pv backend to guest.
Stefano, how would you say about this?
Yes, the PCI bus is an empty PCI bus created by xen-pcifront and it is only used for PCI passthrough. It couldn't be used as is for virtio-pci.
What's keeping us from doing so? Doesn't MMIO emulation work with Xen PV?
Alex
Quoted 30 lines · Alexander Graf
Quoted 29 lines · Stefano Stabellini
Quoted 28 lines · Wei Liu
Quoted 18 lines · Alexander Graf
Quoted 10 lines · Wei Liu
Hi, QEMU folks
I know that I might have a bad title for this post, but I just don't have better idea for the title.
I'm developing virtio support for Xen pv guest, hoping to reuse the virtio infrastructure in qemu, i.e. I'm planning to use qemu as "virtio backend" for Xen pv. And qemu can be run as pv backend if proper "machine" option is given.
Quoted 6 lines
Maybe you've known that Xen pv guest utilizes Xenbus/Xenstore to configure its paravirt devices. So I'm to configure virtio devices with Xenbus/Xenstore as well. But in nowdays XenDevice in qemu does not include a DeviceState. To my understanding, it is not connected to qemu's internal buses or whatever (correct me if I'm wrong, I'm relatively new to qemu).
Quoted 4 lines
I'm not a huge fan of adding multiple different transports for virtio if we don't have to. IIRC Xen PV guests can do PCI device assignment, right? That means there is a PCI bus for them which we could reuse to run virtio-pci on.
By then, you'd get all the virtio code for free and don't have to worry about maintaining yet another transport (which _is_ cumbersome)
Good point, I will check this.
I thought that Xen pv pci assignment is only used for pci passthrough. But I will check the possibility to assign pv backend to guest.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Stefano, how would you say about this?
Yes, the PCI bus is an empty PCI bus created by xen-pcifront and it is only used for PCI passthrough. It couldn't be used as is for virtio-pci.
What's keeping us from doing so? Doesn't MMIO emulation work with Xen PV?
No, it does not.
The only realistic way that I can see to make virtio work with PV guests is to write "virtio-xenstore".
Quoted 31 lines · Stefano Stabellini
Quoted 30 lines · Alexander Graf
Quoted 29 lines · Stefano Stabellini
Quoted 28 lines · Wei Liu
Quoted 18 lines · Alexander Graf
Quoted 10 lines · Wei Liu
Hi, QEMU folks
I know that I might have a bad title for this post, but I just don't have better idea for the title.
I'm developing virtio support for Xen pv guest, hoping to reuse the virtio infrastructure in qemu, i.e. I'm planning to use qemu as "virtio backend" for Xen pv. And qemu can be run as pv backend if proper "machine" option is given.
Quoted 6 lines
Maybe you've known that Xen pv guest utilizes Xenbus/Xenstore to configure its paravirt devices. So I'm to configure virtio devices with Xenbus/Xenstore as well. But in nowdays XenDevice in qemu does not include a DeviceState. To my understanding, it is not connected to qemu's internal buses or whatever (correct me if I'm wrong, I'm relatively new to qemu).
Quoted 4 lines
I'm not a huge fan of adding multiple different transports for virtio if we don't have to. IIRC Xen PV guests can do PCI device assignment, right? That means there is a PCI bus for them which we could reuse to run virtio-pci on.
By then, you'd get all the virtio code for free and don't have to worry about maintaining yet another transport (which _is_ cumbersome)
Good point, I will check this.
I thought that Xen pv pci assignment is only used for pci passthrough. But I will check the possibility to assign pv backend to guest.
Quoted 7 lines
Quoted 4 lines
Quoted 3 lines
Quoted 1 line
Stefano, how would you say about this?
Yes, the PCI bus is an empty PCI bus created by xen-pcifront and it is only used for PCI passthrough. It couldn't be used as is for virtio-pci.
What's keeping us from doing so? Doesn't MMIO emulation work with Xen PV?
No, it does not.
The only realistic way that I can see to make virtio work with PV guests is to write "virtio-xenstore".
Hrm. What's technically keeping you from doing MMIO with PV guests?
Alex
Quoted 35 lines · Alexander Graf
Quoted 34 lines · Stefano Stabellini
Quoted 33 lines · Alexander Graf
Quoted 32 lines · Stefano Stabellini
Quoted 21 lines · Wei Liu
Quoted 20 lines · Alexander Graf
Quoted 10 lines · Wei Liu
Hi, QEMU folks
I know that I might have a bad title for this post, but I just don't have better idea for the title.
I'm developing virtio support for Xen pv guest, hoping to reuse the virtio infrastructure in qemu, i.e. I'm planning to use qemu as "virtio backend" for Xen pv. And qemu can be run as pv backend if proper "machine" option is given.
Quoted 6 lines
Maybe you've known that Xen pv guest utilizes Xenbus/Xenstore to configure its paravirt devices. So I'm to configure virtio devices with Xenbus/Xenstore as well. But in nowdays XenDevice in qemu does not include a DeviceState. To my understanding, it is not connected to qemu's internal buses or whatever (correct me if I'm wrong, I'm relatively new to qemu).
I'm not a huge fan of adding multiple different transports for virtio if we don't have to. IIRC Xen PV guests can do PCI device assignment, right? That means there is a PCI bus for them which we could reuse to run virtio-pci on.
Quoted 8 lines
Quoted 2 lines
By then, you'd get all the virtio code for free and don't have to worry about maintaining yet another transport (which _is_ cumbersome)
Good point, I will check this.
I thought that Xen pv pci assignment is only used for pci passthrough. But I will check the possibility to assign pv backend to guest.
Stefano, how would you say about this?
Yes, the PCI bus is an empty PCI bus created by xen-pcifront and it is only used for PCI passthrough. It couldn't be used as is for virtio-pci.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
What's keeping us from doing so? Doesn't MMIO emulation work with Xen PV?
No, it does not.
The only realistic way that I can see to make virtio work with PV guests is to write "virtio-xenstore".Hrm. What's technically keeping you from doing MMIO with PV guests?
All the infrastructure to catch MMIO reads/writes in Xen and forward them to Qemu is not enabled; Qemu MMIO emulation is not running. At that point is just better to run a PV on HVM guest.