diff options
Diffstat (limited to 'arch/x86/lguest')
-rw-r--r-- | arch/x86/lguest/boot.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index a63373759f08..5afdde4895dc 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -67,6 +67,7 @@ | |||
67 | #include <asm/mce.h> | 67 | #include <asm/mce.h> |
68 | #include <asm/io.h> | 68 | #include <asm/io.h> |
69 | #include <asm/i387.h> | 69 | #include <asm/i387.h> |
70 | #include <asm/reboot.h> /* for struct machine_ops */ | ||
70 | 71 | ||
71 | /*G:010 Welcome to the Guest! | 72 | /*G:010 Welcome to the Guest! |
72 | * | 73 | * |
@@ -813,7 +814,7 @@ static void lguest_safe_halt(void) | |||
813 | * rather than virtual addresses, so we use __pa() here. */ | 814 | * rather than virtual addresses, so we use __pa() here. */ |
814 | static void lguest_power_off(void) | 815 | static void lguest_power_off(void) |
815 | { | 816 | { |
816 | hcall(LHCALL_CRASH, __pa("Power down"), 0, 0); | 817 | hcall(LHCALL_SHUTDOWN, __pa("Power down"), LGUEST_SHUTDOWN_POWEROFF, 0); |
817 | } | 818 | } |
818 | 819 | ||
819 | /* | 820 | /* |
@@ -823,7 +824,7 @@ static void lguest_power_off(void) | |||
823 | */ | 824 | */ |
824 | static int lguest_panic(struct notifier_block *nb, unsigned long l, void *p) | 825 | static int lguest_panic(struct notifier_block *nb, unsigned long l, void *p) |
825 | { | 826 | { |
826 | hcall(LHCALL_CRASH, __pa(p), 0, 0); | 827 | hcall(LHCALL_SHUTDOWN, __pa(p), LGUEST_SHUTDOWN_POWEROFF, 0); |
827 | /* The hcall won't return, but to keep gcc happy, we're "done". */ | 828 | /* The hcall won't return, but to keep gcc happy, we're "done". */ |
828 | return NOTIFY_DONE; | 829 | return NOTIFY_DONE; |
829 | } | 830 | } |
@@ -927,6 +928,11 @@ static unsigned lguest_patch(u8 type, u16 clobber, void *ibuf, | |||
927 | return insn_len; | 928 | return insn_len; |
928 | } | 929 | } |
929 | 930 | ||
931 | static void lguest_restart(char *reason) | ||
932 | { | ||
933 | hcall(LHCALL_SHUTDOWN, __pa(reason), LGUEST_SHUTDOWN_RESTART, 0); | ||
934 | } | ||
935 | |||
930 | /*G:030 Once we get to lguest_init(), we know we're a Guest. The pv_ops | 936 | /*G:030 Once we get to lguest_init(), we know we're a Guest. The pv_ops |
931 | * structures in the kernel provide points for (almost) every routine we have | 937 | * structures in the kernel provide points for (almost) every routine we have |
932 | * to override to avoid privileged instructions. */ | 938 | * to override to avoid privileged instructions. */ |
@@ -1060,6 +1066,7 @@ __init void lguest_init(void) | |||
1060 | * the Guest routine to power off. */ | 1066 | * the Guest routine to power off. */ |
1061 | pm_power_off = lguest_power_off; | 1067 | pm_power_off = lguest_power_off; |
1062 | 1068 | ||
1069 | machine_ops.restart = lguest_restart; | ||
1063 | /* Now we're set up, call start_kernel() in init/main.c and we proceed | 1070 | /* Now we're set up, call start_kernel() in init/main.c and we proceed |
1064 | * to boot as normal. It never returns. */ | 1071 | * to boot as normal. It never returns. */ |
1065 | start_kernel(); | 1072 | start_kernel(); |