mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: Angus Chen <angus.chen@jaguarmicro.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"will@kernel.org" <will@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"iommu@lists.linux.dev" <iommu@lists.linux.dev>
Subject: Re: [PATCH] iommu: Distinguish between sw-msi and msi
Date: Tue, 22 Oct 2024 13:30:51 +0100	[thread overview]
Message-ID: <aa07f3e8-0f68-4772-975f-d9deefd7a019@arm.com> (raw)
In-Reply-To: <TY0PR06MB49849D564F3FFE2E1957F4AF854C2@TY0PR06MB4984.apcprd06.prod.outlook.com>

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.

      reply	other threads:[~2024-10-22 12:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21 11:34 Angus Chen
2024-10-21 11:58 ` Robin Murphy
2024-10-22 12:02   ` Angus Chen
2024-10-22 12:30     ` Robin Murphy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa07f3e8-0f68-4772-975f-d9deefd7a019@arm.com \
    --to=robin.murphy@arm.com \
    --cc=angus.chen@jaguarmicro.com \
    --cc=iommu@lists.linux.dev \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®