Displaying 20 results from an estimated 74 matches for "virtio_config_val".
2011 Aug 14
2
[PATCH 1/3] virtio-console: Use virtio_config_val() for retrieving config
This patch modifies virtio-console to use virtio_config_val() instead
of a 'if(virtio_has_feature()) vdev->config->get()' construct to retrieve
optional values from the config space.
Cc: Amit Shah <amit.shah at redhat.com>
Cc: "Michael S. Tsirkin" <mst at redhat.com>
Cc: Rusty Russell <rusty at rustcorp.com.au>
Cc:...
2011 Aug 14
2
[PATCH 1/3] virtio-console: Use virtio_config_val() for retrieving config
This patch modifies virtio-console to use virtio_config_val() instead
of a 'if(virtio_has_feature()) vdev->config->get()' construct to retrieve
optional values from the config space.
Cc: Amit Shah <amit.shah at redhat.com>
Cc: "Michael S. Tsirkin" <mst at redhat.com>
Cc: Rusty Russell <rusty at rustcorp.com.au>
Cc:...
2008 Apr 22
3
[RFC PATCH] virtio: change config to guest endian.
...the config might be part of the PCI config space
for virtio_pci. It's actually a separate mmio region, so that
argument holds little water; as only x86 is currently using the virtio
mechanism, we can change this (but must do so now, before the
impending s390 and ppc merges).
API changes:
- __virtio_config_val() just becomes a striaght vdev->config_get() call.
Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
---
drivers/block/virtio_blk.c | 4 +--
drivers/virtio/virtio_balloon.c | 6 ++---
include/linux/virtio_config.h | 47 +++++++++++++---------------------------
3 file...
2008 Apr 22
3
[RFC PATCH] virtio: change config to guest endian.
...the config might be part of the PCI config space
for virtio_pci. It's actually a separate mmio region, so that
argument holds little water; as only x86 is currently using the virtio
mechanism, we can change this (but must do so now, before the
impending s390 and ppc merges).
API changes:
- __virtio_config_val() just becomes a striaght vdev->config_get() call.
Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>
---
drivers/block/virtio_blk.c | 4 +--
drivers/virtio/virtio_balloon.c | 6 ++---
include/linux/virtio_config.h | 47 +++++++++++++---------------------------
3 file...
2008 Apr 16
1
[PATCH] add virtio disk geometry feature
...standard values, similar to sd */
- geo->heads = 1 << 6;
- geo->sectors = 1 << 5;
- geo->cylinders = get_capacity(bd->bd_disk) >> 11;
+ struct virtio_blk *vblk = bd->bd_disk->private_data;
+ int err = 0;
+
+ /* see if the host passed in geometry config */
+ err = virtio_config_val(vblk->vdev, VIRTIO_BLK_F_GEOMETRY,
+ offsetof(struct virtio_blk_config, cylinders),
+ &geo->cylinders);
+
+ /* if host sets geo flag, all 3 values must be present */
+ if (!err) {
+ __virtio_config_val(vblk->vdev,
+ offsetof(struct virtio_blk_config, heads),
+ &geo-&g...
2008 Apr 16
1
[PATCH] add virtio disk geometry feature
...standard values, similar to sd */
- geo->heads = 1 << 6;
- geo->sectors = 1 << 5;
- geo->cylinders = get_capacity(bd->bd_disk) >> 11;
+ struct virtio_blk *vblk = bd->bd_disk->private_data;
+ int err = 0;
+
+ /* see if the host passed in geometry config */
+ err = virtio_config_val(vblk->vdev, VIRTIO_BLK_F_GEOMETRY,
+ offsetof(struct virtio_blk_config, cylinders),
+ &geo->cylinders);
+
+ /* if host sets geo flag, all 3 values must be present */
+ if (!err) {
+ __virtio_config_val(vblk->vdev,
+ offsetof(struct virtio_blk_config, heads),
+ &geo-&g...
2012 Sep 19
2
[PATCHv2] virtio_console: Add support for remoteproc serial
...virtcons_probe(struct virtio_device *vdev)
+static int virtcons_probe(struct virtio_device *vdev)
{
struct ports_device *portdev;
int err;
@@ -1724,10 +1804,12 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
multiport = false;
portdev->config.max_nr_ports = 1;
- if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
- offsetof(struct virtio_console_config,
- max_nr_ports),
- &portdev->config.max_nr_ports) == 0)
+ if (is_rproc_serial(vdev))
+ multiport = false;
+ else if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
+ offsetof(struc...
2012 Sep 19
2
[PATCHv2] virtio_console: Add support for remoteproc serial
...virtcons_probe(struct virtio_device *vdev)
+static int virtcons_probe(struct virtio_device *vdev)
{
struct ports_device *portdev;
int err;
@@ -1724,10 +1804,12 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
multiport = false;
portdev->config.max_nr_ports = 1;
- if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
- offsetof(struct virtio_console_config,
- max_nr_ports),
- &portdev->config.max_nr_ports) == 0)
+ if (is_rproc_serial(vdev))
+ multiport = false;
+ else if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
+ offsetof(struc...
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...p;vd_index_ida, &index);
+ spin_unlock(&vd_index_lock);
+ } while (err == -EAGAIN);
+
+ if (err)
+ return err;
+
+ if (index_to_minor(index) >= 1 << MINORBITS) {
+ err = -ENOSPC;
+ goto out_free_index;
+ }
/* We need to know how many segments before we allocate. */
err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX,
@@ -421,7 +440,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
vblk->disk->private_data = vblk;
vblk->disk->fops = &virtblk_fops;
vblk->disk->driverfs_dev = &vdev->dev;
- index++;
+ vblk->index = index;
/* con...
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...p;vd_index_ida, &index);
+ spin_unlock(&vd_index_lock);
+ } while (err == -EAGAIN);
+
+ if (err)
+ return err;
+
+ if (index_to_minor(index) >= 1 << MINORBITS) {
+ err = -ENOSPC;
+ goto out_free_index;
+ }
/* We need to know how many segments before we allocate. */
err = virtio_config_val(vdev, VIRTIO_BLK_F_SEG_MAX,
@@ -421,7 +440,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
vblk->disk->private_data = vblk;
vblk->disk->fops = &virtblk_fops;
vblk->disk->driverfs_dev = &vdev->dev;
- index++;
+ vblk->index = index;
/* con...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 1/13] [Mostly resend] virtio additions
.../
- token = vdev->config->find(vdev, VIRTIO_CONFIG_BLK_F, &len);
- if (virtio_use_bit(vdev, token, len, VIRTIO_BLK_F_BARRIER))
+ if (vdev->config->feature(vdev, VIRTIO_BLK_F_BARRIER))
blk_queue_ordered(vblk->disk->queue, QUEUE_ORDERED_TAG, NULL);
- err = virtio_config_val(vdev, VIRTIO_CONFIG_BLK_F_CAPACITY, &cap);
- if (err) {
- dev_err(&vdev->dev, "Bad/missing capacity in config\n");
- goto out_cleanup_queue;
- }
+ /* Host must always specify the capacity. */
+ __virtio_config_val(vdev, offsetof(struct virtio_blk_confi...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 1/13] [Mostly resend] virtio additions
.../
- token = vdev->config->find(vdev, VIRTIO_CONFIG_BLK_F, &len);
- if (virtio_use_bit(vdev, token, len, VIRTIO_BLK_F_BARRIER))
+ if (vdev->config->feature(vdev, VIRTIO_BLK_F_BARRIER))
blk_queue_ordered(vblk->disk->queue, QUEUE_ORDERED_TAG, NULL);
- err = virtio_config_val(vdev, VIRTIO_CONFIG_BLK_F_CAPACITY, &cap);
- if (err) {
- dev_err(&vdev->dev, "Bad/missing capacity in config\n");
- goto out_cleanup_queue;
- }
+ /* Host must always specify the capacity. */
+ __virtio_config_val(vdev, offsetof(struct virtio_blk_confi...
2013 Apr 05
8
[PATCH 0/7] virtio cleanups
Aiming these for coming merge window.
Nothing should change, but get ready for a non-guest-endian config transports,
and > 32 features bits.
Final one is just an overdue consolidation.
Cheers,
Rusty.
Rusty Russell (7):
virtio_config: introduce size-based accessors.
virtio: use size-based config accessors.
virtio_config: helpers for non-converting accessors.
virtio_config: make
2013 Apr 05
8
[PATCH 0/7] virtio cleanups
Aiming these for coming merge window.
Nothing should change, but get ready for a non-guest-endian config transports,
and > 32 features bits.
Final one is just an overdue consolidation.
Cheers,
Rusty.
Rusty Russell (7):
virtio_config: introduce size-based accessors.
virtio: use size-based config accessors.
virtio_config: helpers for non-converting accessors.
virtio_config: make
2011 Nov 01
2
[PULL] virtio
...add "config" to list for !per_vq_vector
>
> Michael S. Tsirkin (1):
> virtio-blk: use ida to allocate disk index
>
> Pawel Moll (1):
> virtio: Add platform bus driver for memory mapped virtio device
>
> Sasha Levin (3):
> virtio-console: Use virtio_config_val() for retrieving config
> virtio_config: Add virtio_config_val_len()
> virtio-net: Use virtio_config_val() for retrieving config
>
> Wang Sheng-Hui (2):
> virtio.h: correct comment for struct virtio_driver
> virtio: modify vring_init and vring_size to take...
2011 Nov 01
2
[PULL] virtio
...add "config" to list for !per_vq_vector
>
> Michael S. Tsirkin (1):
> virtio-blk: use ida to allocate disk index
>
> Pawel Moll (1):
> virtio: Add platform bus driver for memory mapped virtio device
>
> Sasha Levin (3):
> virtio-console: Use virtio_config_val() for retrieving config
> virtio_config: Add virtio_config_val_len()
> virtio-net: Use virtio_config_val() for retrieving config
>
> Wang Sheng-Hui (2):
> virtio.h: correct comment for struct virtio_driver
> virtio: modify vring_init and vring_size to take...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
...port->portdev->vdev)) {
+ while ((buf = virtqueue_detach_unused_buf(port->out_vq)))
+ free_buf(buf);
+ }
}
/*
@@ -1722,13 +1847,17 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
goto free;
}
- multiport = false;
- portdev->config.max_nr_ports = 1;
- if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
- offsetof(struct virtio_console_config,
- max_nr_ports),
- &portdev->config.max_nr_ports) == 0)
+ /* Don't test MULTIPORT at all if we're rproc: not a valid feature! */
+ if (!is_rproc_serial(vdev) &&
+ virtio_c...
2012 Sep 24
2
[PATCHv4] virtio_console: Add support for remoteproc serial
...port->portdev->vdev)) {
+ while ((buf = virtqueue_detach_unused_buf(port->out_vq)))
+ free_buf(buf);
+ }
}
/*
@@ -1722,13 +1847,17 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
goto free;
}
- multiport = false;
- portdev->config.max_nr_ports = 1;
- if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
- offsetof(struct virtio_console_config,
- max_nr_ports),
- &portdev->config.max_nr_ports) == 0)
+ /* Don't test MULTIPORT at all if we're rproc: not a valid feature! */
+ if (!is_rproc_serial(vdev) &&
+ virtio_c...
2012 Sep 13
0
[PATCH] virtio_console: Add support for remoteproc serial
...virtcons_probe(struct virtio_device *vdev)
+static int virtcons_probe(struct virtio_device *vdev)
{
struct ports_device *portdev;
int err;
@@ -1724,10 +1785,12 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
multiport = false;
portdev->config.max_nr_ports = 1;
- if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
- offsetof(struct virtio_console_config,
- max_nr_ports),
- &portdev->config.max_nr_ports) == 0)
+ if (is_rproc_serial(vdev))
+ multiport = false;
+ else if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
+ offsetof(struc...
2012 Sep 13
0
[PATCH] virtio_console: Add support for remoteproc serial
...virtcons_probe(struct virtio_device *vdev)
+static int virtcons_probe(struct virtio_device *vdev)
{
struct ports_device *portdev;
int err;
@@ -1724,10 +1785,12 @@ static int __devinit virtcons_probe(struct virtio_device *vdev)
multiport = false;
portdev->config.max_nr_ports = 1;
- if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
- offsetof(struct virtio_console_config,
- max_nr_ports),
- &portdev->config.max_nr_ports) == 0)
+ if (is_rproc_serial(vdev))
+ multiport = false;
+ else if (virtio_config_val(vdev, VIRTIO_CONSOLE_F_MULTIPORT,
+ offsetof(struc...