Skip to contentSkip to conversation

s390/pci more enhancements

PATCH In review Christian Borntraeger 3 participants 5 messages Nov 7, 2017 – Nov 8, 2017

lore
Share & tools
lore
#0 lore raw

cover s390/pci more enhancements

This patch puts PCI device in the configured state by default, which is the only sane default for KVM guests.

Christian Borntraeger (1):
s390x/pci: let pci devices start in configured mode

 hw/s390x/s390-pci-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.9.4
#1 lore raw

PATCH 1/1 s390x/pci: let pci devices start in configured mode

Currently, to enable a pci device in the guest, the user has to issue echo 1 > /sys/bus/pci/slots/00000000/power. This is not what people expect. On an LPAR, the user can put a PCI device in configured or deconfigured state via IOCDS. The "start in deconfigured state" can be used for "sharing" a pci function across LPARs. This is not what we are going to use in KVM, so always start configured.

---
 hw/s390x/s390-pci-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/s390-pci-bus.c +1 -1
index e7a58e8..2b1e140 100644
@@ -715,7 +715,7 @@ static void s390_pcihost_hot_plug(HotplugHandler *hotplug_dev,
         pbdev->pdev = pdev;
         pbdev->iommu = s390_pci_get_iommu(s, pdev->bus, pdev->devfn);
         pbdev->iommu->pbdev = pbdev;
-        pbdev->state = ZPCI_FS_STANDBY;
+        pbdev->state = ZPCI_FS_DISABLED;
 
         if (s390_pci_msix_init(pbdev)) {
             error_setg(errp, "MSI-X support is mandatory "
Signature · 1 line
2.9.4
#2 lore raw

Re: [Qemu-devel] [PATCH 1/1] s390x/pci: let pci devices start in configured mode

Quoted 19 lines · On Tue, 7 Nov 2017 18:54:55 +0100 Christian Borntraeger…

Currently, to enable a pci device in the guest, the user has to issue echo 1 > /sys/bus/pci/slots/00000000/power. This is not what people expect. On an LPAR, the user can put a PCI device in configured or deconfigured state via IOCDS. The "start in deconfigured state" can be used for "sharing" a pci function across LPARs. This is not what we are going to use in KVM, so always start configured.

---
 hw/s390x/s390-pci-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/s390-pci-bus.c +0 -0
index e7a58e8..2b1e140 100644

hw/s390x/s390-pci-bus.c static void s390_pcihost_hot_plug(HotplugHandler *hotplug_dev, · line 721

Quoted 8 lines
hw/s390x/s390-pci-bus.c +1 -1
@@ -715,7 +715,7 @@ static void s390_pcihost_hot_plug(HotplugHandler *hotplug_dev,
         pbdev->pdev = pdev;
         pbdev->iommu = s390_pci_get_iommu(s, pdev->bus, pdev->devfn);
         pbdev->iommu->pbdev = pbdev;
-        pbdev->state = ZPCI_FS_STANDBY;
+        pbdev->state = ZPCI_FS_DISABLED;
 
         if (s390_pci_msix_init(pbdev)) {
             error_setg(errp, "MSI-X support is mandatory "

A pci function already has to be configured before we can assign it via vfio, right?

I think I'll queue this for 2.11.

#3 lore raw

Re: [Qemu-devel] [PATCH 1/1] s390x/pci: let pci devices start in configured mode

Quoted 28 lines · Cornelia Huck
Quoted 25 lines · On Tue, 7 Nov 2017 18:54:55 +0100 Christian Borntraeger…

Currently, to enable a pci device in the guest, the user has to issue echo 1 > /sys/bus/pci/slots/00000000/power. This is not what people expect. On an LPAR, the user can put a PCI device in configured or deconfigured state via IOCDS. The "start in deconfigured state" can be used for "sharing" a pci function across LPARs. This is not what we are going to use in KVM, so always start configured.

---
  hw/s390x/s390-pci-bus.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/s390-pci-bus.c +1 -1
index e7a58e8..2b1e140 100644
@@ -715,7 +715,7 @@ static void s390_pcihost_hot_plug(HotplugHandler *hotplug_dev,
          pbdev->pdev = pdev;
          pbdev->iommu = s390_pci_get_iommu(s, pdev->bus, pdev->devfn);
          pbdev->iommu->pbdev = pbdev;
-        pbdev->state = ZPCI_FS_STANDBY;
+        pbdev->state = ZPCI_FS_DISABLED;
 
Quoted 5 lines

hw/s390x/s390-pci-bus.c static void s390_pcihost_hot_plug(HotplugHandler *hotplug_dev, · line 721

Quoted 2 lines
hw/s390x/s390-pci-bus.c +0 -0
          if (s390_pci_msix_init(pbdev)) {
              error_setg(errp, "MSI-X support is mandatory "

A pci function already has to be configured before we can assign it via vfio, right?

Yes it is right, otherwise we do not see the PCI device in the sysfs and we can not provide it to QEMU.

Regards

Pierre

Quoted 3 lines

I think I'll queue this for 2.11.

Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
#4 lore raw

Re: [Qemu-devel] [PATCH 1/1] s390x/pci: let pci devices start in configured mode

In reply to Christian Borntraeger
Quoted 19 lines · On Tue, 7 Nov 2017 18:54:55 +0100 Christian Borntraeger…

Currently, to enable a pci device in the guest, the user has to issue echo 1 > /sys/bus/pci/slots/00000000/power. This is not what people expect. On an LPAR, the user can put a PCI device in configured or deconfigured state via IOCDS. The "start in deconfigured state" can be used for "sharing" a pci function across LPARs. This is not what we are going to use in KVM, so always start configured.

---
 hw/s390x/s390-pci-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/s390-pci-bus.c +0 -0
index e7a58e8..2b1e140 100644

hw/s390x/s390-pci-bus.c static void s390_pcihost_hot_plug(HotplugHandler *hotplug_dev, · line 721

Quoted 8 lines
hw/s390x/s390-pci-bus.c +1 -1
@@ -715,7 +715,7 @@ static void s390_pcihost_hot_plug(HotplugHandler *hotplug_dev,
         pbdev->pdev = pdev;
         pbdev->iommu = s390_pci_get_iommu(s, pdev->bus, pdev->devfn);
         pbdev->iommu->pbdev = pbdev;
-        pbdev->state = ZPCI_FS_STANDBY;
+        pbdev->state = ZPCI_FS_DISABLED;
 
         if (s390_pci_msix_init(pbdev)) {
             error_setg(errp, "MSI-X support is mandatory "

Thanks, queued to s390-fixes.