Hey Rusty,
This is a respin of my patches on top of the series you posted.
I've taken the liberty to modify your patches for style consistency
and comments where needed, keeping the authorship info intact.
I've had to update a few of your patches for functional changes, I've
changed the authorsh
From: Rusty Russell
That way, we can make it const as is good kernel style. We use a separate
indirection for the early console, rather than mugging ops.put_chars.
We rename it hv_ops, too.
Signed-off-by: Rusty Russell
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 60 ++
From: Rusty Russell
Remove old lguest-style comments.
[Amit: - wingify comments acc. to kernel style
- indent comments ]
Signed-off-by: Rusty Russell
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 108
include/linux/virtio_conso
From: Rusty Russell
This is nicer for modern R/O protection. And noone needs it non-const, so
constify the callers as well.
Signed-off-by: Rusty Russell
Signed-off-by: Amit Shah
To: Christian Borntraeger
Cc: linuxppc-...@ozlabs.org
---
drivers/char/hvc_beat.c |2 +-
drivers/char/h
From: Rusty Russell
Part of removing our "one console" assumptions, use vdev->priv to point
to the port (currently == the global console).
Signed-off-by: Rusty Russell
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 10 --
1 files changed, 8 insertions(+), 2 deletions(-
From: Rusty Russell
We are heading towards a multiple-"port" system, so as part of weaning off
globals we encapsulate the information into 'struct port'.
Signed-off-by: Rusty Russell
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 103 +---
1
We support only one virtio_console device at a time. If multiple are
found, error out if one is already initialized.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c |5 +
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/char/virtio_console.c b/drivers/cha
Rather than assume a single port, add a 'struct ports_device' which
stores data related to all the ports for that device.
Currently, there's only one port and is hooked up with hvc, but that
will change.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 154 +++--
Keep a list of all ports being used as a console, and provide a lock
and a lookup function. The hvc callbacks only give us a vterm number,
so we need to map this.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 72 +
1 files changed, 65 ins
When multiple console support is added, ensure each port's size gets
updated when a new one is opened via hvc.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 33 +
1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/drivers/char/virtio
From: Rusty Russell
Now we can use an allocation function to remove our global console variable.
Signed-off-by: Rusty Russell
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 70 +++-
1 files changed, 47 insertions(+), 23 deletions(-)
diff --
We currently only maintain one buffer per port for any data the
host sends us. If we're slow in consuming that data, we might lose
old data. To buffer the data that the host sends us, we need to be
able to allocate buffers as and when the host sends us some.
Using a workqueue gives us the freedom
Console ports could be hot-added. Also, with the new multiport support,
a port is identified as a console port only if the host sends a control
message.
Move the console port init into a separate function so it can be invoked
from other places.
Signed-off-by: Amit Shah
---
drivers/char/virtio_c
To identify which port data that gets sent to the Host belongs to, we'll
have to add a 'header' to each outgoing buffer that will tell the Host
the port number.
This is also done for each buffer that's received from userspace.
The header is currently a 0-length field, but will contain the port id
The char device will be used as an interface by applications on the
guest to communicate with apps on the host.
The devices created are placed in /dev/vportNpn where N is the
virtio-console device number and n is the port number for that device.
The file operation for the char devs will be added
This commit adds a new feature, MULTIPORT. If the host supports this
feature as well, the config space has the number of ports defined for
that device. New ports are spawned according to this information.
Using this feature, generic ports can be created which are not tied to
hvc consoles.
We also
If the 'nr_ports' variable in the config space is updated to
a higher value, that means new ports have been hotplugged.
Introduce a new workqueue to handle such updates and create
new ports.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 73 +-
Move out console-specific stuff into a separate struct from 'struct
port' as we need to maintain two lists: one for all the ports (which
includes consoles) and one only for consoles since the hvc callbacks
only give us the vtermno.
This makes console handling cleaner.
Signed-off-by: Amit Shah
--
This is helpful in examining ports' state.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 78 +
1 files changed, 78 insertions(+), 0 deletions(-)
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index 8ed57c2..1ca
Add a guest_connected field that ensures only one process
can have a port open at a time.
This also ensures we don't have a race when we later add support for
dropping buffers when closing the char dev and buffer caching is turned
off for the particular port.
Signed-off-by: Amit Shah
---
driver
Remove port data; deregister from the hvc core if it's a console port.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 69 +--
include/linux/virtio_console.h |1 +
2 files changed, 66 insertions(+), 4 deletions(-)
diff --git a/drivers/char
If caching of buffers upon closing a port is not desired,
delete all the buffers queued up for the port upon port
close.
This only applies to generic ports; console ports aren't
opened / closed by the chardev interface.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 37
Allow guest userspace applications to open, read from, write to, poll
the ports via the char dev interface.
When a port gets opened, a notification is sent to the host via a
control message indicating a connection has been established. Similarly,
on closing of the port, a notification is sent indi
The virtio console, which uses hvc, will get the ability to hot-unplug
ports. Export hvc_remove so that virtio_console can disassociate with
hvc.
Signed-off-by: Amit Shah
Cc: linuxppc-...@ozlabs.org
---
drivers/char/hvc_console.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff -
Rogue processes on guests or hosts could pump in data
and cause an OOM condition. Add support for throttling
so that a limit to the number of outstanding buffers
can be specified.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 78 ++-
include/
The console could be flooded with data from the host; handle
this situation by buffering the data.
We move from the per-port inbuf to a per-device queue of buffers,
shared by all the ports for that device, ready to receive host data.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c |
The old way of sending data to the host was to populate one buffer and
then wait till the host consumed it before sending the next chunk of
data.
Also, there was no support to send large chunks of data.
We now maintain a per-device list of buffers that are ready to be
passed on to the host.
This
The host can set a name for ports so that they're easily discoverable
instead of going by the /dev/vportNpn naming. This attribute will be
placed in /sys/class/vportdevN/vportNpn/name. udev scripts can then
create symlinks to the port using the name.
Signed-off-by: Amit Shah
---
drivers/char/vir
When ports get advertised as char devices, the buffers will come from
userspace. Equip the send_buf and fill_readbuf functions with the
ability to write to / read from userspace buffers respectively.
Signed-off-by: Amit Shah
---
drivers/char/virtio_console.c | 51 --
29 matches
Mail list logo