[Xen-devel] Pass through in Xen
Hi, I am trying to learn how Passthrough works in xen. As an initial step I have tried to do PCI passthrough in my PC with Ubuntu 16.04 LTS (Xenial Xerus) as Dom0 and DomU. For that I had to rebuild the kernel to add xen support and with the procedure explained in, https://wiki.xenproject.org/wiki/Xen_PCI_Passthrough I have successfully tested a PCI device in my PC. As per my current understanding, the control flow for PCI passthrough is “xen-pcifront -> xen-pciback -> driver”. Is this correct? Should the Dom0 and DomU have the Driver enabled in there kernel? Can anyone please explain or point me to a thread where I can read about the internals of PCI passthrough or How passthrough actually works? Please Help. regards, Ajmal ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] XEN on R-Car H3 starter kit
Hi, I am using R-Car H3 hardware. ie. R-Car H3 Salvator-X. I am running Xen with Poky linux as Dom0 and DomU. Would i be able to run Xen with the same setup on R-Car H3 Starter Kit? What all should i look in a Hardware to run XEN in it? regards, Ajeesh ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] Pass through in Xen
Hi, >> > Can anyone please explain or point me to a thread where I can read about >> > the internals of PCI passthrough or How passthrough actually works? >> >> For PV: >> >> http://elixir.free-electrons.com/linux/latest/source/drivers/xen/xen-pciback >> http://elixir.free-electrons.com/linux/latest/source/drivers/pci/xen-pcifront.c I tried going through the source code but I'am unable to derive a flow of control through the drivers. Is there any source which can explain the behavior of these drivers elaborately? How are xen-pciback and xen-pcifront utilizing the PCI functions offered by Linux? Regards, Ajmal On 18-Jul-2017 4:53 PM, Roger Pau Monné wrote:On Tue, Jul 18, 2017 at 04:43:53PM +0530, ajmalmalib4u wrote: > Hi, > > I am trying to learn how Passthrough works in xen. As an initial step I > have tried to do PCI passthrough in my PC with Ubuntu 16.04 LTS (Xenial > Xerus) as Dom0 and DomU. For that I had to rebuild the kernel to add xen > support and with the procedure explained in, > > https://wiki.xenproject.org/wiki/Xen_PCI_Passthrough Not really sure whether you need to do that anymore, I would expect Ubuntu to ship a kernel with pcifront/pciback already enabled, at least as modules. > I have successfully tested a PCI device in my PC. > As per my current understanding, the control flow for PCI passthrough is > “xen-pcifront -> xen-pciback -> driver”. Is this correct? That's for PV guests, and only for accesses to the PCI config space. Device MMIO rehions are mapped directy into DomU. For HVM guests QEMU is used instead, which emulates and forwards PCI config space accesses from DomU to the real hardware. > Should the Dom0 and DomU have the Driver enabled in there kernel? Which Driver? If you mean the device driver, then yes, you need a driver in order to operate the hardware in DomU, just as you do on native. It's not needed on Dom0 if you never plan to use the device on Dom0. > Can anyone please explain or point me to a thread where I can read about > the internals of PCI passthrough or How passthrough actually works? For PV: http://elixir.free-electrons.com/linux/latest/source/drivers/xen/xen-pciback http://elixir.free-electrons.com/linux/latest/source/drivers/pci/xen-pcifront.c For HVM: http://git.qemu.org/?p=qemu.git;a=blob;f=hw/xen/xen_pt.c http://git.qemu.org/?p=qemu.git;a=blob;f=hw/xen/xen_pt_config_init.c http://git.qemu.org/?p=qemu.git;a=blob;f=hw/xen/xen_pt_graphics.c http://git.qemu.org/?p=qemu.git;a=blob;f=hw/xen/xen_pt_msi.c Roger. ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] USB Passthrough in X86
Hi, I am trying to do USB passthrough in x86_64. I have Ubuntu as Dom0 and DomU. Dom0 : Linux teltvm0881 4.8.0-58-generic #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux DomU : Linux xen-guest-pv 4.12.0-custom #4 SMP Tue Jul 11 17:14:53 IST 2017 x86_64 GNU/Linux I had earlier, rebuild the kernel from kernel.orgto add PCI passthrough support which was successful. But when i try to do USB passthrough, as given in, https://wiki.xenproject.org/wiki/Xen_USB_Passthrough it dont work.ie. # xl usbctrl-attach xen-guest-pv version=1 ports=8 libxl: error: libxl_dm.c:2423:libxl__dm_check_start: device model required but not running libxl: error: libxl.c:2012:device_addrm_aocomplete: unable to add device libxl_device_usbctrl_add failed. Why is this? i am trying to hotplug my usb. I haveint made any changes in the config file, as i assumed it wont be needed for hotplug, also i didnt have to do it for pci passthrough. Should i? Also, i cannot find any usbback and frond in my PC. # lsmod | grep pci xen_pciback 61440 0 but, # lsmod | grep usb back driver is not displayed. I tried to rebuild the kernel but I cannot find any configuration regarding usb in my kernel configuration. Is the usb passthrough support merged with the latest stable kernel in kernel.org? If yes, What all configuration should I enable in my config? Regards, Ajeesh ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] Pass through in Xen
Hi, >> > I have successfully tested a PCI device in my PC. >> > As per my current understanding, the control flow for PCI passthrough is >> > “xen-pcifront -> xen-pciback -> driver”. Is this correct? >> That's for PV guests, and only for accesses to the PCI config space. >> Device MMIO regions are mapped directly into DomU. I am using PV guests. Where does the PCI MMIO gets mapped to DomU? Is it done by the front and back drivers? Or Is the mapping only happening at the hardware level where IOMMU handles it without Dom0's or DomU's knowledge? If possible, could you please point me to the right source file or block of code in Xen source which handles this mapping of PCI memory regions? Also, Does the normal PCI driver in the Linux kernel plays any role in PCI passthrough? Or Is it the front and back drivers, that does all of it? Does the front and back drivers access the PCI driver in the Linux kernel at any point? Regards, Ajmal ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
Re: [Xen-devel] Pass through in Xen
Hi, I have read that “From a software standpoint, PCI and PCI Express devices are essentially the same. PCIe devices had the same configuration space, BARs, and (usually) support the same PCI INTx interrupts”. According to my understanding, PCI and PCIe are different kind of interfaces with different supporting features, though PCIe is designed to be like PCI. But Linux kernel seems to treat them equally from a software point of view. Will xen-pciback and xen-pcifront module support both PCI and PCIe devices? Can PCI passthrough in Xen support PCIe devices as well? Rgards, Ajmal ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel
[Xen-devel] Xen Backend for sound sharing for arm
Hi, I need to do sound sharing in RCar H3.I am currently using Xen 4.8.0. I tried to patch the guest kernel(v 4.6.0) using the patch series [[RESEND1,01/12] ALSA: vsnd: Introduce Xen para-virtualized sound frontend driver] to add the support for Xen para-virtualized sound frontend driver which was made available a few days ago. I got some errors which I guess were due to the old kernel version. So I downloaded the current stable Linux 4.12.5 from kernel.org and tried to add the patches to it. But the patch failed due to missing fields in snd_pcm_ops in pcm.h. As such, I had to patch the kernel with a different patch series[[v2,02/27] ALSA: pcm: Introduce copy_user, copy_kernel and fill_silence ops],[ALSA: sound/isa: constify snd_kcontrol_new structures][ALSA: gus: remove unused local flag] to add the new fields to pcm.h. Also, I had to copy an SoC specific firmware file[r8a779x_usb3_v2.dlmem] to the firmware directory of the kernel directory. Finally after applying all these patches to v4.12.5 and building the kernel, I got the snd-xen-front.ko file in sound/drivers/. How can I test whether the sound frontend is working? Is the backend for sound available for sndif.h? Regards, Ajmal ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel