Displaying 20 results from an estimated 28 matches for "fill_readbuf".
2014 Dec 01
1
[PATCH] virtio_console: fix sparse warnings
...char/virtio_console.c:687:36: got char *out_buf
drivers/char/virtio_console.c:790:35: warning: incorrect type in
argument 2 (different address spaces)
drivers/char/virtio_console.c:790:35: expected char *out_buf
drivers/char/virtio_console.c:790:35: got char [noderef]
<asn:1>*ubuf
fill_readbuf is reused with both kernel and userspace pointers,
depending on value of to_user flag.
Tag address parameter as __user, and cast to/from regular pointer type
when we know it's safe.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
drivers/char/virtio_console.c | 9 +++++----
1...
2014 Dec 01
1
[PATCH] virtio_console: fix sparse warnings
...char/virtio_console.c:687:36: got char *out_buf
drivers/char/virtio_console.c:790:35: warning: incorrect type in
argument 2 (different address spaces)
drivers/char/virtio_console.c:790:35: expected char *out_buf
drivers/char/virtio_console.c:790:35: got char [noderef]
<asn:1>*ubuf
fill_readbuf is reused with both kernel and userspace pointers,
depending on value of to_user flag.
Tag address parameter as __user, and cast to/from regular pointer type
when we know it's safe.
Signed-off-by: Michael S. Tsirkin <mst at redhat.com>
---
drivers/char/virtio_console.c | 9 +++++----
1...
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...>vq_ops->get_buf(out_vq, &tmplen))
+ while (!out_vq->vq_ops->get_buf(out_vq, &len))
cpu_relax();
-
- buf->len = tmplen;
fail:
/* We're expected to return the amount of data we wrote */
- return buf->len;
+ return len;
}
/*
@@ -461,26 +436,25 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count,
bool to_user)
{
struct port_buffer *buf;
- ssize_t ret;
unsigned long flags;
if (!out_count || !port_has_data(port))
return 0;
buf = port->inbuf;
- if (out_count > buf->len - buf->offset)
- out_count = buf->...
2010 Jan 29
3
virtio: console: Return -EFAULT on copy_xx_user errors, allow larger writes
...>vq_ops->get_buf(out_vq, &tmplen))
+ while (!out_vq->vq_ops->get_buf(out_vq, &len))
cpu_relax();
-
- buf->len = tmplen;
fail:
/* We're expected to return the amount of data we wrote */
- return buf->len;
+ return len;
}
/*
@@ -461,26 +436,25 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count,
bool to_user)
{
struct port_buffer *buf;
- ssize_t ret;
unsigned long flags;
if (!out_count || !port_has_data(port))
return 0;
buf = port->inbuf;
- if (out_count > buf->len - buf->offset)
- out_count = buf->...
2009 Sep 11
1
Multiple ports support for virtio_console; major number for dev
Hello,
This is the patch that I have for adding support for multiple ports to
virtio_console. It's pretty stable in my testing so far and the memory
corruption that I had earlier has been resolved in linux-next so I'm
proposing this for inclusion.
This currently uses device major number 60 from the experimental range;
Alan could you please reserve a new major number for virtio_console?
2009 Sep 11
1
Multiple ports support for virtio_console; major number for dev
Hello,
This is the patch that I have for adding support for multiple ports to
virtio_console. It's pretty stable in my testing so far and the memory
corruption that I had earlier has been resolved in linux-next so I'm
proposing this for inclusion.
This currently uses device major number 60 from the experimental range;
Alan could you please reserve a new major number for virtio_console?
2009 Sep 29
0
[PATCH] virtio_console: Add support for multiple ports for generic guest and host communication
...n_len) {
- in = in_vq->vq_ops->get_buf(in_vq, &in_len);
- if (!in)
+static inline bool is_internal(u32 flags)
+{
+ return flags & VIRTIO_CONSOLE_ID_INTERNAL;
+}
+
+/*
+ * Give out the data that's requested from the buffers that we have
+ * queued up per port
+ */
+static ssize_t fill_readbuf(struct virtio_console_port *port,
+ char *out_buf, size_t out_count, bool to_user)
+{
+ struct virtio_console_port_buffer *buf, *buf2;
+ ssize_t out_offset, ret;
+
+ out_offset = 0;
+ list_for_each_entry_safe(buf, buf2, &port->readbuf_head, next) {
+ size_t copy_size;
+
+ copy_size =...
2009 Sep 29
0
[PATCH] virtio_console: Add support for multiple ports for generic guest and host communication
...n_len) {
- in = in_vq->vq_ops->get_buf(in_vq, &in_len);
- if (!in)
+static inline bool is_internal(u32 flags)
+{
+ return flags & VIRTIO_CONSOLE_ID_INTERNAL;
+}
+
+/*
+ * Give out the data that's requested from the buffers that we have
+ * queued up per port
+ */
+static ssize_t fill_readbuf(struct virtio_console_port *port,
+ char *out_buf, size_t out_count, bool to_user)
+{
+ struct virtio_console_port_buffer *buf, *buf2;
+ ssize_t out_offset, ret;
+
+ out_offset = 0;
+ list_for_each_entry_safe(buf, buf2, &port->readbuf_head, next) {
+ size_t copy_size;
+
+ copy_size =...
2009 Nov 10
2
virtio_console: support for multiple ports, console and generic.
...sizing.
Patch 9 adds port hotplug
Patch 10 adds sysfs entries and 12 adds debugfs.
Patches 13, 14 and 15 add throttling, caching and unplug features.
There's also a one-device restriction; which would be addressed once I
use vdev->priv.
My main aim is to get comments on the send_buf and fill_readbuf
functions, the input/output workqueues and hotplug.
Amit
2009 Nov 10
2
virtio_console: support for multiple ports, console and generic.
...sizing.
Patch 9 adds port hotplug
Patch 10 adds sysfs entries and 12 adds debugfs.
Patches 13, 14 and 15 add throttling, caching and unplug features.
There's also a one-device restriction; which would be addressed once I
use vdev->priv.
My main aim is to get comments on the send_buf and fill_readbuf
functions, the input/output workqueues and hotplug.
Amit
2009 Oct 12
1
[PATCH v8 0/1] virtio_console: Add support for multiple console ports and generic serial ports
Hello all,
Here is a new iteration of the patch series that implements a
transport for guest and host communications.
I've tested for compatibility (old qemu & new kernel, new qemu & old
kernel, new qemu & new kernel) and it all works fine. To maintain
backward compatibility, the first port to be spawned (port at id 0) is
to be a console port, to be bound to hvc. This keeps new
2009 Oct 12
1
[PATCH v8 0/1] virtio_console: Add support for multiple console ports and generic serial ports
Hello all,
Here is a new iteration of the patch series that implements a
transport for guest and host communications.
I've tested for compatibility (old qemu & new kernel, new qemu & old
kernel, new qemu & new kernel) and it all works fine. To maintain
backward compatibility, the first port to be spawned (port at id 0) is
to be a console port, to be bound to hvc. This keeps new
2010 Aug 26
5
[PATCH 0/4] virtio: console: fixes, SIGIO
Hi Rusty,
The main thing in these patches is the introduction of injecting SIGIO
on host-side connect/disconnect events and when new data is available
for ports.
The first two patches fix bugs that I haven't seen, but look like the
right thing to do.
These have been tested extensively using the test-virtserial test
suite.
Please apply,
Amit.
Amit Shah (4):
virtio: console: Un-block
2010 Aug 26
5
[PATCH 0/4] virtio: console: fixes, SIGIO
Hi Rusty,
The main thing in these patches is the introduction of injecting SIGIO
on host-side connect/disconnect events and when new data is available
for ports.
The first two patches fix bugs that I haven't seen, but look like the
right thing to do.
These have been tested extensively using the test-virtserial test
suite.
Please apply,
Amit.
Amit Shah (4):
virtio: console: Un-block
2009 Oct 20
1
[PATCH v9 0/1] virtio-console: Support for generic ports and multiple consoles
Hello all,
Here is a new iteration of the patch series that implements a
transport for guest and host communications.
I've tested for compatibility (old qemu & new kernel, new qemu & old
kernel, new qemu & new kernel) and it all works fine. To maintain
backward compatibility, the first port to be spawned (port at id 0) is
to be a console port, to be bound to hvc. This keeps new
2009 Oct 20
1
[PATCH v9 0/1] virtio-console: Support for generic ports and multiple consoles
Hello all,
Here is a new iteration of the patch series that implements a
transport for guest and host communications.
I've tested for compatibility (old qemu & new kernel, new qemu & old
kernel, new qemu & new kernel) and it all works fine. To maintain
backward compatibility, the first port to be spawned (port at id 0) is
to be a console port, to be bound to hvc. This keeps new
2009 Nov 03
3
[PATCH v10 0/1] virtio-console: Support for generic ports and multiple consoles
(Rusty, would it improve the chances of getting this patch in your
tree if this description were written with latex instead of without
it?)
Here is a new iteration of the patch series that implements a
transport for guest and host communications.
I've tested for compatibility (old qemu & new kernel, new qemu & old
kernel, new qemu & new kernel) and it all works fine. To maintain
2009 Nov 03
3
[PATCH v10 0/1] virtio-console: Support for generic ports and multiple consoles
(Rusty, would it improve the chances of getting this patch in your
tree if this description were written with latex instead of without
it?)
Here is a new iteration of the patch series that implements a
transport for guest and host communications.
I've tested for compatibility (old qemu & new kernel, new qemu & old
kernel, new qemu & new kernel) and it all works fine. To maintain
2009 Sep 03
3
Multiple port support for virtio-console
Hello all,
Here is a new iteration of the patch series that implements a
transport for guest and host communications.
I've tested for compatibility (old qemu & new kernel, new qemu & old
kernel, new qemu & new kernel) and it all works fine*.
There are a few items on my todo list but this works well.
New since last send:
- live migration support**
- write path in the guest
2009 Sep 03
3
Multiple port support for virtio-console
Hello all,
Here is a new iteration of the patch series that implements a
transport for guest and host communications.
I've tested for compatibility (old qemu & new kernel, new qemu & old
kernel, new qemu & new kernel) and it all works fine*.
There are a few items on my todo list but this works well.
New since last send:
- live migration support**
- write path in the guest