[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f4bff460-f4c6-4a4d-8ea6-b3c0c8965f0a@amd.com>
Date: Wed, 26 Nov 2025 10:37:56 +0530
From: Sairaj Kodilkar <sarunkod@....com>
To: Jason Gunthorpe <jgg@...pe.ca>
CC: <joro@...tes.org>, <suravee.suthikulpanit@....com>, <will@...nel.org>,
<robin.murphy@....com>, <kevin.tian@...el.com>, <iommu@...ts.linux.dev>,
<linux-kernel@...r.kernel.org>, <vasant.hegde@....com>
Subject: Re: [RFC PATCH] iommu/amd: Add control register in `struct
iommu_hw_info_amd`
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@....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
Powered by blists - more mailing lists