qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Virtio net bringup for new arch?
@ 2011-05-25 19:00 Greg McGary
  2011-05-25 20:10 ` Alexander Graf
  0 siblings, 1 reply; 5+ messages in thread
From: Greg McGary @ 2011-05-25 19:00 UTC (permalink / raw)
  To: qemu-devel

I have a new architecture port that can boot linux and work interactively with a UART.
The next step to facilitate application development is to have NFS filesystems.  The
real HW has no bus--it will have some sort of shared-memory, SW-arbitrated access to a
control processor's devices.  For development on QEMU, I'm guessing the easiest way to
fake a network is to use virtio-net, since linux kernel and QEMU both support it.
Perhaps when it comes time to implement the network link to the control-processor,
virtio-net will be the best choice there as well.

Now, I need to know how to glue it all together.  Questions:

* the Syborg virtual board seemed like a good & simple reference; but unfortunately,
  I can't find a full set of system and userspace software to get it running.  Any
  leads here?

* Even though there is no bus, does it make sense to pretend there is a PCI bus?
  I had the idea that this might be the quickest bringup, since it would require
  minimal porting on the kernel side: QEMU populates the PCI config space with the
  virtio-net device and Linux auto-detects at boot.  If it's equivalent effort to
  configure and connect the virtio-net device directly, I'd rather not pretend PCI.

All ideas, leads and advice gratefully accepted.

G

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

* Re: [Qemu-devel] Virtio net bringup for new arch?
  2011-05-25 19:00 [Qemu-devel] Virtio net bringup for new arch? Greg McGary
@ 2011-05-25 20:10 ` Alexander Graf
  2011-05-25 20:22   ` Greg McGary
  0 siblings, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2011-05-25 20:10 UTC (permalink / raw)
  To: Greg McGary; +Cc: qemu-devel


On 25.05.2011, at 21:00, Greg McGary wrote:

> I have a new architecture port that can boot linux and work interactively with a UART.
> The next step to facilitate application development is to have NFS filesystems.  The
> real HW has no bus--it will have some sort of shared-memory, SW-arbitrated access to a
> control processor's devices.  For development on QEMU, I'm guessing the easiest way to
> fake a network is to use virtio-net, since linux kernel and QEMU both support it.
> Perhaps when it comes time to implement the network link to the control-processor,
> virtio-net will be the best choice there as well.
> 
> Now, I need to know how to glue it all together.  Questions:
> 
> * the Syborg virtual board seemed like a good & simple reference; but unfortunately,
>  I can't find a full set of system and userspace software to get it running.  Any
>  leads here?
> 
> * Even though there is no bus, does it make sense to pretend there is a PCI bus?
>  I had the idea that this might be the quickest bringup, since it would require
>  minimal porting on the kernel side: QEMU populates the PCI config space with the
>  virtio-net device and Linux auto-detects at boot.  If it's equivalent effort to
>  configure and connect the virtio-net device directly, I'd rather not pretend PCI.

Virtio has pretty strict interfaces between several components:

bus
ring
device

In your case, this would be:

virtio-pci
virtio-ring
virtio-net

Now, if your device can do MMIO even on real hardware, that'd certainly ease a lot of things for you, as you could just reuse all the hardware emulation in Qemu and get Linux drivers for free as well. It would certainly save you from a lot of headaches. Since you have a UART working, I assume you do have MMIO?

If you can't do MMIO, take a look at the virtio-s390 bus. It's emulated in Qemu and also implemented in Linux and basically does hypercalls and shared memory instead of MMIO.


Alex

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

* Re: [Qemu-devel] Virtio net bringup for new arch?
  2011-05-25 20:10 ` Alexander Graf
@ 2011-05-25 20:22   ` Greg McGary
  2011-05-25 20:48     ` Alexander Graf
  2011-05-25 21:33     ` Richard Henderson
  0 siblings, 2 replies; 5+ messages in thread
From: Greg McGary @ 2011-05-25 20:22 UTC (permalink / raw)
  To: Alexander Graf; +Cc: qemu-devel, Greg McGary

On 05/25/11 13:10, Alexander Graf wrote:
> Now, if your device can do MMIO even on real hardware, that'd certainly ease a lot of things for you, as you could just reuse all the hardware emulation in Qemu and get Linux drivers for free as well. It would certainly save you from a lot of headaches. Since you have a UART working, I assume you do have MMIO?

MMIO, yes.  Any opinion on whether or not to have a minimal fake PCI bus?
G

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

* Re: [Qemu-devel] Virtio net bringup for new arch?
  2011-05-25 20:22   ` Greg McGary
@ 2011-05-25 20:48     ` Alexander Graf
  2011-05-25 21:33     ` Richard Henderson
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2011-05-25 20:48 UTC (permalink / raw)
  To: Greg McGary; +Cc: qemu-devel


On 25.05.2011, at 22:22, Greg McGary wrote:

> On 05/25/11 13:10, Alexander Graf wrote:
>> Now, if your device can do MMIO even on real hardware, that'd certainly ease a lot of things for you, as you could just reuse all the hardware emulation in Qemu and get Linux drivers for free as well. It would certainly save you from a lot of headaches. Since you have a UART working, I assume you do have MMIO?
> 
> MMIO, yes.  Any opinion on whether or not to have a minimal fake PCI bus?

Why not just use a real existing one?

Alex

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

* Re: [Qemu-devel] Virtio net bringup for new arch?
  2011-05-25 20:22   ` Greg McGary
  2011-05-25 20:48     ` Alexander Graf
@ 2011-05-25 21:33     ` Richard Henderson
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2011-05-25 21:33 UTC (permalink / raw)
  To: Greg McGary; +Cc: Alexander Graf, qemu-devel

On 05/25/2011 01:22 PM, Greg McGary wrote:
> MMIO, yes.  Any opinion on whether or not to have a minimal fake PCI bus?

It's probably easiest to pretend your HW has PCI, yes.

Alex is suggesting that it would be easier to pretend you have
one of the existing PCI host controllers as well.  I don't know
if that's true or not; e.g. pc_piix.c seems to have lots of
pc-specific stuff inside.

But it probably doesn't take more than 100 lines of code to give
guest access to the pci config and i/o space.  It's likely to be
comparable in size to any other private bus that you'd invent.


r~

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

end of thread, other threads:[~2011-05-25 21:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-25 19:00 [Qemu-devel] Virtio net bringup for new arch? Greg McGary
2011-05-25 20:10 ` Alexander Graf
2011-05-25 20:22   ` Greg McGary
2011-05-25 20:48     ` Alexander Graf
2011-05-25 21:33     ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).