diff options
Diffstat (limited to 'arch/x86/lguest/boot.c')
-rw-r--r-- | arch/x86/lguest/boot.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 959aeebb02f5..495e46a1f111 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -55,6 +55,7 @@ | |||
55 | #include <linux/clockchips.h> | 55 | #include <linux/clockchips.h> |
56 | #include <linux/lguest.h> | 56 | #include <linux/lguest.h> |
57 | #include <linux/lguest_launcher.h> | 57 | #include <linux/lguest_launcher.h> |
58 | #include <linux/virtio_console.h> | ||
58 | #include <asm/paravirt.h> | 59 | #include <asm/paravirt.h> |
59 | #include <asm/param.h> | 60 | #include <asm/param.h> |
60 | #include <asm/page.h> | 61 | #include <asm/page.h> |
@@ -849,6 +850,23 @@ static __init char *lguest_memory_setup(void) | |||
849 | return "LGUEST"; | 850 | return "LGUEST"; |
850 | } | 851 | } |
851 | 852 | ||
853 | /* Before virtqueues are set up, we use LHCALL_NOTIFY on normal memory to | ||
854 | * produce console output. */ | ||
855 | static __init int early_put_chars(u32 vtermno, const char *buf, int count) | ||
856 | { | ||
857 | char scratch[17]; | ||
858 | unsigned int len = count; | ||
859 | |||
860 | if (len > sizeof(scratch) - 1) | ||
861 | len = sizeof(scratch) - 1; | ||
862 | scratch[len] = '\0'; | ||
863 | memcpy(scratch, buf, len); | ||
864 | hcall(LHCALL_NOTIFY, __pa(scratch), 0, 0); | ||
865 | |||
866 | /* This routine returns the number of bytes actually written. */ | ||
867 | return len; | ||
868 | } | ||
869 | |||
852 | /*G:050 | 870 | /*G:050 |
853 | * Patching (Powerfully Placating Performance Pedants) | 871 | * Patching (Powerfully Placating Performance Pedants) |
854 | * | 872 | * |
@@ -1048,6 +1066,9 @@ __init void lguest_init(void *boot) | |||
1048 | * adapted for lguest's use. */ | 1066 | * adapted for lguest's use. */ |
1049 | add_preferred_console("hvc", 0, NULL); | 1067 | add_preferred_console("hvc", 0, NULL); |
1050 | 1068 | ||
1069 | /* Register our very early console. */ | ||
1070 | virtio_cons_early_init(early_put_chars); | ||
1071 | |||
1051 | /* Last of all, we set the power management poweroff hook to point to | 1072 | /* Last of all, we set the power management poweroff hook to point to |
1052 | * the Guest routine to power off. */ | 1073 | * the Guest routine to power off. */ |
1053 | pm_power_off = lguest_power_off; | 1074 | pm_power_off = lguest_power_off; |