aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/kvm/kvm_main.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 1be510b657fd..326fa79fbebf 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -54,8 +54,6 @@ static cpumask_t cpus_hardware_enabled;
54 54
55struct kvm_arch_ops *kvm_arch_ops; 55struct kvm_arch_ops *kvm_arch_ops;
56 56
57static void hardware_disable(void *ignored);
58
59#define STAT_OFFSET(x) offsetof(struct kvm_vcpu, stat.x) 57#define STAT_OFFSET(x) offsetof(struct kvm_vcpu, stat.x)
60 58
61static struct kvm_stats_debugfs_item { 59static struct kvm_stats_debugfs_item {
@@ -2924,25 +2922,6 @@ static struct miscdevice kvm_dev = {
2924 &kvm_chardev_ops, 2922 &kvm_chardev_ops,
2925}; 2923};
2926 2924
2927static int kvm_reboot(struct notifier_block *notifier, unsigned long val,
2928 void *v)
2929{
2930 if (val == SYS_RESTART) {
2931 /*
2932 * Some (well, at least mine) BIOSes hang on reboot if
2933 * in vmx root mode.
2934 */
2935 printk(KERN_INFO "kvm: exiting hardware virtualization\n");
2936 on_each_cpu(hardware_disable, NULL, 0, 1);
2937 }
2938 return NOTIFY_OK;
2939}
2940
2941static struct notifier_block kvm_reboot_notifier = {
2942 .notifier_call = kvm_reboot,
2943 .priority = 0,
2944};
2945
2946/* 2925/*
2947 * Make sure that a cpu that is being hot-unplugged does not have any vcpus 2926 * Make sure that a cpu that is being hot-unplugged does not have any vcpus
2948 * cached on it. 2927 * cached on it.
@@ -3025,6 +3004,25 @@ static int kvm_cpu_hotplug(struct notifier_block *notifier, unsigned long val,
3025 return NOTIFY_OK; 3004 return NOTIFY_OK;
3026} 3005}
3027 3006
3007static int kvm_reboot(struct notifier_block *notifier, unsigned long val,
3008 void *v)
3009{
3010 if (val == SYS_RESTART) {
3011 /*
3012 * Some (well, at least mine) BIOSes hang on reboot if
3013 * in vmx root mode.
3014 */
3015 printk(KERN_INFO "kvm: exiting hardware virtualization\n");
3016 on_each_cpu(hardware_disable, NULL, 0, 1);
3017 }
3018 return NOTIFY_OK;
3019}
3020
3021static struct notifier_block kvm_reboot_notifier = {
3022 .notifier_call = kvm_reboot,
3023 .priority = 0,
3024};
3025
3028void kvm_io_bus_init(struct kvm_io_bus *bus) 3026void kvm_io_bus_init(struct kvm_io_bus *bus)
3029{ 3027{
3030 memset(bus, 0, sizeof(*bus)); 3028 memset(bus, 0, sizeof(*bus));