All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: <qemu-devel@nongnu.org>, <pbonzini@redhat.com>,
	<mtosatti@redhat.com>, <mst@redhat.com>,
	<marcel.apfelbaum@gmail.com>, <jon.grimm@amd.com>,
	<santosh.shukla@amd.com>, <vasant.hegde@amd.com>,
	<Wei.Huang2@amd.com>, <kraxel@redhat.com>, <bsd@redhat.com>,
	<berrange@redhat.com>, <ddutile@redhat.com>,
	<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH] pci-ids.rst: Add Red Hat pci-id for AMD IOMMU device
Date: Mon, 10 Mar 2025 13:57:31 +0000	[thread overview]
Message-ID: <20250310135731.00005b1f@huawei.com> (raw)
In-Reply-To: <20250304183747.639382-1-suravee.suthikulpanit@amd.com>

On Tue, 4 Mar 2025 18:37:47 +0000
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> wrote:

> The QEMU-emulated AMD IOMMU PCI device is implemented based on the AMD I/O
> Virtualization Technology (IOMMU) Specification [1]. The PCI id for this
> device is platform-specific.
> 
> Currently, the QEMU-emulated AMD IOMMU device is using AMD vendor id and
> undefined device id.
> 
> Therefore, change the vendor id to Red Hat and request a new QEMU-specific
> device id.
> 
> [1] https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/specifications/48882_IOMMU.pdf
> 
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>

As a heads up, I believe we have a similar problem with a few of the CXL IDs.
The root port and type 3 device both use Intel IDs that were not reserved
for this purpose.  VID=0x8086, DID=0x7075 and DID=0x0d93

Switch ports and switch-cci are using valid Hisilicon IDs that are for
emulation of these device only and are registered in our tracker
for these IDs so won't get 'reused'.

In both those cases the driver binds on class code in Linux so an ID
change to resolve this would be fine for Linux - I can't speak for
other OS.

Jonathan




> ---
>  docs/specs/pci-ids.rst | 2 ++
>  hw/i386/amd_iommu.c    | 3 ++-
>  include/hw/pci/pci.h   | 1 +
>  3 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/specs/pci-ids.rst b/docs/specs/pci-ids.rst
> index 261b0f359f..2416a70a2d 100644
> --- a/docs/specs/pci-ids.rst
> +++ b/docs/specs/pci-ids.rst
> @@ -100,6 +100,8 @@ PCI devices (other than virtio):
>    PCI UFS device (``-device ufs``)
>  1b36:0014
>    PCI RISC-V IOMMU device
> +1b36:0015
> +  PCI AMD IOMMU device (``-device amd-iommu``)
>  
>  All these devices are documented in :doc:`index`.
>  
> diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
> index dda1a5781f..4d8564249c 100644
> --- a/hw/i386/amd_iommu.c
> +++ b/hw/i386/amd_iommu.c
> @@ -1766,7 +1766,8 @@ static void amdvi_pci_class_init(ObjectClass *klass, void *data)
>      DeviceClass *dc = DEVICE_CLASS(klass);
>      PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
>  
> -    k->vendor_id = PCI_VENDOR_ID_AMD;
> +    k->vendor_id = PCI_VENDOR_ID_REDHAT;
> +    k->device_id = PCI_DEVICE_ID_REDHAT_AMD_IOMMU;
>      k->class_id = 0x0806;
>      k->realize = amdvi_pci_realize;
>  
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index 4002bbeebd..da44e6673d 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -117,6 +117,7 @@ extern bool pci_available;
>  #define PCI_DEVICE_ID_REDHAT_ACPI_ERST   0x0012
>  #define PCI_DEVICE_ID_REDHAT_UFS         0x0013
>  #define PCI_DEVICE_ID_REDHAT_RISCV_IOMMU 0x0014
> +#define PCI_DEVICE_ID_REDHAT_AMD_IOMMU   0x0015
>  #define PCI_DEVICE_ID_REDHAT_QXL         0x0100
>  
>  #define FMT_PCIBUS                      PRIx64


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: <qemu-devel@nongnu.org>, <pbonzini@redhat.com>,
	<mtosatti@redhat.com>, <mst@redhat.com>,
	<marcel.apfelbaum@gmail.com>, <jon.grimm@amd.com>,
	<santosh.shukla@amd.com>, <vasant.hegde@amd.com>,
	<Wei.Huang2@amd.com>, <kraxel@redhat.com>, <bsd@redhat.com>,
	<berrange@redhat.com>, <ddutile@redhat.com>,
	<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH] pci-ids.rst: Add Red Hat pci-id for AMD IOMMU device
Date: Mon, 10 Mar 2025 13:57:31 +0000	[thread overview]
Message-ID: <20250310135731.00005b1f@huawei.com> (raw)
In-Reply-To: <20250304183747.639382-1-suravee.suthikulpanit@amd.com>

On Tue, 4 Mar 2025 18:37:47 +0000
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> wrote:

