[PATCH v2] hw/i386/amd_iommu: Assign pci-id 0x1419 for the AMD IOMMU device

Suravee Suthikulpanit posted 1 patch 1 week ago
hw/i386/amd_iommu.c | 1 +
1 file changed, 1 insertion(+)
[PATCH v2] hw/i386/amd_iommu: Assign pci-id 0x1419 for the AMD IOMMU device
Posted by Suravee Suthikulpanit 1 week ago
Currently, the QEMU-emulated AMD IOMMU device use PCI vendor id 0x1022
(AMD) with device id zero (undefined). Eventhough this does not cause any
functional issue for AMD IOMMU driver since it normally uses information
in the ACPI IVRS table to probe and initialize the device per
recommendation in the AMD IOMMU specification, the device id zero causes
the Windows Device Manager utility to show the device as an unknown device.

Since Windows only recognizes AMD IOMMU device with device id 0x1419 as
listed in the machine.inf file, modify the QEMU AMD IOMMU model to use
the id 0x1419 to avoid the issue. This advertise the IOMMU as the AMD
IOMMU device for Family 15h (Models 10h-1fh).

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
Changes from v1 (https://lore.kernel.org/all/20250304183747.639382-1-suravee.suthikulpanit@amd.com/)
* Use the existing device id 0x1419 instead of the proposed new id.

 hw/i386/amd_iommu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index dda1a5781f..b006ead804 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1767,6 +1767,7 @@ static void amdvi_pci_class_init(ObjectClass *klass, void *data)
     PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
 
     k->vendor_id = PCI_VENDOR_ID_AMD;
+    k->device_id = 0x1419;
     k->class_id = 0x0806;
     k->realize = amdvi_pci_realize;
 
-- 
2.34.1
Re: [PATCH v2] hw/i386/amd_iommu: Assign pci-id 0x1419 for the AMD IOMMU device
Posted by Yan Vugenfirer 5 days, 17 hours ago
On Tue, Mar 25, 2025 at 4:13 AM Suravee Suthikulpanit
<suravee.suthikulpanit@amd.com> wrote:
>
> Currently, the QEMU-emulated AMD IOMMU device use PCI vendor id 0x1022
> (AMD) with device id zero (undefined). Eventhough this does not cause any
> functional issue for AMD IOMMU driver since it normally uses information
> in the ACPI IVRS table to probe and initialize the device per
> recommendation in the AMD IOMMU specification, the device id zero causes
> the Windows Device Manager utility to show the device as an unknown device.
>
> Since Windows only recognizes AMD IOMMU device with device id 0x1419 as
> listed in the machine.inf file, modify the QEMU AMD IOMMU model to use
> the id 0x1419 to avoid the issue. This advertise the IOMMU as the AMD
> IOMMU device for Family 15h (Models 10h-1fh).
>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> Changes from v1 (https://lore.kernel.org/all/20250304183747.639382-1-suravee.suthikulpanit@amd.com/)
> * Use the existing device id 0x1419 instead of the proposed new id.
>
>  hw/i386/amd_iommu.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
> index dda1a5781f..b006ead804 100644
> --- a/hw/i386/amd_iommu.c
> +++ b/hw/i386/amd_iommu.c
> @@ -1767,6 +1767,7 @@ static void amdvi_pci_class_init(ObjectClass *klass, void *data)
>      PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
>
>      k->vendor_id = PCI_VENDOR_ID_AMD;
> +    k->device_id = 0x1419;
>      k->class_id = 0x0806;
>      k->realize = amdvi_pci_realize;
>
> --
> 2.34.1
>

Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
Re: [PATCH v2] hw/i386/amd_iommu: Assign pci-id 0x1419 for the AMD IOMMU device
Posted by Daniel P. Berrangé 5 days, 21 hours ago
On Tue, Mar 25, 2025 at 02:11:40AM +0000, Suravee Suthikulpanit wrote:
> Currently, the QEMU-emulated AMD IOMMU device use PCI vendor id 0x1022
> (AMD) with device id zero (undefined). Eventhough this does not cause any
> functional issue for AMD IOMMU driver since it normally uses information
> in the ACPI IVRS table to probe and initialize the device per
> recommendation in the AMD IOMMU specification, the device id zero causes
> the Windows Device Manager utility to show the device as an unknown device.
> 
> Since Windows only recognizes AMD IOMMU device with device id 0x1419 as
> listed in the machine.inf file, modify the QEMU AMD IOMMU model to use
> the id 0x1419 to avoid the issue. This advertise the IOMMU as the AMD
> IOMMU device for Family 15h (Models 10h-1fh).
> 
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> Changes from v1 (https://lore.kernel.org/all/20250304183747.639382-1-suravee.suthikulpanit@amd.com/)
> * Use the existing device id 0x1419 instead of the proposed new id.
> 
>  hw/i386/amd_iommu.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


NB, this must be merged before we enable migration support for the
device, in order to avoid the need to add versioned machine type compat.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|