Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 99566
b: refs/heads/master
c: 9c7a794
h: refs/heads/master
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and Ingo Molnar committed Jun 2, 2008
1 parent 55b4e50 commit 9dfbb4f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e2426cf85f8db5891fb5831323d2d0c176c4dadc
refs/heads/master: 9c7a794209f8a91f47697c3be20597eb60531e6d
30 changes: 29 additions & 1 deletion trunk/arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct shared_info *HYPERVISOR_shared_info = (void *)&xen_dummy_shared_info;
*/
static int have_vcpu_info_placement = 1;

static void __init xen_vcpu_setup(int cpu)
static void xen_vcpu_setup(int cpu)
{
struct vcpu_register_vcpu_info info;
int err;
Expand Down Expand Up @@ -136,6 +136,34 @@ static void __init xen_vcpu_setup(int cpu)
}
}

/*
* On restore, set the vcpu placement up again.
* If it fails, then we're in a bad state, since
* we can't back out from using it...
*/
void xen_vcpu_restore(void)
{
if (have_vcpu_info_placement) {
int cpu;

for_each_online_cpu(cpu) {
bool other_cpu = (cpu != smp_processor_id());

if (other_cpu &&
HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL))
BUG();

xen_vcpu_setup(cpu);

if (other_cpu &&
HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL))
BUG();
}

BUG_ON(!have_vcpu_info_placement);
}
}

static void __init xen_banner(void)
{
printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/x86/xen/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ void xen_pre_suspend(void)

void xen_post_suspend(int suspend_cancelled)
{
xen_setup_shared_info();

if (suspend_cancelled) {
xen_start_info->store_mfn =
pfn_to_mfn(xen_start_info->store_mfn);
Expand All @@ -35,8 +37,8 @@ void xen_post_suspend(int suspend_cancelled)
#ifdef CONFIG_SMP
xen_cpu_initialized_map = cpu_online_map;
#endif
xen_vcpu_restore();
}

xen_setup_shared_info();
}

1 change: 1 addition & 0 deletions trunk/arch/x86/xen/xen-ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ char * __init xen_memory_setup(void);
void __init xen_arch_setup(void);
void __init xen_init_IRQ(void);
void xen_enable_sysenter(void);
void xen_vcpu_restore(void);

void __init xen_build_dynamic_phys_to_machine(void);

Expand Down

0 comments on commit 9dfbb4f

Please sign in to comment.