On 16/07/14 07:12, Xenbegn developer wrote: > Hi, > I am trying to understand the flow of how a PCI device driver in domU > works after a PCI device is is assigned to a domU. > > a) If a PCI device is assigned to a domU, this device has to be on a > PCI bus. So as per my view xen would have to somehow provide a PCI > Controller on which this device is attached. > => Is my assumption correct ? If yes how it is done, No then also How > enumeration of this device happens in domU kernel No. PV guests have no PCI root ports/bridges; they use devices as single entities knowing that Xen/dom0 takes care of the other bits. HVM guests have their PCI devices attached to the virtual southbridge which is all emulated by Qemu. > > b) Is the Configuration space of the PCI device directly accessible to > the domU (assuming the kernel accesses it using memory map) ? If not > then it is trapped by xen All configuration space is trap+emulate in Xen, although almost all operations permitted. > > c) Who assigns the MSI (addr + value) in the PCI device. If Xen then > how Xen does a translation from Physical MSI to guest MSI (where in code) Xen controls all interrupts on the system, which is why it needs to trap all config accesses to notice when a domain is attempting to change the interrupt information. In that case, Xen fixes up its delivery of interrupts to the guest, but leaves the underlying interrupt information intact. ~Andrew