Displaying 20 results from an estimated 41 matches for "virtio_pci_cap_".
Did you mean:
virtio_pci_cap
2013 May 27
1
[PATCH rusty/virtio-pci-new-layout] virtio: new layout minor header fixups
..._GUEST_FEATURES
#define VIRTIO_PCI_QUEUE_PFN VIRTIO_PCI_LEGACY_QUEUE_PFN
@@ -125,10 +127,10 @@
/* This is the PCI capability header: */
struct virtio_pci_cap {
- u8 cap_vndr; /* Generic PCI field: PCI_CAP_ID_VNDR */
- u8 cap_next; /* Generic PCI field: next ptr. */
- u8 cfg_type; /* One of the VIRTIO_PCI_CAP_*_CFG. */
- u8 bar; /* Where to find it. */
+ __u8 cap_vndr; /* Generic PCI field: PCI_CAP_ID_VNDR */
+ __u8 cap_next; /* Generic PCI field: next ptr. */
+ __u8 cfg_type; /* One of the VIRTIO_PCI_CAP_*_CFG. */
+ __u8 bar; /* Where to find it. */
__le32 offset; /* Offset within bar. */
__le32 l...
2013 May 27
1
[PATCH rusty/virtio-pci-new-layout] virtio: new layout minor header fixups
..._GUEST_FEATURES
#define VIRTIO_PCI_QUEUE_PFN VIRTIO_PCI_LEGACY_QUEUE_PFN
@@ -125,10 +127,10 @@
/* This is the PCI capability header: */
struct virtio_pci_cap {
- u8 cap_vndr; /* Generic PCI field: PCI_CAP_ID_VNDR */
- u8 cap_next; /* Generic PCI field: next ptr. */
- u8 cfg_type; /* One of the VIRTIO_PCI_CAP_*_CFG. */
- u8 bar; /* Where to find it. */
+ __u8 cap_vndr; /* Generic PCI field: PCI_CAP_ID_VNDR */
+ __u8 cap_next; /* Generic PCI field: next ptr. */
+ __u8 cfg_type; /* One of the VIRTIO_PCI_CAP_*_CFG. */
+ __u8 bar; /* Where to find it. */
__le32 offset; /* Offset within bar. */
__le32 l...
2020 Aug 03
1
[PATCH] virtio_pci_modern: Fix the comment of virtio_pci_find_capability()
...pci_modern.c b/drivers/virtio/virtio_pci_modern.c
index db93cedd262f..9bdc6f68221f 100644
--- a/drivers/virtio/virtio_pci_modern.c
+++ b/drivers/virtio/virtio_pci_modern.c
@@ -481,6 +481,7 @@ static const struct virtio_config_ops virtio_pci_config_ops = {
* @dev: the pci device
* @cfg_type: the VIRTIO_PCI_CAP_* value we seek
* @ioresource_types: IORESOURCE_MEM and/or IORESOURCE_IO.
+ * @bars: the bitmask of BARs
*
* Returns offset of the capability, or 0.
*/
--
2.26.1
2016 Aug 30
4
[PATCH v2 2/2] vfio: add virtio pci quirk
.../vfio.h>
> +#include <linux/virtio_pci.h>
> +#include <linux/virtio_config.h>
> +
> +#include "vfio_pci_private.h"
> +
> +/**
> + * virtio_pci_find_capability - walk capabilities to find device info.
> + * @dev: the pci device
> + * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
> + *
> + * Returns offset of the capability, or 0.
> + */
> +static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type)
Does inlining this really make sense?
> +{
> + int pos;
> +
> + for (pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);...
2016 Aug 30
4
[PATCH v2 2/2] vfio: add virtio pci quirk
.../vfio.h>
> +#include <linux/virtio_pci.h>
> +#include <linux/virtio_config.h>
> +
> +#include "vfio_pci_private.h"
> +
> +/**
> + * virtio_pci_find_capability - walk capabilities to find device info.
> + * @dev: the pci device
> + * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
> + *
> + * Returns offset of the capability, or 0.
> + */
> +static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type)
Does inlining this really make sense?
> +{
> + int pos;
> +
> + for (pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);...
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 f...
2015 Jan 20
0
[PATCH 01/05] fixup! virtio_pci: modern driver
.../linux/virtio_pci.h
@@ -117,10 +117,11 @@ struct virtio_pci_cap {
__u8 cap_vndr; /* Generic PCI field: PCI_CAP_ID_VNDR */
__u8 cap_next; /* Generic PCI field: next ptr. */
__u8 cap_len; /* Generic PCI field: capability length */
- __u8 type_and_bar; /* Upper 3 bits: bar.
- * Lower 3 is VIRTIO_PCI_CAP_*_CFG. */
+ __u8 cfg_type; /* Identifies the structure. */
+ __u8 bar; /* Where to find it. */
+ __u8 padding[3]; /* Pad to full dword. */
__le32 offset; /* Offset within bar. */
- __le32 length; /* Length. */
+ __le32 length; /* Length of the structure, in bytes. */
};
#define VIRTIO_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 f...
2015 Jan 20
0
[PATCH 01/05] fixup! virtio_pci: modern driver
.../linux/virtio_pci.h
@@ -117,10 +117,11 @@ struct virtio_pci_cap {
__u8 cap_vndr; /* Generic PCI field: PCI_CAP_ID_VNDR */
__u8 cap_next; /* Generic PCI field: next ptr. */
__u8 cap_len; /* Generic PCI field: capability length */
- __u8 type_and_bar; /* Upper 3 bits: bar.
- * Lower 3 is VIRTIO_PCI_CAP_*_CFG. */
+ __u8 cfg_type; /* Identifies the structure. */
+ __u8 bar; /* Where to find it. */
+ __u8 padding[3]; /* Pad to full dword. */
__le32 offset; /* Offset within bar. */
- __le32 length; /* Length. */
+ __le32 length; /* Length of the structure, in bytes. */
};
#define VIRTIO_PCI...
2016 Apr 18
1
[PATCH RFC 3/3] vfio: add virtio pci quirk
...gt; +#include <linux/virtio_config.h>
I don't see where io or uaccess are needed here.
> +
> +#include "vfio_pci_private.h"
> +
> +/**
> + * virtio_pci_find_capability - walk capabilities to find device info.
> + * @dev: the pci device
> + * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
> + *
> + * Returns offset of the capability, or 0.
> + */
> +static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type)
This is called from probe code, why inline? There's already a function
with this exact same name in virtio code, can we come...
2016 Apr 18
1
[PATCH RFC 3/3] vfio: add virtio pci quirk
...gt; +#include <linux/virtio_config.h>
I don't see where io or uaccess are needed here.
> +
> +#include "vfio_pci_private.h"
> +
> +/**
> + * virtio_pci_find_capability - walk capabilities to find device info.
> + * @dev: the pci device
> + * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
> + *
> + * Returns offset of the capability, or 0.
> + */
> +static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type)
This is called from probe code, why inline? There's already a function
with this exact same name in virtio code, can we come...
2013 May 28
1
[PATCH] virtio_pci: fix capability format, comments
...nux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -129,6 +129,7 @@
struct virtio_pci_cap {
__u8 cap_vndr; /* Generic PCI field: PCI_CAP_ID_VNDR */
__u8 cap_next; /* Generic PCI field: next ptr. */
+ __u8 cap_len; /* Generic PCI field: capability length */
__u8 cfg_type; /* One of the VIRTIO_PCI_CAP_*_CFG. */
__u8 bar; /* Where to find it. */
__le32 offset; /* Offset within bar. */
@@ -154,7 +155,7 @@ struct virtio_pci_common_cfg {
/* About a specific virtqueue. */
__le16 queue_select; /* read-write */
- __le16 queue_size; /* read-write, power of 2. */
+ __le16 queue_size; /* read...
2016 Aug 30
2
[PATCH v2 2/2] vfio: add virtio pci quirk
...lt;linux/virtio_config.h>
> > > +
> > > +#include "vfio_pci_private.h"
> > > +
> > > +/**
> > > + * virtio_pci_find_capability - walk capabilities to find device info.
> > > + * @dev: the pci device
> > > + * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
> > > + *
> > > + * Returns offset of the capability, or 0.
> > > + */
> > > +static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type)
> >
> > Does inlining this really make sense?
> >
> > >...
2016 Aug 30
2
[PATCH v2 2/2] vfio: add virtio pci quirk
...lt;linux/virtio_config.h>
> > > +
> > > +#include "vfio_pci_private.h"
> > > +
> > > +/**
> > > + * virtio_pci_find_capability - walk capabilities to find device info.
> > > + * @dev: the pci device
> > > + * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
> > > + *
> > > + * Returns offset of the capability, or 0.
> > > + */
> > > +static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type)
> >
> > Does inlining this really make sense?
> >
> > >...
2016 Apr 18
0
[PATCH RFC 3/3] vfio: add virtio pci quirk
...e <linux/uaccess.h>
+#include <linux/vfio.h>
+#include <linux/virtio_pci.h>
+#include <linux/virtio_config.h>
+
+#include "vfio_pci_private.h"
+
+/**
+ * virtio_pci_find_capability - walk capabilities to find device info.
+ * @dev: the pci device
+ * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
+ *
+ * Returns offset of the capability, or 0.
+ */
+static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type)
+{
+ int pos;
+
+ for (pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
+ pos > 0;
+ pos = pci_find_next_capability(dev, pos, PCI_CAP_ID_V...
2016 Aug 30
0
[PATCH v2 2/2] vfio: add virtio pci quirk
...e <linux/uaccess.h>
+#include <linux/vfio.h>
+#include <linux/virtio_pci.h>
+#include <linux/virtio_config.h>
+
+#include "vfio_pci_private.h"
+
+/**
+ * virtio_pci_find_capability - walk capabilities to find device info.
+ * @dev: the pci device
+ * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
+ *
+ * Returns offset of the capability, or 0.
+ */
+static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type)
+{
+ int pos;
+
+ for (pos = pci_find_capability(dev, PCI_CAP_ID_VNDR);
+ pos > 0;
+ pos = pci_find_next_capability(dev, pos, PCI_CAP_ID_V...
2016 Aug 30
6
[PATCH v2 0/2] vfio: blacklist legacy virtio devices
Legacy virtio devices always bypassed an IOMMU, so using them with vfio was
never safe. This adds a quirk detecting these and disabling VFIO unless the
noiommu mode is used. At the moment, this only applies to virtio-pci devices.
The patch might make sense on stable as well.
Michael S. Tsirkin (2):
vfio: report group noiommu status
vfio: add virtio pci quirk
2016 Aug 30
6
[PATCH v2 0/2] vfio: blacklist legacy virtio devices
Legacy virtio devices always bypassed an IOMMU, so using them with vfio was
never safe. This adds a quirk detecting these and disabling VFIO unless the
noiommu mode is used. At the moment, this only applies to virtio-pci devices.
The patch might make sense on stable as well.
Michael S. Tsirkin (2):
vfio: report group noiommu status
vfio: add virtio pci quirk
2016 Aug 30
0
[PATCH v2 2/2] vfio: add virtio pci quirk
...tio_pci.h>
> > +#include <linux/virtio_config.h>
> > +
> > +#include "vfio_pci_private.h"
> > +
> > +/**
> > + * virtio_pci_find_capability - walk capabilities to find device info.
> > + * @dev: the pci device
> > + * @cfg_type: the VIRTIO_PCI_CAP_* value we seek
> > + *
> > + * Returns offset of the capability, or 0.
> > + */
> > +static inline int virtio_pci_find_capability(struct pci_dev *dev, u8 cfg_type)
>
> Does inlining this really make sense?
>
> > +{
> > + int pos;
> > +
> >...
2016 Apr 18
5
[PATCH RFC 0/3] virtio-pci: iommu support
This is an attempt to allow enabling IOMMU for DMA.
Design:
- new feature bit IOMMU_PLATFORM which means
host won't bypass IOMMU
- virtio core uses DMA API if it sees IOMMU_PLATFORM
- add quirk for vfio to disable device unless IOMMU_PLATFORM is set
or the no-iommu mode is enabled
- while I'm not sure how it will be used, it seems like a good idea to
also have