aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2008-06-20 09:24:18 -0400
committerRusty Russell <rusty@rustcorp.com.au>2008-07-24 22:06:07 -0400
commitfaeba830b086bc9e58748869054e994cb09693cd (patch)
tree5d2f2beb6b3ae012c7eedaa48bc1845cb156945f /drivers
parent7721c494a28e06543a3d6aa412957aa783a4a531 (diff)
s390: use virtio_console for KVM on s390
This patch enables virtio_console as the default console on kvm for s390. We currently use the same notify hack as lguest for early console output. I will try to address this for lguest and s390 later. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/kvm/kvm_virtio.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c
index 5ab34340919b..d41f234bb2c2 100644
--- a/drivers/s390/kvm/kvm_virtio.c
+++ b/drivers/s390/kvm/kvm_virtio.c
@@ -15,6 +15,7 @@
15#include <linux/err.h> 15#include <linux/err.h>
16#include <linux/virtio.h> 16#include <linux/virtio.h>
17#include <linux/virtio_config.h> 17#include <linux/virtio_config.h>
18#include <linux/virtio_console.h>
18#include <linux/interrupt.h> 19#include <linux/interrupt.h>
19#include <linux/virtio_ring.h> 20#include <linux/virtio_ring.h>
20#include <linux/pfn.h> 21#include <linux/pfn.h>
@@ -333,6 +334,25 @@ static int __init kvm_devices_init(void)
333 return 0; 334 return 0;
334} 335}
335 336
337/* code for early console output with virtio_console */
338static __init int early_put_chars(u32 vtermno, const char *buf, int count)
339{
340 char scratch[17];
341 unsigned int len = count;
342
343 if (len > sizeof(scratch) - 1)
344 len = sizeof(scratch) - 1;
345 scratch[len] = '\0';
346 memcpy(scratch, buf, len);
347 kvm_hypercall1(KVM_S390_VIRTIO_NOTIFY, __pa(scratch));
348 return len;
349}
350
351void s390_virtio_console_init(void)
352{
353 virtio_cons_early_init(early_put_chars);
354}
355
336/* 356/*
337 * We do this after core stuff, but before the drivers. 357 * We do this after core stuff, but before the drivers.
338 */ 358 */