diff mbox series

[v2,3/8] hw/arm/virt: Use "msi-map" devicetree property for PCI

Message ID 20220927100347.176606-4-jean-philippe@linaro.org (mailing list archive)
State New, archived
Headers show
Series hw/arm/virt: Fix dt-schema warnings | expand

Commit Message

Jean-Philippe Brucker Sept. 27, 2022, 10:03 a.m. UTC
The "msi-parent" property can be used on the PCI node when MSIs do not
contain sideband data (device IDs) [1]. In QEMU, MSI transactions
contain the requester ID, so the PCI node should use the "msi-map"
property instead of "msi-parent". In our case the property describes an
identity map between requester ID and sideband data.

This fixes a warning when passing the DTB generated by QEMU to dtc,
following a recent change to the GICv3 node:

  Warning (msi_parent_property): /pcie@10000000:msi-parent: property size (4) too small for cell size 1

[1] linux/Documentation/devicetree/bindings/pci/pci-msi.txt

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
 hw/arm/virt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peter Maydell Sept. 27, 2022, 11:36 a.m. UTC | #1
On Tue, 27 Sept 2022 at 11:12, Jean-Philippe Brucker
<jean-philippe@linaro.org> wrote:
>
> The "msi-parent" property can be used on the PCI node when MSIs do not
> contain sideband data (device IDs) [1]. In QEMU, MSI transactions
> contain the requester ID, so the PCI node should use the "msi-map"
> property instead of "msi-parent". In our case the property describes an
> identity map between requester ID and sideband data.
>
> This fixes a warning when passing the DTB generated by QEMU to dtc,
> following a recent change to the GICv3 node:
>
>   Warning (msi_parent_property): /pcie@10000000:msi-parent: property size (4) too small for cell size 1
>
> [1] linux/Documentation/devicetree/bindings/pci/pci-msi.txt
>
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
Eric Auger Sept. 27, 2022, 12:48 p.m. UTC | #2
Hi Jean,

On 9/27/22 12:03, Jean-Philippe Brucker wrote:
> The "msi-parent" property can be used on the PCI node when MSIs do not
> contain sideband data (device IDs) [1]. In QEMU, MSI transactions
> contain the requester ID, so the PCI node should use the "msi-map"
> property instead of "msi-parent". In our case the property describes an
> identity map between requester ID and sideband data.
> 
> This fixes a warning when passing the DTB generated by QEMU to dtc,
> following a recent change to the GICv3 node:
> 
>   Warning (msi_parent_property): /pcie@10000000:msi-parent: property size (4) too small for cell size 1
> 
> [1] linux/Documentation/devicetree/bindings/pci/pci-msi.txt
> 
> Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Effectively matches example 1 in [1]

Reviewed-by: Eric Auger <eric.auger@redhat.com>

Eric

> ---
>  hw/arm/virt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index ed6f1ac41e..8605f5058a 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -1489,8 +1489,8 @@ static void create_pcie(VirtMachineState *vms)
>      qemu_fdt_setprop(ms->fdt, nodename, "dma-coherent", NULL, 0);
>  
>      if (vms->msi_phandle) {
> -        qemu_fdt_setprop_cells(ms->fdt, nodename, "msi-parent",
> -                               vms->msi_phandle);
> +        qemu_fdt_setprop_cells(ms->fdt, nodename, "msi-map",
> +                               0, vms->msi_phandle, 0, 0x10000);
>      }
>  
>      qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg",
diff mbox series

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index ed6f1ac41e..8605f5058a 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1489,8 +1489,8 @@  static void create_pcie(VirtMachineState *vms)
     qemu_fdt_setprop(ms->fdt, nodename, "dma-coherent", NULL, 0);
 
     if (vms->msi_phandle) {
-        qemu_fdt_setprop_cells(ms->fdt, nodename, "msi-parent",
-                               vms->msi_phandle);
+        qemu_fdt_setprop_cells(ms->fdt, nodename, "msi-map",
+                               0, vms->msi_phandle, 0, 0x10000);
     }
 
     qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg",