Re: [PATCH v3 03/15] hw/pci: Add a pci_device_iommu_memory_region() helper

2023-06-06 Thread Joao Martins
On 06/06/2023 16:05, Peter Xu wrote: > On Tue, Jun 06, 2023 at 11:03:11AM -0400, Peter Xu wrote: >> On Tue, Jun 06, 2023 at 12:22:16PM +0100, Joao Martins wrote: >>> On 05/06/2023 17:57, Peter Xu wrote: On Tue, May 30, 2023 at 06:59:25PM +0100, Joao Martins wrote: > Much like pci_device_io

Re: [PATCH v3 03/15] hw/pci: Add a pci_device_iommu_memory_region() helper

2023-06-06 Thread Peter Xu
[ I forgot to really copy anyone, as usual.. trying again ] On Tue, Jun 06, 2023 at 11:03:11AM -0400, Peter Xu wrote: > On Tue, Jun 06, 2023 at 12:22:16PM +0100, Joao Martins wrote: > > On 05/06/2023 17:57, Peter Xu wrote: > > > On Tue, May 30, 2023 at 06:59:25PM +0100, Joao Martins wrote: > > >>

Re: [PATCH v3 03/15] hw/pci: Add a pci_device_iommu_memory_region() helper

2023-06-06 Thread Peter Xu
On Tue, Jun 06, 2023 at 12:22:16PM +0100, Joao Martins wrote: > On 05/06/2023 17:57, Peter Xu wrote: > > On Tue, May 30, 2023 at 06:59:25PM +0100, Joao Martins wrote: > >> Much like pci_device_iommu_address_space() fetches the IOMMU AS, add a > >> pci_device_iommu_memory_region() which lets it retu

Re: [PATCH v3 03/15] hw/pci: Add a pci_device_iommu_memory_region() helper

2023-06-06 Thread Joao Martins
On 05/06/2023 17:57, Peter Xu wrote: > On Tue, May 30, 2023 at 06:59:25PM +0100, Joao Martins wrote: >> Much like pci_device_iommu_address_space() fetches the IOMMU AS, add a >> pci_device_iommu_memory_region() which lets it return an the IOMMU MR >> associated with it. The IOMMU MR is returned cor

Re: [PATCH v3 03/15] hw/pci: Add a pci_device_iommu_memory_region() helper

2023-06-05 Thread Peter Xu
On Tue, May 30, 2023 at 06:59:25PM +0100, Joao Martins wrote: > Much like pci_device_iommu_address_space() fetches the IOMMU AS, add a > pci_device_iommu_memory_region() which lets it return an the IOMMU MR > associated with it. The IOMMU MR is returned correctly for vIOMMUs using > pci_setup_iommu

[PATCH v3 03/15] hw/pci: Add a pci_device_iommu_memory_region() helper

2023-05-30 Thread Joao Martins
Today's VFIO model of understanding if an IOMMU is behind the PCIDevice is to check whether the address space backing the device is memory or not, which is done via pci_device_iommu_address_space(pdev). On the other hand, the IOMMU MR is used for example to fetch attributes, or when doing an vIOMM