Skip to contentSkip to conversation

pci-host: Allow extended config space access for PowerNV PHB4 model

PATCH In review Christophe Lombard 4 participants 6 messages Nov 9, 2021 – Nov 17, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pci-host: Allow extended config space access for PowerNV PHB4 model

The PCIe extended configuration space on the device is not currently accessible to the host. if by default, it is still inaccessible for conventional for PCIe buses, add the current flag PCI_BUS_EXTENDED_CONFIG_SPACE on the root bus permits PCI-E extended config space access.

---
 hw/pci-host/pnv_phb4.c | 1 +
 1 file changed, 1 insertion(+)
hw/pci-host/pnv_phb4.c +1 -0
index 5c375a9f28..40b793201a 100644
@@ -1205,6 +1205,7 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
                                      &phb->pci_mmio, &phb->pci_io,
                                      0, 4, TYPE_PNV_PHB4_ROOT_BUS);
     pci_setup_iommu(pci->bus, pnv_phb4_dma_iommu, phb);
+    pci->bus->flags |= PCI_BUS_EXTENDED_CONFIG_SPACE;
 
     /* Add a single Root port */
     qdev_prop_set_uint8(DEVICE(&phb->root), "chassis", phb->chip_id);
Signature · 1 line
2.33.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Christophe Lombard

The PCIe extended configuration space on the device is not currently accessible to the host. if by default, it is still inaccessible for conventional for PCIe buses, add the current flag PCI_BUS_EXTENDED_CONFIG_SPACE on the root bus permits PCI-E extended config space access.

---

FWIW, looks good to me

Quoted 16 lines
  hw/pci-host/pnv_phb4.c | 1 +
  1 file changed, 1 insertion(+)
hw/pci-host/pnv_phb4.c +1 -0
index 5c375a9f28..40b793201a 100644
@@ -1205,6 +1205,7 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
                                       &phb->pci_mmio, &phb->pci_io,
                                       0, 4, TYPE_PNV_PHB4_ROOT_BUS);
      pci_setup_iommu(pci->bus, pnv_phb4_dma_iommu, phb);
+    pci->bus->flags |= PCI_BUS_EXTENDED_CONFIG_SPACE;
 
      /* Add a single Root port */
      qdev_prop_set_uint8(DEVICE(&phb->root), "chassis", phb->chip_id);
Reviewed-by
#2 lore raw
Quoted 8 lines · Frederic Barrat
Quoted 5 lines · Christophe Lombard

The PCIe extended configuration space on the device is not currently accessible to the host. if by default,  it is still inaccessible for conventional for PCIe buses, add the current flag PCI_BUS_EXTENDED_CONFIG_SPACE on the root bus permits PCI-E extended config space access.

For the record, this is coming from an experiment of plugging a CXL device on a QEMU PowerNV POWER10 machine (baremetal). Only minor changes (64 bits ops) were required to get it working.

I wonder where are with the CXL models ?

Quoted 6 lines
Quoted 2 lines

---

FWIW, looks good to me

Thanks,

C.

Quoted 18 lines
Quoted 18 lines

  hw/pci-host/pnv_phb4.c | 1 +

  1 file changed, 1 insertion(+)
hw/pci-host/pnv_phb4.c +1 -0
index 5c375a9f28..40b793201a 100644
@@ -1205,6 +1205,7 @@ static void pnv_phb4_realize(DeviceState *dev, Error **errp)
                                        &phb->pci_mmio, &phb->pci_io,
                                        0, 4, TYPE_PNV_PHB4_ROOT_BUS);
       pci_setup_iommu(pci->bus, pnv_phb4_dma_iommu, phb);
+    pci->bus->flags |= PCI_BUS_EXTENDED_CONFIG_SPACE;
       /* Add a single Root port */
       qdev_prop_set_uint8(DEVICE(&phb->root), "chassis", phb->chip_id);
 
#3 lore raw
Quoted 10 lines · Cédric Le Goater
Quoted 8 lines · Frederic Barrat
Quoted 5 lines · Christophe Lombard

The PCIe extended configuration space on the device is not currently accessible to the host. if by default,  it is still inaccessible for conventional for PCIe buses, add the current flag PCI_BUS_EXTENDED_CONFIG_SPACE on the root bus permits PCI-E extended config space access.

Quoted 3 lines

For the record, this is coming from an experiment of plugging a CXL device on a QEMU PowerNV POWER10 machine (baremetal). Only minor changes (64 bits ops) were required to get it working.

Since this note could be helpful when having future retrospective, do you mind amending this note to the commit description?

Quoted 1 line

I wonder where are with the CXL models ?

IIRC Ben worked actively, asked help to the community but received very few, basically because there is not enough man power IMHO.

Last thing I remember is Igor suggested a different design approach:
https://lore.kernel.org/qemu-devel/[email protected]/

Quoted 37 lines
Quoted 6 lines
Quoted 2 lines

---

FWIW, looks good to me

Thanks,

C.

Quoted 19 lines
Quoted 19 lines

  hw/pci-host/pnv_phb4.c | 1 +

  1 file changed, 1 insertion(+)
hw/pci-host/pnv_phb4.c +1 -0
index 5c375a9f28..40b793201a 100644
@@ -1205,6 +1205,7 @@ static void pnv_phb4_realize(DeviceState *dev,
 Error **errp)
                                        &phb->pci_mmio, &phb->pci_io,
                                        0, 4, TYPE_PNV_PHB4_ROOT_BUS);
       pci_setup_iommu(pci->bus, pnv_phb4_dma_iommu, phb);
+    pci->bus->flags |= PCI_BUS_EXTENDED_CONFIG_SPACE;
       /* Add a single Root port */
       qdev_prop_set_uint8(DEVICE(&phb->root), "chassis", phb->chip_id);
#4 lore raw
Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Cédric Le Goater
Quoted 8 lines · Frederic Barrat
Quoted 5 lines · Christophe Lombard

The PCIe extended configuration space on the device is not currently accessible to the host. if by default,  it is still inaccessible for conventional for PCIe buses, add the current flag PCI_BUS_EXTENDED_CONFIG_SPACE on the root bus permits PCI-E extended config space access.

Quoted 6 lines
Quoted 3 lines

For the record, this is coming from an experiment of plugging a CXL device on a QEMU PowerNV POWER10 machine (baremetal). Only minor changes (64 bits ops) were required to get it working.

Since this note could be helpful when having future retrospective, do you mind amending this note to the commit description?

Yes. I agree. Please do.

Quoted 7 lines
Quoted 1 line

I wonder where we are with the CXL models ?

IIRC Ben worked actively, asked help to the community but received very few, basically because there is not enough man power IMHO.

Last thing I remember is Igor suggested a different design approach:
https://lore.kernel.org/qemu-devel/[email protected]/

Well, the CXL Linux driver seemed to work fine on QEMU machines, Intel and POWER.

Thanks for the info,

C.

#5 lore raw
In reply to Christophe Lombard
Quoted 10 lines · Christophe Lombard

The PCIe extended configuration space on the device is not currently accessible to the host. if by default, it is still inaccessible for conventional for PCIe buses, add the current flag PCI_BUS_EXTENDED_CONFIG_SPACE on the root bus permits PCI-E extended config space access.

---
  hw/pci-host/pnv_phb4.c | 1 +
  1 file changed, 1 insertion(+)

Queued for 7.0.

Thanks,

C.