All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Questions on DeviceState and Virtio infrastructure
@ 2011-06-29 13:59 Wei Liu
  2011-06-30  8:31 ` Alexander Graf
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Liu @ 2011-06-29 13:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Perard, Wei LIU, Stefano Stabellini

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] Questions on DeviceState and Virtio infrastructure
  2011-06-29 13:59 [Qemu-devel] Questions on DeviceState and Virtio infrastructure Wei Liu
@ 2011-06-30  8:31 ` Alexander Graf
  2011-06-30  8:44   ` Wei Liu
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Graf @ 2011-06-30  8:31 UTC (permalink / raw)
  To: Wei Liu; +Cc: Anthony Perard, Stefano Stabellini, qemu-devel


On 29.06.2011, at 15:59, Wei Liu <liuw@liuw.name> wrote:

> 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).

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

> 
> 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.
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] Questions on DeviceState and Virtio infrastructure
  2011-06-30  8:31 ` Alexander Graf
@ 2011-06-30  8:44   ` Wei Liu
  2011-06-30 10:21     ` Stefano Stabellini
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Liu @ 2011-06-30  8:44 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Anthony Perard, qemu-devel, Stefano Stabellini

On Thu, Jun 30, 2011 at 4:31 PM, Alexander Graf <agraf@suse.de> wrote:
>
> On 29.06.2011, at 15:59, Wei Liu <liuw@liuw.name> wrote:
>
>> 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).
>
> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] Questions on DeviceState and Virtio infrastructure
  2011-06-30  8:44   ` Wei Liu
@ 2011-06-30 10:21     ` Stefano Stabellini
  2011-06-30 11:12       ` Alexander Graf
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Stabellini @ 2011-06-30 10:21 UTC (permalink / raw)
  To: Wei Liu; +Cc: Anthony Perard, Stefano Stabellini, Alexander Graf, qemu-devel

On Thu, 30 Jun 2011, Wei Liu wrote:
> On Thu, Jun 30, 2011 at 4:31 PM, Alexander Graf <agraf@suse.de> wrote:
> >
> > On 29.06.2011, at 15:59, Wei Liu <liuw@liuw.name> wrote:
> >
> >> 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).
> >
> > 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?
 
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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] Questions on DeviceState and Virtio infrastructure
  2011-06-30 10:21     ` Stefano Stabellini
@ 2011-06-30 11:12       ` Alexander Graf
  2011-06-30 14:11         ` Stefano Stabellini
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Graf @ 2011-06-30 11:12 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: Anthony Perard, qemu-devel, Wei Liu

On 06/30/2011 12:21 PM, Stefano Stabellini wrote:
> On Thu, 30 Jun 2011, Wei Liu wrote:
>> On Thu, Jun 30, 2011 at 4:31 PM, Alexander Graf<agraf@suse.de>  wrote:
>>> On 29.06.2011, at 15:59, Wei Liu<liuw@liuw.name>  wrote:
>>>
>>>> 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).
>>> 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?
>
> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] Questions on DeviceState and Virtio infrastructure
  2011-06-30 11:12       ` Alexander Graf
@ 2011-06-30 14:11         ` Stefano Stabellini
  2011-06-30 14:28           ` Alexander Graf
  0 siblings, 1 reply; 8+ messages in thread
From: Stefano Stabellini @ 2011-06-30 14:11 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Anthony Perard, Wei Liu, qemu-devel, Stefano Stabellini

On Thu, 30 Jun 2011, Alexander Graf wrote:
> On 06/30/2011 12:21 PM, Stefano Stabellini wrote:
> > On Thu, 30 Jun 2011, Wei Liu wrote:
> >> On Thu, Jun 30, 2011 at 4:31 PM, Alexander Graf<agraf@suse.de>  wrote:
> >>> On 29.06.2011, at 15:59, Wei Liu<liuw@liuw.name>  wrote:
> >>>
> >>>> 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).
> >>> 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?
> >
> > 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".

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] Questions on DeviceState and Virtio infrastructure
  2011-06-30 14:11         ` Stefano Stabellini
@ 2011-06-30 14:28           ` Alexander Graf
  2011-06-30 17:43             ` Stefano Stabellini
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Graf @ 2011-06-30 14:28 UTC (permalink / raw)
  To: Stefano Stabellini; +Cc: Anthony Perard, qemu-devel, Jan Beulich, Wei Liu

On 06/30/2011 04:11 PM, Stefano Stabellini wrote:
> On Thu, 30 Jun 2011, Alexander Graf wrote:
>> On 06/30/2011 12:21 PM, Stefano Stabellini wrote:
>>> On Thu, 30 Jun 2011, Wei Liu wrote:
>>>> On Thu, Jun 30, 2011 at 4:31 PM, Alexander Graf<agraf@suse.de>   wrote:
>>>>> On 29.06.2011, at 15:59, Wei Liu<liuw@liuw.name>   wrote:
>>>>>
>>>>>> 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).
>>>>> 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?
>>> 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] Questions on DeviceState and Virtio infrastructure
  2011-06-30 14:28           ` Alexander Graf
@ 2011-06-30 17:43             ` Stefano Stabellini
  0 siblings, 0 replies; 8+ messages in thread
From: Stefano Stabellini @ 2011-06-30 17:43 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Anthony Perard, Wei Liu, qemu-devel, Jan Beulich, Stefano Stabellini

On Thu, 30 Jun 2011, Alexander Graf wrote:
> On 06/30/2011 04:11 PM, Stefano Stabellini wrote:
> > On Thu, 30 Jun 2011, Alexander Graf wrote:
> >> On 06/30/2011 12:21 PM, Stefano Stabellini wrote:
> >>> On Thu, 30 Jun 2011, Wei Liu wrote:
> >>>> On Thu, Jun 30, 2011 at 4:31 PM, Alexander Graf<agraf@suse.de>   wrote:
> >>>>> On 29.06.2011, at 15:59, Wei Liu<liuw@liuw.name>   wrote:
> >>>>>
> >>>>>> 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).
> >>>>> 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?
> >>> 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?

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-06-30 17:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-29 13:59 [Qemu-devel] Questions on DeviceState and Virtio infrastructure Wei Liu
2011-06-30  8:31 ` Alexander Graf
2011-06-30  8:44   ` Wei Liu
2011-06-30 10:21     ` Stefano Stabellini
2011-06-30 11:12       ` Alexander Graf
2011-06-30 14:11         ` Stefano Stabellini
2011-06-30 14:28           ` Alexander Graf
2011-06-30 17:43             ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.