mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sairaj Kodilkar <sarunkod@amd.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: <joro@8bytes.org>, <suravee.suthikulpanit@amd.com>,
	<will@kernel.org>, <robin.murphy@arm.com>, <kevin.tian@intel.com>,
	<iommu@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	<vasant.hegde@amd.com>
Subject: Re: [RFC PATCH] iommu/amd: Add control register in `struct iommu_hw_info_amd`
Date: Wed, 26 Nov 2025 10:37:56 +0530	[thread overview]
Message-ID: <f4bff460-f4c6-4a4d-8ea6-b3c0c8965f0a@amd.com> (raw)
In-Reply-To: <20251121233545.GJ233636@ziepe.ca>



On 11/22/2025 5:05 AM, Jason Gunthorpe wrote:
> On Wed, Oct 29, 2025 at 03:28:46PM +0530, Sairaj Kodilkar wrote:
>> When user does IOMMU_GET_HW_INFO ioctl, read the IOMMU control
>> register (MMIO offset 0x0018) and return it as part of
>> `struct iommu_hw_info_amd`.
>>
>> Userspace can use this information to determine the features
>> supported by the underlying host kernel.
>>
>> Signed-off-by: Sairaj Kodilkar <sarunkod@amd.com>
>> ---
>>
>> The patch exposes the control register to the user space so that QEMU
>> can determine the list of features enabled by the host IOMMU driver
>> when there are passthrough devices. QEMU can use this information to
>> selectively enable the guest feature. One example of such feature is
>> enabling upto 2048 MSIs for passthrough devices. QEMU must not enable
>> this feature for passthrough devices when host IOMMU driver has not
>> enabled it.
> Please document in the uapi header what bits are meaningful and
> userspace can safely access..
>
> You are OK that a 0 register means the kernel is old?

Yes. That's fine.
Please see 
https://lore.kernel.org/qemu-devel/20251118101532.4315-1-sarunkod@amd.com/
Here qemu uses the control register only to determine the 2K interrupt 
support and sets
corrosponding bits inside the virtual control register. Other bits in 
the virtual control
register are predefined and do not change even if the hardware control 
register is
returned as 0.

Thanks
Sairaj

      reply	other threads:[~2025-11-26  5:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29  9:58 Sairaj Kodilkar
2025-11-21 23:35 ` Jason Gunthorpe
2025-11-26  5:07   ` Sairaj Kodilkar [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=f4bff460-f4c6-4a4d-8ea6-b3c0c8965f0a@amd.com \
    --to=sarunkod@amd.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    --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®