Re: [RFC PATCH v2] iommu/xen: Add Xen PV-IOMMU driver

2024-06-26 Thread Teddy Astie
Hello Robin, Le 26/06/2024 à 14:09, Robin Murphy a écrit : > On 2024-06-24 3:36 pm, Teddy Astie wrote: >> Hello Robin, >> Thanks for the thourough review. >> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 0af39bbbe3a3..242cefac77c9 100644 --- a/drivers/iommu/Kconfi

Re: [RFC PATCH v2] iommu/xen: Add Xen PV-IOMMU driver

2024-06-26 Thread Robin Murphy
On 2024-06-24 3:36 pm, Teddy Astie wrote: Hello Robin, Thanks for the thourough review. diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 0af39bbbe3a3..242cefac77c9 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -480,6 +480,15 @@ config VIRTIO_IOMMU     Sa

Re: [RFC PATCH v2] iommu/xen: Add Xen PV-IOMMU driver

2024-06-24 Thread Easwar Hariharan
Hi Jason, On 6/24/2024 9:32 AM, Jason Gunthorpe wrote: > On Mon, Jun 24, 2024 at 02:36:45PM +, Teddy Astie wrote: +bool xen_iommu_capable(struct device *dev, enum iommu_cap cap) +{ +    switch (cap) { +    case IOMMU_CAP_CACHE_COHERENCY: +    return true; >>> >>> W

Re: [RFC PATCH v2] iommu/xen: Add Xen PV-IOMMU driver

2024-06-24 Thread Robin Murphy
On 2024-06-24 6:36 pm, Easwar Hariharan wrote: Hi Jason, On 6/24/2024 9:32 AM, Jason Gunthorpe wrote: On Mon, Jun 24, 2024 at 02:36:45PM +, Teddy Astie wrote: +bool xen_iommu_capable(struct device *dev, enum iommu_cap cap) +{ +    switch (cap) { +    case IOMMU_CAP_CACHE_COHERENCY: +  

Re: [RFC PATCH v2] iommu/xen: Add Xen PV-IOMMU driver

2024-06-24 Thread Jason Gunthorpe
On Mon, Jun 24, 2024 at 10:36:13AM -0700, Easwar Hariharan wrote: > Hi Jason, > > On 6/24/2024 9:32 AM, Jason Gunthorpe wrote: > > On Mon, Jun 24, 2024 at 02:36:45PM +, Teddy Astie wrote: > +bool xen_iommu_capable(struct device *dev, enum iommu_cap cap) > +{ > +    switch (cap)

Re: [RFC PATCH v2] iommu/xen: Add Xen PV-IOMMU driver

2024-06-24 Thread Jason Gunthorpe
On Mon, Jun 24, 2024 at 02:36:45PM +, Teddy Astie wrote: > >> +bool xen_iommu_capable(struct device *dev, enum iommu_cap cap) > >> +{ > >> +    switch (cap) { > >> +    case IOMMU_CAP_CACHE_COHERENCY: > >> +    return true; > > > > Will the PV-IOMMU only ever be exposed on hardware where th

Re: [RFC PATCH v2] iommu/xen: Add Xen PV-IOMMU driver

2024-06-24 Thread Teddy Astie
Hello Robin, Thanks for the thourough review. >> diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig >> index 0af39bbbe3a3..242cefac77c9 100644 >> --- a/drivers/iommu/Kconfig >> +++ b/drivers/iommu/Kconfig >> @@ -480,6 +480,15 @@ config VIRTIO_IOMMU >>     Say Y here if you intend to ru

Re: [RFC PATCH v2] iommu/xen: Add Xen PV-IOMMU driver

2024-06-21 Thread Robin Murphy
On 2024-06-21 5:08 pm, TSnake41 wrote: From: Teddy Astie In the context of Xen, Linux runs as Dom0 and doesn't have access to the machine IOMMU. Although, a IOMMU is mandatory to use some kernel features such as VFIO or DMA protection. In Xen, we added a paravirtualized IOMMU with iommu_op hyp

[RFC PATCH v2] iommu/xen: Add Xen PV-IOMMU driver

2024-06-21 Thread TSnake41
From: Teddy Astie In the context of Xen, Linux runs as Dom0 and doesn't have access to the machine IOMMU. Although, a IOMMU is mandatory to use some kernel features such as VFIO or DMA protection. In Xen, we added a paravirtualized IOMMU with iommu_op hypercall in order to allow Dom0 to implemen