Displaying 20 results from an estimated 37 matches for "virtio_pci_cap_pci_cfg".
2016 Aug 30
4
[PATCH v2 2/2] vfio: add virtio pci quirk
...CI_CAP_ID_VNDR)) {
> + u8 type;
> + pci_read_config_byte(dev, pos + offsetof(struct virtio_pci_cap,
> + cfg_type),
> + &type);
> +
> + if (type != cfg_type)
> + continue;
> +
> + /* Ignore structures with reserved BAR values */
> + if (type != VIRTIO_PCI_CAP_PCI_CFG) {
> + u8 bar;
> +
> + pci_read_config_byte(dev, pos +
> + offsetof(struct virtio_pci_cap,
> + bar),
> + &bar);
> + if (bar > 0x5)
s/0x5/PCI_STD_RESOURCE_END/
> + continue;
> + }
> +
> + return pos;
> + }
> + re...
2016 Aug 30
4
[PATCH v2 2/2] vfio: add virtio pci quirk
...CI_CAP_ID_VNDR)) {
> + u8 type;
> + pci_read_config_byte(dev, pos + offsetof(struct virtio_pci_cap,
> + cfg_type),
> + &type);
> +
> + if (type != cfg_type)
> + continue;
> +
> + /* Ignore structures with reserved BAR values */
> + if (type != VIRTIO_PCI_CAP_PCI_CFG) {
> + u8 bar;
> +
> + pci_read_config_byte(dev, pos +
> + offsetof(struct virtio_pci_cap,
> + bar),
> + &bar);
> + if (bar > 0x5)
s/0x5/PCI_STD_RESOURCE_END/
> + continue;
> + }
> +
> + return pos;
> + }
> + re...
2015 Jul 02
0
[PATCH] virtio: define virtio_pci_cfg_cap in header.
We already have VIRTIO_PCI_CAP_PCI_CFG, let's define the structure that
goes with it.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
include/uapi/linux/virtio_pci.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 7530146..90007a1 100...
2015 Jul 02
0
[PATCH] virtio: define virtio_pci_cfg_cap in header.
We already have VIRTIO_PCI_CAP_PCI_CFG, let's define the structure that
goes with it.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
include/uapi/linux/virtio_pci.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 7530146..90007a1 100...
2016 Apr 18
1
[PATCH RFC 3/3] vfio: add virtio pci quirk
...CI_CAP_ID_VNDR)) {
> + u8 type;
> + pci_read_config_byte(dev, pos + offsetof(struct virtio_pci_cap,
> + cfg_type),
> + &type);
> +
> + if (type != cfg_type)
> + continue;
> +
> + /* Ignore structures with reserved BAR values */
> + if (type != VIRTIO_PCI_CAP_PCI_CFG) {
> + u8 bar;
> +
> + pci_read_config_byte(dev, pos +
> + offsetof(struct virtio_pci_cap,
> + bar),
> + &bar);
> + if (bar > 0x5)
> + continue;
> + }
> +
> + return pos;
> + }
> + return 0;
> +}
> +
> +...
2016 Apr 18
1
[PATCH RFC 3/3] vfio: add virtio pci quirk
...CI_CAP_ID_VNDR)) {
> + u8 type;
> + pci_read_config_byte(dev, pos + offsetof(struct virtio_pci_cap,
> + cfg_type),
> + &type);
> +
> + if (type != cfg_type)
> + continue;
> +
> + /* Ignore structures with reserved BAR values */
> + if (type != VIRTIO_PCI_CAP_PCI_CFG) {
> + u8 bar;
> +
> + pci_read_config_byte(dev, pos +
> + offsetof(struct virtio_pci_cap,
> + bar),
> + &bar);
> + if (bar > 0x5)
> + continue;
> + }
> +
> + return pos;
> + }
> + return 0;
> +}
> +
> +...
2016 Aug 30
2
[PATCH v2 2/2] vfio: add virtio pci quirk
...etof(struct virtio_pci_cap,
> > > + cfg_type),
> > > + &type);
> > > +
> > > + if (type != cfg_type)
> > > + continue;
> > > +
> > > + /* Ignore structures with reserved BAR values */
> > > + if (type != VIRTIO_PCI_CAP_PCI_CFG) {
> > > + u8 bar;
> > > +
> > > + pci_read_config_byte(dev, pos +
> > > + offsetof(struct virtio_pci_cap,
> > > + bar),
> > > + &bar);
> > > + if (bar > 0x5)
> >
> > s/0x5/PCI_...
2016 Aug 30
2
[PATCH v2 2/2] vfio: add virtio pci quirk
...etof(struct virtio_pci_cap,
> > > + cfg_type),
> > > + &type);
> > > +
> > > + if (type != cfg_type)
> > > + continue;
> > > +
> > > + /* Ignore structures with reserved BAR values */
> > > + if (type != VIRTIO_PCI_CAP_PCI_CFG) {
> > > + u8 bar;
> > > +
> > > + pci_read_config_byte(dev, pos +
> > > + offsetof(struct virtio_pci_cap,
> > > + bar),
> > > + &bar);
> > > + if (bar > 0x5)
> >
> > s/0x5/PCI_...
2016 Apr 18
0
[PATCH RFC 3/3] vfio: add virtio pci quirk
...+ pos = pci_find_next_capability(dev, pos, PCI_CAP_ID_VNDR)) {
+ u8 type;
+ pci_read_config_byte(dev, pos + offsetof(struct virtio_pci_cap,
+ cfg_type),
+ &type);
+
+ if (type != cfg_type)
+ continue;
+
+ /* Ignore structures with reserved BAR values */
+ if (type != VIRTIO_PCI_CAP_PCI_CFG) {
+ u8 bar;
+
+ pci_read_config_byte(dev, pos +
+ offsetof(struct virtio_pci_cap,
+ bar),
+ &bar);
+ if (bar > 0x5)
+ continue;
+ }
+
+ return pos;
+ }
+ return 0;
+}
+
+
+int vfio_pci_virtio_quirk(struct vfio_pci_device *vdev, int noiommu)
+{
+ struc...
2016 Aug 30
0
[PATCH v2 2/2] vfio: add virtio pci quirk
...+ pos = pci_find_next_capability(dev, pos, PCI_CAP_ID_VNDR)) {
+ u8 type;
+ pci_read_config_byte(dev, pos + offsetof(struct virtio_pci_cap,
+ cfg_type),
+ &type);
+
+ if (type != cfg_type)
+ continue;
+
+ /* Ignore structures with reserved BAR values */
+ if (type != VIRTIO_PCI_CAP_PCI_CFG) {
+ u8 bar;
+
+ pci_read_config_byte(dev, pos +
+ offsetof(struct virtio_pci_cap,
+ bar),
+ &bar);
+ if (bar > 0x5)
+ continue;
+ }
+
+ return pos;
+ }
+ return 0;
+}
+
+
+int vfio_pci_virtio_quirk(struct vfio_pci_device *vdev, bool noiommu)
+{
+ stru...
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
...+ pci_read_config_byte(dev, pos + offsetof(struct virtio_pci_cap,
> > + cfg_type),
> > + &type);
> > +
> > + if (type != cfg_type)
> > + continue;
> > +
> > + /* Ignore structures with reserved BAR values */
> > + if (type != VIRTIO_PCI_CAP_PCI_CFG) {
> > + u8 bar;
> > +
> > + pci_read_config_byte(dev, pos +
> > + offsetof(struct virtio_pci_cap,
> > + bar),
> > + &bar);
> > + if (bar > 0x5)
>
> s/0x5/PCI_STD_RESOURCE_END/
>
> > + continue...
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
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
2016 Aug 30
0
[PATCH v2 2/2] vfio: add virtio pci quirk
...t; > + cfg_type),
> > > > + &type);
> > > > +
> > > > + if (type != cfg_type)
> > > > + continue;
> > > > +
> > > > + /* Ignore structures with reserved BAR values */
> > > > + if (type != VIRTIO_PCI_CAP_PCI_CFG) {
> > > > + u8 bar;
> > > > +
> > > > + pci_read_config_byte(dev, pos +
> > > > + offsetof(struct virtio_pci_cap,
> > > > + bar),
> > > > + &bar);
> > > > + if (bar > 0x5)...
2015 Feb 11
2
[RFC 0/2] virtio_pci: patches never to apply.
This should allow testing when QEMU gets VIRTIO_PCI_CAP_PCI_CFG support,
but I'm pretty sure we should never allow these patches upstream.
Tested with lguest (in virtio-next), which supports VIRTIO_PCI_CAP_PCI_CFG.
Rusty Russell (2):
virtio_pci: abstract all MMIO accesses.
virtio: Introducing virtio_pci.no_mmio, the worst boot option in
history....
2015 Feb 11
2
[RFC 0/2] virtio_pci: patches never to apply.
This should allow testing when QEMU gets VIRTIO_PCI_CAP_PCI_CFG support,
but I'm pretty sure we should never allow these patches upstream.
Tested with lguest (in virtio-next), which supports VIRTIO_PCI_CAP_PCI_CFG.
Rusty Russell (2):
virtio_pci: abstract all MMIO accesses.
virtio: Introducing virtio_pci.no_mmio, the worst boot option in
history....
2019 Nov 22
0
[RFC 13/13] iommu/virtio: Add topology description to
...xt_capability(dev, pos, PCI_CAP_ID_VNDR)) {
+ u8 type;
+
+ pci_read_config_byte(dev, pos + VPCI_FIELD(cfg_type), &type);
+ if (type != cfg_type)
+ continue;
+
+ pci_read_config_byte(dev, pos + VPCI_FIELD(bar), &bar);
+
+ /* Ignore structures with reserved BAR values */
+ if (type != VIRTIO_PCI_CAP_PCI_CFG && bar > 0x5)
+ continue;
+
+ cap->bar = bar;
+ cap->pos = pos;
+ pci_read_config_dword(dev, pos + VPCI_FIELD(length),
+ &cap->length);
+ pci_read_config_dword(dev, pos + VPCI_FIELD(offset),
+ &cap->offset);
+
+ return pos;
+ }
+ return 0;
+}...
2020 Aug 19
0
[PATCH v3 04/18] virtio: Implement get_shm_region for PCI transport
.../**
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index 90007a1abcab..3a86f36d7e3d 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -113,6 +113,8 @@
#define VIRTIO_PCI_CAP_DEVICE_CFG 4
/* PCI configuration access */
#define VIRTIO_PCI_CAP_PCI_CFG 5
+/* Additional shared memory capability */
+#define VIRTIO_PCI_CAP_SHARED_MEMORY_CFG 8
/* This is the PCI capability header: */
struct virtio_pci_cap {
@@ -121,11 +123,18 @@ struct virtio_pci_cap {
__u8 cap_len; /* Generic PCI field: capability length */
__u8 cfg_type; /* Identifies th...