Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-02-07 Thread Thomas Gleixner
On Fri, Feb 07 2025 at 10:34, Jason Gunthorpe wrote: > On Fri, Jan 10, 2025 at 07:32:16PM -0800, Nicolin Chen wrote: >> Though these two approaches feel very different on the surface, they can >> share some underlying common infrastructure. Currently, only one pair of >> sw_msi functions (prepare/c

Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-02-07 Thread Jason Gunthorpe
On Fri, Jan 10, 2025 at 07:32:16PM -0800, Nicolin Chen wrote: > Though these two approaches feel very different on the surface, they can > share some underlying common infrastructure. Currently, only one pair of > sw_msi functions (prepare/compose) are provided by dma-iommu for irqchip > drivers to

Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-02-05 Thread Nicolin Chen
On Wed, Feb 05, 2025 at 02:49:04PM -0800, Jacob Pan wrote: > > There have been two approaches to solve this problem: > > 1. Create an identity mapping in the stage-1. VMM could insert a few > > RMRs (Reserved Memory Regions) in guest's IORT. Then the guest kernel > > would fetch these RMR entries f

Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-02-05 Thread Jacob Pan
Hi Nicolin, On Fri, 10 Jan 2025 19:32:16 -0800 Nicolin Chen wrote: > [ Background ] > On ARM GIC systems and others, the target address of the MSI is > translated by the IOMMU. For GIC, the MSI address page is called > "ITS" page. When the IOMMU is disabled, the MSI address is programmed > to th

Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-02-04 Thread Jason Gunthorpe
On Tue, Feb 04, 2025 at 01:55:01PM +0100, Eric Auger wrote: > OK so you need to set host sw_msi_start to the guest doorbell GPA which > is currently set, in qemu, at > GITS_TRANSLATER 0x0808 + 0x1 Yes (but don't do this except for testing) The challenge that remains is how to build an AP

Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-02-04 Thread Eric Auger
Hi Jason, On 1/29/25 9:13 PM, Jason Gunthorpe wrote: > On Wed, Jan 29, 2025 at 06:46:20PM +0100, Eric Auger wrote: > This missing peice is cleaning up the ITS mapping to allow for > multiple ITS pages. I've imagined that kvm would someone give iommufd > a FD that holds the specific IT

Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-01-29 Thread Jason Gunthorpe
On Wed, Jan 29, 2025 at 06:46:20PM +0100, Eric Auger wrote: > >>> This missing peice is cleaning up the ITS mapping to allow for > >>> multiple ITS pages. I've imagined that kvm would someone give iommufd > >>> a FD that holds the specific ITS pages instead of the > >>> IOMMU_OPTION_SW_MSI_START/SI

Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-01-29 Thread Eric Auger
On 1/29/25 4:04 PM, Jason Gunthorpe wrote: > On Wed, Jan 29, 2025 at 03:54:48PM +0100, Eric Auger wrote: or you are just mentioning it here because it is still possible to make use of that. I think from previous discussions the argument was to adopt a more dedicated MSI pas

Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-01-29 Thread Jason Gunthorpe
On Wed, Jan 29, 2025 at 03:54:48PM +0100, Eric Auger wrote: > >> or you are just mentioning it here because > >> it is still possible to make use of that. I think from previous > >> discussions the > >> argument was to adopt a more dedicated MSI pass-through model which I > >> think is approach-2

Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-01-29 Thread Eric Auger
Hi Jason, On 1/23/25 2:24 PM, Jason Gunthorpe wrote: > On Thu, Jan 23, 2025 at 09:06:49AM +, Shameerali Kolothum Thodi wrote: > >> One confusion I have about the above text is, do we still plan to support the >> approach -1( Using RMR in Qemu) > Yes, it remains an option. The VMM would use t

Re: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-01-23 Thread Jason Gunthorpe
On Thu, Jan 23, 2025 at 09:06:49AM +, Shameerali Kolothum Thodi wrote: > One confusion I have about the above text is, do we still plan to support the > approach -1( Using RMR in Qemu) Yes, it remains an option. The VMM would use the IOMMU_OPTION_SW_MSI_START/SIZE ioctls to tell the kernel wh

RE: [PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-01-23 Thread Shameerali Kolothum Thodi
er...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; > k...@vger.kernel.org; linux-kselft...@vger.kernel.org; > patc...@lists.linux.dev; jean-phili...@linaro.org; m...@kernel.org; > msha...@google.com; Shameerali Kolothum Thodi > ; smost...@google.com; > ddut...@redhat.com > Subje

[PATCH RFCv2 00/13] iommu: Add MSI mapping support with nested SMMU

2025-01-10 Thread Nicolin Chen
[ Background ] On ARM GIC systems and others, the target address of the MSI is translated by the IOMMU. For GIC, the MSI address page is called "ITS" page. When the IOMMU is disabled, the MSI address is programmed to the physical location of the GIC ITS page (e.g. 0x2020). When the IOMMU is ena