diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/xen/enlighten.c | 24 | ||||
-rw-r--r-- | arch/x86/xen/suspend.c | 6 | ||||
-rw-r--r-- | arch/x86/xen/xen-ops.h | 1 |
3 files changed, 25 insertions, 6 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index b211a04c4b2c..127c95c8d15e 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1262,13 +1262,15 @@ static int init_hvm_pv_info(int *major, int *minor) | |||
1262 | return 0; | 1262 | return 0; |
1263 | } | 1263 | } |
1264 | 1264 | ||
1265 | static void __init init_shared_info(void) | 1265 | void xen_hvm_init_shared_info(void) |
1266 | { | 1266 | { |
1267 | int cpu; | ||
1267 | struct xen_add_to_physmap xatp; | 1268 | struct xen_add_to_physmap xatp; |
1268 | struct shared_info *shared_info_page; | 1269 | static struct shared_info *shared_info_page = 0; |
1269 | 1270 | ||
1270 | shared_info_page = (struct shared_info *) | 1271 | if (!shared_info_page) |
1271 | extend_brk(PAGE_SIZE, PAGE_SIZE); | 1272 | shared_info_page = (struct shared_info *) |
1273 | extend_brk(PAGE_SIZE, PAGE_SIZE); | ||
1272 | xatp.domid = DOMID_SELF; | 1274 | xatp.domid = DOMID_SELF; |
1273 | xatp.idx = 0; | 1275 | xatp.idx = 0; |
1274 | xatp.space = XENMAPSPACE_shared_info; | 1276 | xatp.space = XENMAPSPACE_shared_info; |
@@ -1278,7 +1280,17 @@ static void __init init_shared_info(void) | |||
1278 | 1280 | ||
1279 | HYPERVISOR_shared_info = (struct shared_info *)shared_info_page; | 1281 | HYPERVISOR_shared_info = (struct shared_info *)shared_info_page; |
1280 | 1282 | ||
1281 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; | 1283 | /* xen_vcpu is a pointer to the vcpu_info struct in the shared_info |
1284 | * page, we use it in the event channel upcall and in some pvclock | ||
1285 | * related functions. We don't need the vcpu_info placement | ||
1286 | * optimizations because we don't use any pv_mmu or pv_irq op on | ||
1287 | * HVM. | ||
1288 | * When xen_hvm_init_shared_info is run at boot time only vcpu 0 is | ||
1289 | * online but xen_hvm_init_shared_info is run at resume time too and | ||
1290 | * in that case multiple vcpus might be online. */ | ||
1291 | for_each_online_cpu(cpu) { | ||
1292 | per_cpu(xen_vcpu, cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu]; | ||
1293 | } | ||
1282 | } | 1294 | } |
1283 | 1295 | ||
1284 | static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self, | 1296 | static int __cpuinit xen_hvm_cpu_notify(struct notifier_block *self, |
@@ -1308,7 +1320,7 @@ static void __init xen_hvm_guest_init(void) | |||
1308 | if (r < 0) | 1320 | if (r < 0) |
1309 | return; | 1321 | return; |
1310 | 1322 | ||
1311 | init_shared_info(); | 1323 | xen_hvm_init_shared_info(); |
1312 | 1324 | ||
1313 | if (xen_feature(XENFEAT_hvm_callback_vector)) | 1325 | if (xen_feature(XENFEAT_hvm_callback_vector)) |
1314 | xen_have_vector_callback = 1; | 1326 | xen_have_vector_callback = 1; |
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c index a9c661108034..d07479c340f5 100644 --- a/arch/x86/xen/suspend.c +++ b/arch/x86/xen/suspend.c | |||
@@ -26,6 +26,12 @@ void xen_pre_suspend(void) | |||
26 | BUG(); | 26 | BUG(); |
27 | } | 27 | } |
28 | 28 | ||
29 | void xen_hvm_post_suspend(int suspend_cancelled) | ||
30 | { | ||
31 | xen_hvm_init_shared_info(); | ||
32 | xen_callback_vector(); | ||
33 | } | ||
34 | |||
29 | void xen_post_suspend(int suspend_cancelled) | 35 | void xen_post_suspend(int suspend_cancelled) |
30 | { | 36 | { |
31 | xen_build_mfn_list_list(); | 37 | xen_build_mfn_list_list(); |
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 0d0e0e6a7479..01c9dd386522 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h | |||
@@ -39,6 +39,7 @@ void xen_enable_syscall(void); | |||
39 | void xen_vcpu_restore(void); | 39 | void xen_vcpu_restore(void); |
40 | 40 | ||
41 | void xen_callback_vector(void); | 41 | void xen_callback_vector(void); |
42 | void xen_hvm_init_shared_info(void); | ||
42 | 43 | ||
43 | void __init xen_build_dynamic_phys_to_machine(void); | 44 | void __init xen_build_dynamic_phys_to_machine(void); |
44 | 45 | ||