> The QEMU-emulated AMD IOMMU PCI device is implemented based on the AMD I/O
> Virtualization Technology (IOMMU) Specification [1]. The PCI id for this
> device is platform-specific.
> 
> Currently, the QEMU-emulated AMD IOMMU device is using AMD vendor id and
> undefined device id.
> 
> Therefore, change the vendor id to Red Hat and request a new QEMU-specific
> device id.
> 
> [1] https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/specifications/48882_IOMMU.pdf
> 
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>

As a heads up, I believe we have a similar problem with a few of the CXL IDs.
The root port and type 3 device both use Intel IDs that were not reserved
for this purpose.  VID=0x8086, DID=0x7075 and DID=0x0d93

Switch ports and switch-cci are using valid Hisilicon IDs that are for
emulation of these device only and are registered in our tracker
for these IDs so won't get 'reused'.

In both those cases the driver binds on class code in Linux so an ID
change to resolve this would be fine for Linux - I can't speak for
other OS.

Jonathan




> ---
>  docs/specs/pci-ids.rst | 2 ++
>  hw/i386/amd_iommu.c    | 3 ++-
>  include/hw/pci/pci.h   | 1 +
>  3 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/specs/pci-ids.rst b/docs/specs/pci-ids.rst
> index 261b0f359f..2416a70a2d 100644
> --- a/docs/specs/pci-ids.rst
> +++ b/docs/specs/pci-ids.rst
> @@ -100,6 +100,8 @@ PCI devices (other than virtio):
>    PCI UFS device (``-device ufs``)
>  1b36:0014
>    PCI RISC-V IOMMU device
> +1b36:0015
> +  PCI AMD IOMMU device (``-device amd-iommu``)
>  
>  All these devices are documented in :doc:`index`.
>  
> diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
> index dda1a5781f..4d8564249c 100644
> --- a/hw/i386/amd_iommu.c
> +++ b/hw/i386/amd_iommu.c
> @@ -1766,7 +1766,8 @@ static void amdvi_pci_class_init(ObjectClass *klass, void *data)
>      DeviceClass *dc = DEVICE_CLASS(klass);
>      PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
>  
> -    k->vendor_id = PCI_VENDOR_ID_AMD;
> +    k->vendor_id = PCI_VENDOR_ID_REDHAT;
> +    k->device_id = PCI_DEVICE_ID_REDHAT_AMD_IOMMU;
>      k->class_id = 0x0806;
>      k->realize = amdvi_pci_realize;
>  
> diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
> index 4002bbeebd..da44e6673d 100644
> --- a/include/hw/pci/pci.h
> +++ b/include/hw/pci/pci.h
> @@ -117,6 +117,7 @@ extern bool pci_available;
>  #define PCI_DEVICE_ID_REDHAT_ACPI_ERST   0x0012
>  #define PCI_DEVICE_ID_REDHAT_UFS         0x0013
>  #define PCI_DEVICE_ID_REDHAT_RISCV_IOMMU 0x0014
> +#define PCI_DEVICE_ID_REDHAT_AMD_IOMMU   0x0015
>  #define PCI_DEVICE_ID_REDHAT_QXL         0x0100
>  
>  #define FMT_PCIBUS                      PRIx64



  parent reply	other threads:[~2025-03-10 13:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 18:37 [PATCH] pci-ids.rst: Add Red Hat pci-id for AMD IOMMU device Suravee Suthikulpanit
2025-03-04 18:46 ` Daniel P. Berrangé
2025-03-04 23:02 ` Donald Dutile
2025-03-05  2:56   ` Suthikulpanit, Suravee
2025-03-05 20:28     ` Donald Dutile
2025-03-05  6:52 ` Michael S. Tsirkin
2025-03-06  7:11   ` Yan Vugenfirer
2025-03-06  8:58     ` Daniel P. Berrangé
2025-03-07  2:44       ` Suthikulpanit, Suravee
2025-03-07  2:53   ` Suthikulpanit, Suravee
2025-03-09  6:47     ` Yan Vugenfirer
2025-03-09 13:44 ` Michael S. Tsirkin
2025-03-11  1:55   ` Suthikulpanit, Suravee
2025-03-12 12:43     ` Yan Vugenfirer
2025-05-11 13:27       ` Michael S. Tsirkin
2025-05-11 15:20         ` Yan Vugenfirer
2025-05-11 15:35           ` Michael S. Tsirkin
2025-03-10 13:57 ` Jonathan Cameron [this message]
2025-03-10 13:57   ` Jonathan Cameron via
2025-03-11  8:08   ` Gerd Hoffmann
2025-03-12 18:18     ` Jonathan Cameron
2025-03-12 18:18       ` Jonathan Cameron via

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=20250310135731.00005b1f@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=Wei.Huang2@amd.com \
    --cc=berrange@redhat.com \
    --cc=bsd@redhat.com \
    --cc=ddutile@redhat.com \
    --cc=jon.grimm@amd.com \
    --cc=kraxel@redhat.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=santosh.shukla@amd.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.