[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] patch to assign PCI device on VM without address translation


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: leonard michelet <leonard.michelet@xxxxxxxxx>
  • Date: Fri, 20 Mar 2009 16:55:20 +0100
  • Delivery-date: Fri, 20 Mar 2009 08:55:50 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=TB5QZTgpwSnsfzEqc+OJ0XQYZn17G4bOHmFhwed12nqhlZ0XyFNDi+UlibMoX/+bn4 g+oJLztXj23EJfGpWg+tEzcqzxFryM2pT05nOJ07ZOCv4U2/Kqq+ZD3CkrtM7+DlYjcC x4Gqil+ZcZSjhDTbcdfMeuSRrlsOtVcJ7VA34=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

Hi everybody,
we are two french students working for EADS to assign PCI device to VM with Xen.
We had a problem to use some National Instruments PCI Card. These cards have 2 Base Address Register of 4K each, and their driver write in the BAR1's address in a register of BAR0. But since the driver can't know physical addresses, it write the wrong address, and the card can't initialize her BAR.
We worked on it several days, and come up with a solution : force physical and virtual BAR addresses to match.
We are currently doing that thanks to a small change in the function "pt_pci_write_config" in the file tools/ioemu-remote/hw/pass-through.c from the xen unstable tree.
We add a "if" which check what BAR address the function has be given as argument. If this address is the usual address where Xen map the BAR of our card, we change it's value for the physical one.
We made tests with this patch, and our cards worked fine.
So we would like to make a patch for Xen to add a mode "1:1 mapping" for assigned device, using a configuration file (something like the xend-pci-quirks.sxp file in etc/xen) where each users could add their own card.

Since we set our background, and if you're still reading, we assume that you think this patch could be useful.
Now, it's question time :
    Do you think we should move virtual addresses to match physical addresses (changes in QEmu) or move physical addresses to match virtual adresses (change in Dom0)?
    Do you have any idea how addresses are choosen, in a VM or in the Dom0, or in which order?

Thanks to you for reading,
We'll be glad to hear your comment about our idea. Feel free to send us a private e-mail just to share your point of view, or answer on the mailing list.
Best regards,
Léonard & Guillaume


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.