From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: RFC: [PATCH 1/3] Enhance platform support for PCI Date: Thu, 26 Feb 2015 13:58:10 +0000 Message-ID: <54EF2672.6050006@linaro.org> References: <54E71BDE.5020106@caviumnetworks.com> <54E7229C.7000301@linaro.org> <54E72452.3090801@caviumnetworks.com> <54E72688.9010005@linaro.org> <54E729F1.6000804@caviumnetworks.com> <54E73010.2050902@caviumnetworks.com> <1424439941.30924.243.camel@citrix.com> <54E74135.4040302@caviumnetworks.com> <1424443185.30924.268.camel@citrix.com> <54EB0813.20909@caviumnetworks.com> <54EB0B7D.6060909@linaro.org> <54EB1401.2050609@caviumnetworks.com> <54EB440C.9010806@linaro.org> <54EB5F86.40607@caviumnetworks.com> <54EB9E13.7060802@linaro.org> <54EBC47E.4040801@caviumnetworks.com> <54EC8007.1090405@linaro.org> <54ED345C.8020902@caviumnetworks.com> <1424859603.20243.71.camel@citrix.com> <1424949153.14641.30.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1424949153.14641.30.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , Vijay Kilari Cc: prasun.kapoor@cavium.com, Manish Jaggi , "Kumar, Vijaya" , "xen-devel@lists.xen.org" , "Stefano Stabellini (Stefano.Stabellini@citrix.com)" , Jan Beulich List-Id: xen-devel@lists.xenproject.org Hi Ian, On 26/02/15 11:12, Ian Campbell wrote: >> I have few queries >> >> 1) If Dom0 has 'n' ITS nodes, then how does Xen know which virtual ITS >> command Q is >> mapped to which Physical ITS command Q. >> In case of linux, the ITS node is added as msi chip to pci using >> of_pci_msi_chip_add() >> and from pci_dev structure we can know which ITS to use. >> >> But in case of Xen, when ITS command is trapped we have only >> dev_id info from ITS command. > > With the proper PCI infrastructure in place we can map the vdev_id to a > pdev_id, and from there to our own struct pci_dev > > The mapping from pdev_id to pci_dev is based on the > PHYSDEVOP_pci_host_bridge_add and PHYSDEVOP_pci_device_add calls I > described just now in my mail to Manish in this thread (specifically > pci_device_add creates and registers struct pci_dev I think). We may need an hypercall to map the dev_id to a vdev_id. IIRC, Vijay and Manish was already planned to add one. > >> >> 2) If DomU is always given one virtual ITS node. If DomU is assinged >> with two different >> PCI devices connected to different physical ITS, then Xen vITS >> driver should know how to map >> PCI device to physical ITS > > Correct, I think that all falls out from the proper tracking of the > vdev_id to pdev_id and from vits to pits for a given domain and the > management/tracking of the struct pci_dev. I think this is the right way to go. Though I haven't read the ITS spec closely. Regards, -- Julien Grall