aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
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 */