|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [early RFC] ARM PCI Passthrough design document
Hi Roger, On 25/01/17 11:42, Roger Pau Monné wrote: On Tue, Jan 24, 2017 at 05:17:06PM +0000, Julien Grall wrote:On 06/01/17 15:12, Roger Pau Monné wrote:On Thu, Dec 29, 2016 at 02:04:15PM +0000, Julien Grall wrote: I agree here. I provided more feedback on an answer to Stefano, I would your input there to if possible. See <8ca91073-09e7-57ca-9063-b47e0aced39d@xxxxxxxxxx> [...]
I don't know much x86, but on ARM we could specify caching attributes in the stage-2 page tables (aka EPT on x86). The MMU will use the stricter memory attributes between stage-2 and the guest page tables. In the case of ECAM, we could disable the caching in stage-2 page tables. So the ECAM will always access uncached.
cfg_size would be a multiple of 4KB as each configuration space would have a unique region. But as you mentioned later we could re-use MMCFG_reserved. But to be fair, I think we can deal without this property. For ACPI, the size will vary following the number of bus handled and can be deduced. For DT, the base address and bus range should be enough to find the associated node.If that field is removed you could use the PHYSDEVOP_pci_mmcfg_reserved hypercalls.DOM0 will issue the hypercall PHYSDEVOP_pci_host_bridge_add for each host bridge available on the platform. When Xen is receiving the hypercall, the the driver associated to the host bridge will be instantiated. XXX: Shall we limit DOM0 the access to the configuration space from that moment?Most definitely yes, you should instantiate an emulated bridge over the real one, in order to proxy Dom0 accesses to the PCI configuration space. You for example don't want Dom0 moving the position of the BARs of PCI devices without Xen being aware (and properly changing the second stage translation).The problem is on ARM we don't have a single way to access the configuration space. So we would need different emulator in Xen, which I don't like unless there is a strong reason to do it. We could avoid DOM0s to modify the position of the BARs after setup. I also remembered you mention about MSI configuration, for ARM this is done via the interrupt controller.## Discovering and register PCI Similarly to x86, PCI devices will be discovered by DOM0 and register using the hypercalls PHYSDEVOP_pci_add_device or PHYSDEVOP_manage_pci_add_ext.Why do you need this? If you have access to the bridges you can scan them from Xen and discover the devices AFAICT.I am a bit confused. Are you saying that you plan to ditch them for PVH? If so, why are they called by Linux today?I think we can get away with PHYSDEVOP_pci_mmcfg_reserved only, but maybe I'm missing something. AFAICT Xen should be able to gather all the other data by itself from the PCI config space once it knows the details about the host bridge. From my understanding, some host bridges would need to be configured before been able to be used (TBC). Bringing this initialization in Xen may be complex. For instance the xgene hostbridge (see linux/drivers/pci/host/pci-xgene.c) will require to enable the clock. I would let the initialization of the hostbridge in Linux, so we are doing the scanning in Xen we will need an hypercall to let them knows the host bridges has been initialized. I gave a bit more background on my answer to Stefano. So I would recommend to continue the conversation there. By default all the PCI devices will be assigned to DOM0. So Xen would have to configure the SMMU and Interrupt Controller to allow DOM0 to use the PCI devices. As mentioned earlier, those subsystems will require the StreamID and DeviceID. Both can be deduced from the RID. XXX: How to hide PCI devices from DOM0?By adding the ACPI namespace of the device to the STAO and blocking Dom0 access to this device in the emulated bridge that Dom0 will have access to (returning 0xFFFF when Dom0 tries to read the vendor ID from the PCI header).Sorry I was not clear here. By hiding, I meant DOM0 not instantiating a driver (similarly to xen-pciback.hide). We still want DOM0 to access the PCI config space in order to reset the device. Unless you plan to import all the reset quirks in Xen?I don't have a clear opinion here, and I don't know all thew details of this reset hacks. Actually I looked at the Linux code (see __pci_dev_reset in drivers/pci/pci.c) and there are less quirks than I expected. The list of quirks can be found in pci_dev_reset_methods in drivers/pci/quirks.c. There are few way to reset a device (see __pci_dev_reset), they look all based on accessing the configuration space. So I guess it should be fine to import that in Xen. Any opinions? Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |