Displaying 20 results from an estimated 87 matches for "virtio_pci_cap_common_cfg".
2014 Dec 30
0
[PATCH RFC v2 4/7] virtio-pci: define layout for virtio 1.0
...ux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -99,4 +99,66 @@
/* Vector value used to disable MSI for queue */
#define VIRTIO_MSI_NO_VECTOR 0xffff
+#ifndef VIRTIO_PCI_NO_MODERN
+
+/* IDs for different capabilities. Must all exist. */
+
+/* Common configuration */
+#define VIRTIO_PCI_CAP_COMMON_CFG 1
+/* Notifications */
+#define VIRTIO_PCI_CAP_NOTIFY_CFG 2
+/* ISR access */
+#define VIRTIO_PCI_CAP_ISR_CFG 3
+/* Device specific confiuration */
+#define VIRTIO_PCI_CAP_DEVICE_CFG 4
+
+/* This is the PCI capability header: */
+struct virtio_pci_cap {
+ __u8 cap_vndr; /* Generic PCI field: PCI_...
2014 Dec 30
0
[PATCH RFC v2 4/7] virtio-pci: define layout for virtio 1.0
...ux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -99,4 +99,66 @@
/* Vector value used to disable MSI for queue */
#define VIRTIO_MSI_NO_VECTOR 0xffff
+#ifndef VIRTIO_PCI_NO_MODERN
+
+/* IDs for different capabilities. Must all exist. */
+
+/* Common configuration */
+#define VIRTIO_PCI_CAP_COMMON_CFG 1
+/* Notifications */
+#define VIRTIO_PCI_CAP_NOTIFY_CFG 2
+/* ISR access */
+#define VIRTIO_PCI_CAP_ISR_CFG 3
+/* Device specific confiuration */
+#define VIRTIO_PCI_CAP_DEVICE_CFG 4
+
+/* This is the PCI capability header: */
+struct virtio_pci_cap {
+ __u8 cap_vndr; /* Generic PCI field: PCI_...
2020 Sep 24
2
[PATCH v3 5/6] iommu/virtio: Support topology description in config space
...n_regs;
> + struct viommu_cap_config cap = {0};
> + struct virtio_pci_common_cfg __iomem *common_cfg;
> +
> + /*
> + * The virtio infrastructure might not be loaded at this point. We need
> + * to access the BARs ourselves.
> + */
> + ret = viommu_pci_find_capability(dev, VIRTIO_PCI_CAP_COMMON_CFG, &cap);
> + if (!ret) {
> + pci_warn(dev, "common capability not found\n");
Is the lack of this capability really an error, i.e., is this
pci_warn() or pci_info()? The "device doesn't have topology
description" below is only pci_dbg(), which suggests that we can...
2020 Sep 24
2
[PATCH v3 5/6] iommu/virtio: Support topology description in config space
...n_regs;
> + struct viommu_cap_config cap = {0};
> + struct virtio_pci_common_cfg __iomem *common_cfg;
> +
> + /*
> + * The virtio infrastructure might not be loaded at this point. We need
> + * to access the BARs ourselves.
> + */
> + ret = viommu_pci_find_capability(dev, VIRTIO_PCI_CAP_COMMON_CFG, &cap);
> + if (!ret) {
> + pci_warn(dev, "common capability not found\n");
Is the lack of this capability really an error, i.e., is this
pci_warn() or pci_info()? The "device doesn't have topology
description" below is only pci_dbg(), which suggests that we can...
2013 May 28
3
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...pci_cap_add(proxy, "virtio-pci-common",
+ &proxy->config_common,
+ &virtio_pci_config_common_ops,
+ VIRTIO_PCI_CONFIG_COMMON,
+ sizeof(struct virtio_pci_common_cfg),
+ VIRTIO_PCI_CAP_COMMON_CFG,
+ 0);
+ notify_cap = virtio_pci_cap_add(proxy, "virtio-pci-notify",
+ &proxy->config_notify,
+ &virtio_pci_config_notify_ops,
+ VIRTIO_PCI_CONFIG_...
2013 May 28
3
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...pci_cap_add(proxy, "virtio-pci-common",
+ &proxy->config_common,
+ &virtio_pci_config_common_ops,
+ VIRTIO_PCI_CONFIG_COMMON,
+ sizeof(struct virtio_pci_common_cfg),
+ VIRTIO_PCI_CAP_COMMON_CFG,
+ 0);
+ notify_cap = virtio_pci_cap_add(proxy, "virtio-pci-notify",
+ &proxy->config_notify,
+ &virtio_pci_config_notify_ops,
+ VIRTIO_PCI_CONFIG_...
2011 Nov 22
2
[PATCHv3 RFC] virtio-pci: flexible configuration layout
...pci_device *vp_dev)
+{
+ vp_dev->isr_map = virtio_pci_map_cfg(vp_dev,
+ VIRTIO_PCI_CAP_ISR_CFG,
+ sizeof(u8));
+ vp_dev->notify_map = virtio_pci_map_cfg(vp_dev,
+ VIRTIO_PCI_CAP_NOTIFY_CFG,
+ sizeof(u16));
+ vp_dev->common_map = virtio_pci_map_cfg(vp_dev,
+ VIRTIO_PCI_CAP_COMMON_CFG,
+ sizeof(u32));
+ vp_dev->device_map = virtio_pci_map_cfg(vp_dev,
+ VIRTIO_PCI_CAP_DEVICE_CFG,
+ sizeof(u8));
+
+ if (vp_dev->notify_map && vp_dev->isr_map &&
+ vp_dev->common_map && vp_dev->device_map) {
+ vp_dev->ioaddr = vp_dev->c...
2011 Nov 22
2
[PATCHv3 RFC] virtio-pci: flexible configuration layout
...pci_device *vp_dev)
+{
+ vp_dev->isr_map = virtio_pci_map_cfg(vp_dev,
+ VIRTIO_PCI_CAP_ISR_CFG,
+ sizeof(u8));
+ vp_dev->notify_map = virtio_pci_map_cfg(vp_dev,
+ VIRTIO_PCI_CAP_NOTIFY_CFG,
+ sizeof(u16));
+ vp_dev->common_map = virtio_pci_map_cfg(vp_dev,
+ VIRTIO_PCI_CAP_COMMON_CFG,
+ sizeof(u32));
+ vp_dev->device_map = virtio_pci_map_cfg(vp_dev,
+ VIRTIO_PCI_CAP_DEVICE_CFG,
+ sizeof(u8));
+
+ if (vp_dev->notify_map && vp_dev->isr_map &&
+ vp_dev->common_map && vp_dev->device_map) {
+ vp_dev->ioaddr = vp_dev->c...
2013 May 28
0
[PATCH RFC] virtio-pci: new config layout: using memory BAR
...virtio-pci-common",
> + &proxy->config_common,
> + &virtio_pci_config_common_ops,
> + VIRTIO_PCI_CONFIG_COMMON,
> + sizeof(struct virtio_pci_common_cfg),
> + VIRTIO_PCI_CAP_COMMON_CFG,
> + 0);
> + notify_cap = virtio_pci_cap_add(proxy, "virtio-pci-notify",
> + &proxy->config_notify,
> + &virtio_pci_config_notify_ops,
> +...
2015 Jun 24
1
[PATCH] virtio-pci: alloc only resources actually used.
...amp; ioresource_types) {
+ *bars |= (1 << bar);
return pos;
+ }
}
}
return 0;
@@ -617,7 +619,8 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
- IORESOURCE_IO | IORESOURCE_MEM);
+ IORESOURCE_IO | IORESOURCE_MEM,
+ &vp_dev->modern_bars);
if (!common) {
dev_info(&pci_dev->dev,
"virtio_pci: leaving for legacy driver\n");
@@ -626,9 +629,11 @@ int virtio_pci_modern_probe(struct virtio_...
2015 Jun 24
1
[PATCH] virtio-pci: alloc only resources actually used.
...amp; ioresource_types) {
+ *bars |= (1 << bar);
return pos;
+ }
}
}
return 0;
@@ -617,7 +619,8 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
- IORESOURCE_IO | IORESOURCE_MEM);
+ IORESOURCE_IO | IORESOURCE_MEM,
+ &vp_dev->modern_bars);
if (!common) {
dev_info(&pci_dev->dev,
"virtio_pci: leaving for legacy driver\n");
@@ -626,9 +629,11 @@ int virtio_pci_modern_probe(struct virtio_...
2015 Jun 23
1
[PATCH] virtio-pci: alloc only resources actually used.
...& ioresource_types) {
+ *bars = (1 << bar);
return pos;
+ }
}
}
return 0;
@@ -617,7 +619,8 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
- IORESOURCE_IO | IORESOURCE_MEM);
+ IORESOURCE_IO | IORESOURCE_MEM,
+ &vp_dev->modern_bars);
if (!common) {
dev_info(&pci_dev->dev,
"virtio_pci: leaving for legacy driver\n");
@@ -626,9 +629,11 @@ int virtio_pci_modern_probe(struct virtio_...
2015 Jun 23
1
[PATCH] virtio-pci: alloc only resources actually used.
...& ioresource_types) {
+ *bars = (1 << bar);
return pos;
+ }
}
}
return 0;
@@ -617,7 +619,8 @@ int virtio_pci_modern_probe(struct virtio_pci_device *vp_dev)
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
- IORESOURCE_IO | IORESOURCE_MEM);
+ IORESOURCE_IO | IORESOURCE_MEM,
+ &vp_dev->modern_bars);
if (!common) {
dev_info(&pci_dev->dev,
"virtio_pci: leaving for legacy driver\n");
@@ -626,9 +629,11 @@ int virtio_pci_modern_probe(struct virtio_...
2016 Aug 30
4
[PATCH v2 2/2] vfio: add virtio pci quirk
...about resource
> + * availability. Slow but sure.
> + * Note that all vendor-specific fields we access are little-endian
> + * which matches what pci config accessors expect, so they do byteswap
> + * for us if appropriate.
> + */
> + common = virtio_pci_find_capability(dev, VIRTIO_PCI_CAP_COMMON_CFG);
> + cfg = virtio_pci_find_capability(dev, VIRTIO_PCI_CAP_PCI_CFG);
> + if (!cfg || !common) {
> + dev_warn(&dev->dev,
> + "Virtio device lacks common or pci cfg.\n");
Whitespace
> + return -ENODEV;
> + }
> +
> + pc...
2016 Aug 30
4
[PATCH v2 2/2] vfio: add virtio pci quirk
...about resource
> + * availability. Slow but sure.
> + * Note that all vendor-specific fields we access are little-endian
> + * which matches what pci config accessors expect, so they do byteswap
> + * for us if appropriate.
> + */
> + common = virtio_pci_find_capability(dev, VIRTIO_PCI_CAP_COMMON_CFG);
> + cfg = virtio_pci_find_capability(dev, VIRTIO_PCI_CAP_PCI_CFG);
> + if (!cfg || !common) {
> + dev_warn(&dev->dev,
> + "Virtio device lacks common or pci cfg.\n");
Whitespace
> + return -ENODEV;
> + }
> +
> + pc...
2015 Apr 01
0
[PATCH v3 5/6] virtio_pci: support non-legacy balloon devices
...n_probe(struct virtio_pci_device *vp_dev)
}
vp_dev->vdev.id.vendor = pci_dev->subsystem_vendor;
- if (virtio_device_is_legacy_only(vp_dev->vdev.id))
- return -ENODEV;
-
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
IORESOURCE_IO | IORESOURCE_MEM);
--
MST
2020 Sep 25
0
[PATCH v3 5/6] iommu/virtio: Support topology description in config space
...nfig cap = {0};
> > + struct virtio_pci_common_cfg __iomem *common_cfg;
> > +
> > + /*
> > + * The virtio infrastructure might not be loaded at this point. We need
> > + * to access the BARs ourselves.
> > + */
> > + ret = viommu_pci_find_capability(dev, VIRTIO_PCI_CAP_COMMON_CFG, &cap);
> > + if (!ret) {
> > + pci_warn(dev, "common capability not found\n");
>
> Is the lack of this capability really an error, i.e., is this
> pci_warn() or pci_info()? The "device doesn't have topology
> description" below is only pci_dbg...
2015 Apr 01
0
[PATCH v3 5/6] virtio_pci: support non-legacy balloon devices
...n_probe(struct virtio_pci_device *vp_dev)
}
vp_dev->vdev.id.vendor = pci_dev->subsystem_vendor;
- if (virtio_device_is_legacy_only(vp_dev->vdev.id))
- return -ENODEV;
-
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
IORESOURCE_IO | IORESOURCE_MEM);
--
MST
2015 Mar 31
0
[PATCH v2 5/6] virtio_pci: support non-legacy balloon devices
...n_probe(struct virtio_pci_device *vp_dev)
}
vp_dev->vdev.id.vendor = pci_dev->subsystem_vendor;
- if (virtio_device_is_legacy_only(vp_dev->vdev.id))
- return -ENODEV;
-
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
IORESOURCE_IO | IORESOURCE_MEM);
--
MST
2015 Mar 31
0
[PATCH v2 5/6] virtio_pci: support non-legacy balloon devices
...n_probe(struct virtio_pci_device *vp_dev)
}
vp_dev->vdev.id.vendor = pci_dev->subsystem_vendor;
- if (virtio_device_is_legacy_only(vp_dev->vdev.id))
- return -ENODEV;
-
/* check for a common config: if not, use legacy mode (bar 0). */
common = virtio_pci_find_capability(pci_dev, VIRTIO_PCI_CAP_COMMON_CFG,
IORESOURCE_IO | IORESOURCE_MEM);
--
MST