Hi Stefano, > On 16 Sep 2021, at 9:26 pm, Stefano Stabellini <sstabell...@kernel.org> wrote: > > On Thu, 16 Sep 2021, Rahul Singh wrote: >> Hi Stefano, >> >>> On 10 Sep 2021, at 1:26 am, Stefano Stabellini <sstabell...@kernel.org> >>> wrote: >>> >>> On Thu, 19 Aug 2021, Rahul Singh wrote: >>>> The existing VPCI support available for X86 is adapted for Arm. >>>> When the device is added to XEN via the hyper call >>>> “PHYSDEVOP_pci_device_add”, VPCI handler for the config space >>>> access is added to the Xen to emulate the PCI devices config space. >>> >>> This is done just for device discovery, right? >>> >>> Although it is currently not implemented (and I am not asking to >>> implement it now, I am only trying to understand the architecture), it >>> would be possible to discover all PCI devices just by walking down the >>> PCI hierarchy by ourselves in Xen (no Dom0 interactions) given that we >>> have an ECAM driver. >>> >>> I take that would be the way to implement PCI support for Dom0less? >> >> It is not possible to discover PCI devices in XEN if enumeration is not done >> before XEN boot. >> If boot firmware did the enumeration, XEN will discover the PCI device. > > OK, but if the boot firmware does the enumeration, how will Xen discover > the PCI device exactly? Will Xen discover it because the PCI device will > be present in device tree explicitly (will have its own device tree > node)? Or will Xen discover it by walking the PCI bus?
Yes Xen discover it by walking the PCI bus. There is already a function in XEN scan_pci_devices() that we can use to discover the PCI device for dom0less system. Regards, Rahul