mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iommu: Distinguish between sw-msi and msi
@ 2024-10-21 11:34 Angus Chen
  2024-10-21 11:58 ` Robin Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Angus Chen @ 2024-10-21 11:34 UTC (permalink / raw)
  To: joro, will, robin.murphy; +Cc: linux-kernel, iommu, Angus Chen

iommu_group_resv_type_string use the same string of IOMMU_RESV_MSI
and IOMMU_RESV_SW_MSI, Make a distinction for these.

Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
---
 drivers/iommu/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 83c8e617a2c5..8a2bbb5c4a91 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -84,7 +84,7 @@ static const char * const iommu_group_resv_type_string[] = {
 	[IOMMU_RESV_DIRECT_RELAXABLE]		= "direct-relaxable",
 	[IOMMU_RESV_RESERVED]			= "reserved",
 	[IOMMU_RESV_MSI]			= "msi",
-	[IOMMU_RESV_SW_MSI]			= "msi",
+	[IOMMU_RESV_SW_MSI]			= "sw-msi",
 };
 
 #define IOMMU_CMD_LINE_DMA_API		BIT(0)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iommu: Distinguish between sw-msi and msi
  2024-10-21 11:34 [PATCH] iommu: Distinguish between sw-msi and msi Angus Chen
@ 2024-10-21 11:58 ` Robin Murphy
  2024-10-22 12:02   ` Angus Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Murphy @ 2024-10-21 11:58 UTC (permalink / raw)
  To: Angus Chen, joro, will; +Cc: linux-kernel, iommu

On 2024-10-21 12:34 pm, Angus Chen wrote:
> iommu_group_resv_type_string use the same string of IOMMU_RESV_MSI
> and IOMMU_RESV_SW_MSI, Make a distinction for these.

Why? What in userspace needs to know the exact details of how the kernel 
and the underlying hardware are routing MSIs?

Thanks,
Robin.

> Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
> ---
>   drivers/iommu/iommu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 83c8e617a2c5..8a2bbb5c4a91 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -84,7 +84,7 @@ static const char * const iommu_group_resv_type_string[] = {
>   	[IOMMU_RESV_DIRECT_RELAXABLE]		= "direct-relaxable",
>   	[IOMMU_RESV_RESERVED]			= "reserved",
>   	[IOMMU_RESV_MSI]			= "msi",
> -	[IOMMU_RESV_SW_MSI]			= "msi",
> +	[IOMMU_RESV_SW_MSI]			= "sw-msi",
>   };
>   
>   #define IOMMU_CMD_LINE_DMA_API		BIT(0)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] iommu: Distinguish between sw-msi and msi
  2024-10-21 11:58 ` Robin Murphy
@ 2024-10-22 12:02   ` Angus Chen
  2024-10-22 12:30     ` Robin Murphy
  0 siblings, 1 reply; 4+ messages in thread
From: Angus Chen @ 2024-10-22 12:02 UTC (permalink / raw)
  To: Robin Murphy, joro, will; +Cc: linux-kernel, iommu

Hi robin。

> -----Original Message-----
> From: Robin Murphy <robin.murphy@arm.com>
> Sent: Monday, October 21, 2024 7:59 PM
> To: Angus Chen <angus.chen@jaguarmicro.com>; joro@8bytes.org;
> will@kernel.org
> Cc: linux-kernel@vger.kernel.org; iommu@lists.linux.dev
> Subject: Re: [PATCH] iommu: Distinguish between sw-msi and msi
> 
> On 2024-10-21 12:34 pm, Angus Chen wrote:
> > iommu_group_resv_type_string use the same string of IOMMU_RESV_MSI
> > and IOMMU_RESV_SW_MSI, Make a distinction for these.
> 
> Why? What in userspace needs to know the exact details of how the kernel
> and the underlying hardware are routing MSIs?
We use smmu-v3 for a dpu design,and we set a private region to handle msi region like x86.
We set some private iommu register to control this.
If some customer want to use their os like openouler, we use sw-msi mode.
If some customer want to use our customize os ,we will set msi private.
Some customer use openouler and we private smmu-v3 module at the same time,

So I want to use reserve-type to distinguish between sw-msi and msi.
> 
> Thanks,
> Robin.
> 
> > Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
> > ---
> >   drivers/iommu/iommu.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> > index 83c8e617a2c5..8a2bbb5c4a91 100644
> > --- a/drivers/iommu/iommu.c
> > +++ b/drivers/iommu/iommu.c
> > @@ -84,7 +84,7 @@ static const char * const
> iommu_group_resv_type_string[] = {
> >   	[IOMMU_RESV_DIRECT_RELAXABLE]		= "direct-relaxable",
> >   	[IOMMU_RESV_RESERVED]			= "reserved",
> >   	[IOMMU_RESV_MSI]			= "msi",
> > -	[IOMMU_RESV_SW_MSI]			= "msi",
> > +	[IOMMU_RESV_SW_MSI]			= "sw-msi",
> >   };
> >
> >   #define IOMMU_CMD_LINE_DMA_API		BIT(0)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iommu: Distinguish between sw-msi and msi
  2024-10-22 12:02   ` Angus Chen
@ 2024-10-22 12:30     ` Robin Murphy
  0 siblings, 0 replies; 4+ messages in thread
From: Robin Murphy @ 2024-10-22 12:30 UTC (permalink / raw)
  To: Angus Chen, joro, will; +Cc: linux-kernel, iommu

On 22/10/2024 1:02 pm, Angus Chen wrote:
> Hi robin。
> 
>> -----Original Message-----
>> From: Robin Murphy <robin.murphy@arm.com>
>> Sent: Monday, October 21, 2024 7:59 PM
>> To: Angus Chen <angus.chen@jaguarmicro.com>; joro@8bytes.org;
>> will@kernel.org
>> Cc: linux-kernel@vger.kernel.org; iommu@lists.linux.dev
>> Subject: Re: [PATCH] iommu: Distinguish between sw-msi and msi
>>
>> On 2024-10-21 12:34 pm, Angus Chen wrote:
>>> iommu_group_resv_type_string use the same string of IOMMU_RESV_MSI
>>> and IOMMU_RESV_SW_MSI, Make a distinction for these.
>>
>> Why? What in userspace needs to know the exact details of how the kernel
>> and the underlying hardware are routing MSIs?
> We use smmu-v3 for a dpu design,and we set a private region to handle msi region like x86.
> We set some private iommu register to control this.
> If some customer want to use their os like openouler, we use sw-msi mode.
> If some customer want to use our customize os ,we will set msi private.
> Some customer use openouler and we private smmu-v3 module at the same time,
> 
> So I want to use reserve-type to distinguish between sw-msi and msi.

But *why*? What do you expect userspace to do with this information? It 
was a deliberate choice not to expose this distinction, precisely 
*because* it should make no difference to a VFIO user whether an MSI 
address range is defined by the platform or by the IOMMU driver, and if 
userspace did think it wants to know that then it's probably doing 
something wrong. IIRC, the reason for distinguishing "msi" from 
"reserved" at all was just as a hint to userspace that although the 
address range is still not usable for remapping memory, it's a good 
place for a VMM to put an emulated MSI doorbell in GPA/IPA space.

Also, this has been userspace ABI since 2017, and changing it has a high 
risk of breaking existing users who are looking for an "msi" region, so no.

Thanks,
Robin.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-22 12:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-21 11:34 [PATCH] iommu: Distinguish between sw-msi and msi Angus Chen
2024-10-21 11:58 ` Robin Murphy
2024-10-22 12:02   ` Angus Chen
2024-10-22 12:30     ` Robin Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®