virtio: provide a way for host to monitor critical events in the device
Subsystems (2)
cover virtio: provide a way for host to monitor critical events in the device
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
This short patch series introduces a new device named virtio-notifier which does two simple things:
1. Provide a simple interface for the guest to notify the host of critical events. This is easily expandible to add support for any events we may find interesting for the host to know about.
2. Provide an "echo" interface for the host to ping the guest. This allows the host to ping the guest at intervals chosen by the host, and act accordingly if no response has been received.
Sasha Levin (2):
virtio: Introduce virtio-notifier
kvm tools: support virtio-notifier
drivers/virtio/Kconfig | 11 ++ drivers/virtio/Makefile | 1 + drivers/virtio/virtio_notifier.c | 135 ++++++++++++++++++++ include/linux/virtio_ids.h | 1 + include/linux/virtio_notifier.h | 15 +++ tools/kvm/Makefile | 1 + tools/kvm/builtin-run.c | 6 + tools/kvm/include/kvm/virtio-notifier.h | 9 ++ tools/kvm/include/kvm/virtio-pci-dev.h | 1 + tools/kvm/virtio/notifier.c | 203 +++++++++++++++++++++++++++++++ 10 files changed, 383 insertions(+), 0 deletions(-) create mode 100644 drivers/virtio/virtio_notifier.c create mode 100644 include/linux/virtio_notifier.h create mode 100644 tools/kvm/include/kvm/virtio-notifier.h create mode 100644 tools/kvm/virtio/notifier.c
Signature · 1 line
1.7.8.6
RFC 1/2 virtio: Introduce virtio-notifier
[TODO: Find a better name]
virtio-notifier is a new driver which provides guests the ability to report critical events such as a panic or OOM to the host.
The driver also provides an "echo" channel which is primed with a buffer when the driver is initialized, and allows the host to "ping" the guest to make sure the guest is still alive and well.
--- drivers/virtio/Kconfig | 11 +++ drivers/virtio/Makefile | 1 + drivers/virtio/virtio_notifier.c | 135 ++++++++++++++++++++++++++++++++++++++ include/linux/virtio_ids.h | 1 + include/linux/virtio_notifier.h | 15 ++++ 5 files changed, 163 insertions(+), 0 deletions(-) create mode 100644 drivers/virtio/virtio_notifier.c create mode 100644 include/linux/virtio_notifier.h
drivers/virtio/Kconfig +11 -0
@@ -46,4 +46,15 @@ config VIRTIO_BALLOON If unsure, say N. +config VIRTIO_NOTIFIER + tristate "Virtio notifier driver (EXPERIMENTAL)" + select VIRTIO + select VIRTIO_RING + ---help--- + This driver provides support for passing improtant notifications such as + notification about guest PANIC or OOM back to the host. + + Also, the driver provides a mechanism to detect lockups in the guest (similar + to a watchdog), notifying the host about such lockups. + endmenu
drivers/virtio/Makefile +1 -0
@@ -3,3 +3,4 @@ obj-$(CONFIG_VIRTIO_RING) += virtio_ring.o obj-$(CONFIG_VIRTIO_MMIO) += virtio_mmio.o obj-$(CONFIG_VIRTIO_PCI) += virtio_pci.o obj-$(CONFIG_VIRTIO_BALLOON) += virtio_balloon.o +obj-$(CONFIG_VIRTIO_NOTIFIER) += virtio_notifier.o
drivers/virtio/virtio_notifier.c new file +135 -0
135 lines not on this page · raw message
include/linux/virtio_ids.h +1 -0
@@ -34,6 +34,7 @@#define VIRTIO_ID_CONSOLE 3/* virtio console */ #define VIRTIO_ID_RNG 4/* virtio ring */ #define VIRTIO_ID_BALLOON 5/* virtio balloon */ +#define VIRTIO_ID_NOTIFIER 6/* virtio notifier */ #define VIRTIO_ID_RPMSG 7/* virtio remote processor messaging */ #define VIRTIO_ID_SCSI 8/* virtio scsi */ #define VIRTIO_ID_9P 9/* 9p virtio console */
include/linux/virtio_notifier.h new file +15 -0
@@ -0,0 +1,15 @@ +#ifndef _LINUX_VIRTIO_NOTIFIER_H +#define _LINUX_VIRTIO_NOTIFIER_H +/* This header is BSD licensed so anyone can use the definitions to implement +* compatible drivers/servers. */ +#include <linux/virtio_ids.h> +#include <linux/virtio_config.h> + +enum virtio_notifications { +VIRTIO_NOTIF_PANIC , +VIRTIO_NOTIF_OOM , + +VIRTIO_NOTIF_CNT +}; + +#endif /* _LINUX_VIRTIO_RNG_H */
Signature · 1 line
1.7.8.6
RFC 2/2 kvm tools: support virtio-notifier
In reply to Sasha LevinThis patch supports the new virtio-notifier driver.
When the guest experiences a panic or an OOM, it will notify the host and the host will notify the user of the event.
We also ping echo packets every second to the guest to see if it's still alive and well, I haven't actually taken care of the case when echos are gone for some reason since I'm trying to think of something useful to do with that besides yell on stdout.
--- tools/kvm/Makefile | 1 + tools/kvm/builtin-run.c | 6 + tools/kvm/include/kvm/virtio-notifier.h | 9 ++ tools/kvm/include/kvm/virtio-pci-dev.h | 1 + tools/kvm/virtio/notifier.c | 203 +++++++++++++++++++++++++++++++ 5 files changed, 220 insertions(+), 0 deletions(-) create mode 100644 tools/kvm/include/kvm/virtio-notifier.h create mode 100644 tools/kvm/virtio/notifier.c
tools/kvm/Makefile +1 -0
@@ -89,6 +89,7 @@ OBJS += hw/pci-shmem.o OBJS += kvm-ipc.o OBJS += builtin-sandbox.o OBJS += virtio/mmio.o +OBJS += virtio/notifier.o # Translate uname -m into ARCH string ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/)
tools/kvm/builtin-run.c +6 -0
@@ -33,6 +33,7 @@#include "kvm/pci-shmem.h" #include "kvm/kvm-ipc.h" #include "kvm/builtin-debug.h" +#include "kvm/virtio-notifier.h" #include <linux/types.h> #include <linux/err.h>
@@ -99,6 +100,7 @@ static bool using_rootfs;static bool custom_rootfs;static bool no_net;static bool no_dhcp; +static bool virtio_notifier;extern bool ioport_debug;extern bool mmio_debug;static int kvm_run_wrapper;
@@ -442,6 +444,7 @@ static const struct option options[] = {OPT_BOOLEAN ('\0' ,"vnc" , &vnc,"Enable VNC framebuffer" ),OPT_BOOLEAN ('\0' ,"sdl" , &sdl,"Enable SDL framebuffer" ),OPT_BOOLEAN ('\0' ,"rng" , &virtio_rng,"Enable virtio Random Number Generator" ), +OPT_BOOLEAN ('\0' ,"notifier" , &virtio_notifier,"Enable virtio notifier" ),OPT_CALLBACK ('\0' ,"9p" ,NULL ,"dir_to_share,tag_name" ,"Enable virtio 9p to share files between host and guest" , virtio_9p_rootdir_parser), OPT_STRING('\0', "console", &console, "serial, virtio or hv",
@@ -1182,6 +1185,9 @@ static int kvm_cmd_run_init(int argc, const char **argv)if (virtio_rng)virtio_rng__init (kvm); +if (virtio_notifier) +virtio_notif__init (kvm); +if (balloon)virtio_bln__init (kvm);
tools/kvm/include/kvm/virtio-notifier.h new file +9 -0
@@ -0,0 +1,9 @@ +#ifndef KVM__NOTIF_VIRTIO_H +#define KVM__NOTIF_VIRTIO_H + +struct kvm ; + +int virtio_notif__init (struct kvm *kvm); +int virtio_notif__exit (struct kvm *kvm); + +#endif /* KVM__RNG_VIRTIO_H */
tools/kvm/include/kvm/virtio-pci-dev.h +1 -0
@@ -13,6 +13,7 @@#define PCI_DEVICE_ID_VIRTIO_CONSOLE 0x1003#define PCI_DEVICE_ID_VIRTIO_RNG 0x1004#define PCI_DEVICE_ID_VIRTIO_BLN 0x1005 +#define PCI_DEVICE_ID_VIRTIO_NOTIFIER 0x1006#define PCI_DEVICE_ID_VIRTIO_9P 0x1009#define PCI_DEVICE_ID_VESA 0x2000#define PCI_DEVICE_ID_PCI_SHMEM 0x0001
tools/kvm/virtio/notifier.c new file +203 -0
203 lines not on this page · raw message
Signature · 1 line
1.7.8.6
Quoted 3 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
I clearly missed the discussion. Is this actually useful? In practice, won't you want the log from the guest? What makes a virtual guest different from a physical guest?
Guest watchdog functionality might be useful, but that's simpler to implement via a virtio watchdog device, and more effective to implement via a host facility that actually pings guest functionality (rather than the kernel).
Cheers,
Rusty.
Quoted 8 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
This short patch series introduces a new device named virtio-notifier which does two simple things:
1. Provide a simple interface for the guest to notify the host of critical
To get early OOPSes virtio will have to be compiled into the kernel. If your are so keen on using virtio for this though, why not just use dedicated virtio serial channel?
Quoted 11 lines
events. This is easily expandible to add support for any events we may find interesting for the host to know about.
2. Provide an "echo" interface for the host to ping the guest. This allows the host to ping the guest at intervals chosen by the host, and act accordingly if no response has been received.
Sasha Levin (2):
virtio: Introduce virtio-notifier
kvm tools: support virtio-notifier
Quoted 24 lines
drivers/virtio/Kconfig | 11 ++ drivers/virtio/Makefile | 1 + drivers/virtio/virtio_notifier.c | 135 ++++++++++++++++++++ include/linux/virtio_ids.h | 1 + include/linux/virtio_notifier.h | 15 +++ tools/kvm/Makefile | 1 + tools/kvm/builtin-run.c | 6 + tools/kvm/include/kvm/virtio-notifier.h | 9 ++ tools/kvm/include/kvm/virtio-pci-dev.h | 1 + tools/kvm/virtio/notifier.c | 203 +++++++++++++++++++++++++++++++ 10 files changed, 383 insertions(+), 0 deletions(-) create mode 100644 drivers/virtio/virtio_notifier.c create mode 100644 include/linux/virtio_notifier.h create mode 100644 tools/kvm/include/kvm/virtio-notifier.h create mode 100644 tools/kvm/virtio/notifier.cSignature · 7 lines
1.7.8.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
--
Gleb.
Quoted 6 lines · Rusty Russell
Quoted 3 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
I clearly missed the discussion. Is this actually useful? In practice,
Admit this is not a killer feature..
Quoted 2 lines
won't you want the log from the guest? What makes a virtual guest different from a physical guest?
Most times virt guest can do better than a physical OS. In that sense, this is where virtualization shines (live migration, hotplug for any virtual resource including net/block/cpu/memory/..).
There are plenty of niche but worth while small features such as the virtio-trace series and other that allow the host/virt-mgmt to get more insight into the guest w/o a need to configure the guest.
In theory guest OOM can trigger a host memory hot plug action. Again, I don't see it as a key feature..
Quoted 2 lines
Guest watchdog functionality might be useful, but that's simpler to
There is already a fully emulated watchdog device in qemu. Cheers,
Dor
Quoted 11 lines
implement via a virtio watchdog device, and more effective to implement via a host facility that actually pings guest functionality (rather than the kernel).
Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Sasha Levin
Quoted 3 lines
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
I clearly missed the discussion. Is this actually useful? In practice, won't you want the log from the guest? What makes a virtual guest different from a physical guest?
I'll try answering all of those questions:
My usecase for it is to help out with getting automatic debug output out of a problematic guest. I run a KVM tools guest which runs the trinity fuzzer within it. Once in a while, it finds something which causes the guest to misbehave (oops/panic/etc). At that point, the guest hangs there waiting for me to come and do something about it. With this device, I could automate that procedure and possibly make this entire bug hunting process fully automatic.
Now, I'm aware that this use case is probably not too common out there, but since there is a patch which tries to do the but by creating a whole new guest-host interface skipping virtio (https://lkml.org/lkml/2012/7/21/14), I guess this is useful in the real world as well.
Regarding the log, there are many ways to have that right now (good old serial/virtio-serial/etc), the issue is that I want to be notified of critical guest events and grepping the log sounds like the wrong way.
The difference between physical and virtual guest in this regard is by how much useful data I can retrieve out of a problem guest rather easily, and by things which which can occur as a result of these events (for example, add some memory if OOMs are happening frequently - which is not possible on physical hardware).
Quoted 4 lines
Guest watchdog functionality might be useful, but that's simpler to implement via a virtio watchdog device, and more effective to implement via a host facility that actually pings guest functionality (rather than the kernel).
I agree that this echo functionality doesn't really belong in the notifier and would probably work better as a separate virtio-watchdog. Would it make sense to split this code into a virtio-notifier and virtio-watchdog?
Quoted 5 lines · Gleb Natapov
Quoted 4 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
Quoted 7 lines
Quoted 4 lines
This short patch series introduces a new device named virtio-notifier which does two simple things:
1. Provide a simple interface for the guest to notify the host of critical
To get early OOPSes virtio will have to be compiled into the kernel. If your are so keen on using virtio for this though, why not just use dedicated virtio serial channel?
Let's separate between having log for these events and receiving notifications about them.
For the log part, I can already run a simple serial console to dump everything somewhere. I'm more concerned about having notifications about something critical happening when the guest is already up and running.
Quoted 5 lines · Gleb Natapov
Quoted 4 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
Quoted 7 lines
Quoted 4 lines
This short patch series introduces a new device named virtio-notifier which does two simple things:
1. Provide a simple interface for the guest to notify the host of critical
To get early OOPSes virtio will have to be compiled into the kernel. If your are so keen on using virtio for this though, why not just use dedicated virtio serial channel?
Let's separate between having log for these events and receiving notifications about them.
For the log part, I can already run a simple serial console to dump everything somewhere. I'm more concerned about having notifications about something critical happening when the guest is already up and running.
Quoted 9 lines · Sasha Levin
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
This short patch series introduces a new device named virtio-notifier which does two simple things:
Quoted 9 lines
Quoted 4 lines
Quoted 1 line
1. Provide a simple interface for the guest to notify the host of critical
To get early OOPSes virtio will have to be compiled into the kernel. If your are so keen on using virtio for this though, why not just use dedicated virtio serial channel?
Let's separate between having log for these events and receiving notifications about them.
For the log part, I can already run a simple serial console to dump everything somewhere. I'm more concerned about having notifications about something critical happening when the guest is already up and running.
I am talking about notifications. Run your notification protocol over dedicated virtio-serial channel. Logs goes to virtio-console as you've said.
--
Gleb.
Quoted 15 lines · Dor Laor
Quoted 6 lines · Rusty Russell
Quoted 3 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
I clearly missed the discussion. Is this actually useful? In practice,
Admit this is not a killer feature..
Quoted 2 lines
won't you want the log from the guest? What makes a virtual guest different from a physical guest?
Most times virt guest can do better than a physical OS. In that sense, this is where virtualization shines (live migration, hotplug for any virtual resource including
net/block/cpu/memory/..).
Quoted 8 lines
There are plenty of niche but worth while small features such as the virtio-trace series and other that allow the host/virt-mgmt to get more insight into the guest w/o a need to configure the guest.
In theory guest OOM can trigger a host memory hot plug action. Again, I don't see it as a key feature..
Quoted 2 lines
Guest watchdog functionality might be useful, but that's simpler to
There is already a fully emulated watchdog device in qemu.
There is, but why emulate physical devices when you can take advantage of virtio?
You could say the same about the rest of the virtio family - "There is already a fully emulated NIC device in qemu".
Quoted 15 lines · Gleb Natapov
Quoted 14 lines · Sasha Levin
Quoted 12 lines · Gleb Natapov
Quoted 8 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
This short patch series introduces a new device named virtio-notifier which does two simple things:
1. Provide a simple interface for the guest to notify the host of critical
To get early OOPSes virtio will have to be compiled into the kernel. If your are so keen on using virtio for this though, why not just use dedicated virtio serial channel?
Quoted 7 lines
Quoted 4 lines
Let's separate between having log for these events and receiving notifications about them.
For the log part, I can already run a simple serial console to dump everything somewhere. I'm more concerned about having notifications about something critical happening when the guest is already up and running.
I am talking about notifications. Run your notification protocol over dedicated virtio-serial channel. Logs goes to virtio-console as you've said.
Ah, so just add another channel into virtio-serial to pass these notifications? Good idea - I'll look into it.
Quoted 18 lines · Sasha Levin
Quoted 17 lines · Gleb Natapov
Quoted 16 lines · Sasha Levin
Quoted 5 lines · Gleb Natapov
Quoted 4 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
Quoted 7 lines
Quoted 4 lines
This short patch series introduces a new device named virtio-notifier which does two simple things:
1. Provide a simple interface for the guest to notify the host of critical
To get early OOPSes virtio will have to be compiled into the kernel. If your are so keen on using virtio for this though, why not just use dedicated virtio serial channel?
Let's separate between having log for these events and receiving notifications about them.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
For the log part, I can already run a simple serial console to dump everything somewhere. I'm more concerned about having notifications about something critical happening when the guest is already up and running.
I am talking about notifications. Run your notification protocol over dedicated virtio-serial channel. Logs goes to virtio-console as you've said.
Ah, so just add another channel into virtio-serial to pass these notifications? Good idea - I'll look into it.
Yes, that's what I mean. This solution still has the disadvantage of not been able to catch early boot oopses without compiling the whole virtio into a kernel image.
--
Gleb.
Quoted 21 lines · Sasha Levin
Quoted 20 lines · Dor Laor
Quoted 6 lines · Rusty Russell
Quoted 3 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
I clearly missed the discussion. Is this actually useful? In practice,
Admit this is not a killer feature..
Quoted 2 lines
won't you want the log from the guest? What makes a virtual guest different from a physical guest?
Most times virt guest can do better than a physical OS. In that sense, this is where virtualization shines (live migration, hotplug for any virtual resource including
net/block/cpu/memory/..).There are plenty of niche but worth while small features such as the virtio-trace series and other that allow the host/virt-mgmt to get more insight into the guest w/o a need to configure the guest.
In theory guest OOM can trigger a host memory hot plug action. Again, I don't see it as a key feature..
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Guest watchdog functionality might be useful, but that's simpler to
There is already a fully emulated watchdog device in qemu.
There is, but why emulate physical devices when you can take advantage of virtio?
You could say the same about the rest of the virtio family - "There is already a fully emulated NIC device in qemu".
The single issue virtio-nic solves is performance enhancements that can be done w/ a fully emulated NIC. The reason is that such NIC tend to access pio/mmio space a lot while virtio is designed for virtualization.
Standard watchdog device (isn't it time you'll try qemu?) isn't about performance and if that's all the functionality you need it should work fine.
btw: check the virtio-trace series that was just send in a parallel thread.
Cheers,
Dor
Quoted 24 lines · Dor Laor
Quoted 23 lines · Sasha Levin
Quoted 22 lines · Dor Laor
Quoted 6 lines · Rusty Russell
Quoted 3 lines · Sasha Levin
As it was discussed recently, there's currently no way for the guest to notify the host about panics. Further more, there's no reasonable way to notify the host of other critical events such as an OOM kill.
I clearly missed the discussion. Is this actually useful? In practice,
Admit this is not a killer feature..
Quoted 2 lines
won't you want the log from the guest? What makes a virtual guest different from a physical guest?
Most times virt guest can do better than a physical OS. In that sense, this is where virtualization shines (live migration, hotplug for any virtual resource including
net/block/cpu/memory/..).There are plenty of niche but worth while small features such as the virtio-trace series and other that allow the host/virt-mgmt to get more insight into the guest w/o a need to configure the guest.
In theory guest OOM can trigger a host memory hot plug action. Again, I don't see it as a key feature..
Quoted 2 lines
Guest watchdog functionality might be useful, but that's simpler to
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
There is already a fully emulated watchdog device in qemu.
There is, but why emulate physical devices when you can take advantage of virtio?
You could say the same about the rest of the virtio family - "There is already a fully emulated NIC device in qemu".
The single issue virtio-nic solves is performance enhancements that can be done w/ a fully emulated NIC. The reason is that such NIC tend to access pio/mmio space a lot while virtio is designed for virtualization.
virtio on it's own was introduced to help solve the fragmentation around virtualized devices, so I don't think that the main purpose of doing virtio drivers is due to any performance benefits virtio may provide.
Also consider virtio devices which don't exactly have strict performance considerations such as virtio-9p or virtio-rng.
I mean, why implement virtio-rng when qemu could just emulate some sort of a hardware RNG and just grab randomness from the host?
Quoted 1 line
Standard watchdog device (isn't it time you'll try qemu?) isn't about performance and if that's all the functionality you need it should work fine.
Don't understand me wrong, I'm not saying that there's something with the watchdog driver in qemu. All I want is to write a watchdog driver for lkvm which can take advantage of the fact it runs within a guest.
Quoted 1 line
btw: check the virtio-trace series that was just send in a parallel thread.
Will do!
Quoted 5 lines
Cheers,
Dor
Quoted 4 lines · Sasha Levin
virtio on it's own was introduced to help solve the fragmentation around virtualized devices, so I don't think that the main purpose of doing virtio drivers is due to any performance benefits virtio may provide.
There's one argument in your favor (with my Linaro hat on): ARM wants a virtio reboot button, which would look remarkably similar. There's no standard ARM hardware for this.
So a more generalized virtio-event device might make sense. But there are almost an infinite number of guest events we might want: panics, oom, low memory, stuck devices, deadlock, etc, etc. I'm concerned about trying to standardize them. If we include a unspecified free-form string, people will end up relying on the contents. If we add a feature bit for every new event, we'll end up running out of feature bits :)
CC'ing Amit for opinion over how much of this should be done via virtio-serial.
Cheers,
Rusty.
Quoted 17 lines · Rusty Russell
Quoted 4 lines · Sasha Levin
virtio on it's own was introduced to help solve the fragmentation around virtualized devices, so I don't think that the main purpose of doing virtio drivers is due to any performance benefits virtio may provide.
There's one argument in your favor (with my Linaro hat on): ARM wants a virtio reboot button, which would look remarkably similar. There's no standard ARM hardware for this.
So a more generalized virtio-event device might make sense. But there are almost an infinite number of guest events we might want: panics, oom, low memory, stuck devices, deadlock, etc, etc. I'm concerned about trying to standardize them. If we include a unspecified free-form string, people will end up relying on the contents. If we add a feature bit for every new event, we'll end up running out of feature bits :)
Quoted 2 lines
CC'ing Amit for opinion over how much of this should be done via virtio-serial.
The prevoius discussion happend on kvm-devel; it was suggested then to use virtio-serial for that as well. We don't have an in-kernel interface for communication yet (barring the console interface, which we don't want to re-use for other reasons).
Writing the in-kernel interface for communication with the host is not too much work as well.
I agree using virtio-serial for several such free-form message-passing between the guest and host is the right way to implement such stuff.
The lack of dedicated devices over either virtio or emulation of real hardware can be overcome by adding some documentation - preferably to the virtio spec's appendix, showing how watchdogs, etc., are implemented using virtio-serial.
Amit