diff options
Diffstat (limited to 'arch/x86/xen/enlighten.c')
-rw-r--r-- | arch/x86/xen/enlighten.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 09b36e9d507a..b211a04c4b2c 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -11,6 +11,7 @@ | |||
11 | * Jeremy Fitzhardinge <jeremy@xensource.com>, XenSource Inc, 2007 | 11 | * Jeremy Fitzhardinge <jeremy@xensource.com>, XenSource Inc, 2007 |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include <linux/cpu.h> | ||
14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
15 | #include <linux/init.h> | 16 | #include <linux/init.h> |
16 | #include <linux/smp.h> | 17 | #include <linux/smp.h> |
@@ -38,6 +39,7 @@ | |||
38 | #include <xen/interface/memory.h> | 39 | #include <xen/interface/memory.h> |
39 | #include <xen/features.h> | 40 | #include <xen/features.h> |
40 | #include <xen/page.h> | 41 | #include <xen/page.h> |
42 | #include <xen/hvm.h> | ||
41 | #include <xen/hvc-console.h> | 43 | #include <xen/hvc-console.h> |
42 | 44 | ||
43 | #include <asm/paravirt.h> | 45 | #include <asm/paravirt.h> |
@@ -80,6 +82,8 @@ struct shared_info xen_dummy_shared_info; | |||
80 | void *xen_initial_gdt; | 82 | void *xen_initial_gdt; |
81 | 83 | ||
82 | RESERVE_BRK(shared_info_page_brk, PAGE_SIZE); | 84 | RESERVE_BRK(shared_info_page_brk, PAGE_SIZE); |
85 | __read_mostly int xen_have_vector_callback; | ||
86 | EXPORT_SYMBOL_GPL(xen_have_vector_callback); | ||
83 | 87 | ||
84 | /* | 88 | /* |
85 | * Point at some empty memory to start with. We map the real shared_info | 89 | * Point at some empty memory to start with. We map the real shared_info |
@@ -1277,6 +1281,24 @@ static void __init init_shared_info(void) | |||
1277 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; | 1281 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; |
1278 | } | 1282 | } |
1279 | 1283 | ||
1284 | static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self, | ||
1285 | unsigned long action, void *hcpu) | ||
1286 | { | ||
1287 | int cpu = (long)hcpu; | ||
1288 | switch (action) { | ||
1289 | case CPU_UP_PREPARE: | ||
1290 | per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; | ||
1291 | break; | ||
1292 | default: | ||
1293 | break; | ||
1294 | } | ||
1295 | return NOTIFY_OK; | ||
1296 | } | ||
1297 | |||
1298 | static struct notifier_block __cpuinitdata xen_hvm_cpu_notifier = { | ||
1299 | .notifier_call = xen_hvm_cpu_notify, | ||
1300 | }; | ||
1301 | |||
1280 | static void __init xen_hvm_guest_init(void) | 1302 | static void __init xen_hvm_guest_init(void) |
1281 | { | 1303 | { |
1282 | int r; | 1304 | int r; |
@@ -1287,6 +1309,12 @@ static void __init xen_hvm_guest_init(void) | |||
1287 | return; | 1309 | return; |
1288 | 1310 | ||
1289 | init_shared_info(); | 1311 | init_shared_info(); |
1312 | |||
1313 | if (xen_feature(XENFEAT_hvm_callback_vector)) | ||
1314 | xen_have_vector_callback = 1; | ||
1315 | register_cpu_notifier(&xen_hvm_cpu_notifier); | ||
1316 | have_vcpu_info_placement = 0; | ||
1317 | x86_init.irqs.intr_init = xen_init_IRQ; | ||
1290 | } | 1318 | } |
1291 | 1319 | ||
1292 | static bool __init xen_hvm_platform(void) | 1320 | static bool __init xen_hvm_platform(void) |