]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
Debug prints added. xen-migration/v2
authorBhupinder Thakur <bhupinder.thakur@linaro.org>
Sun, 17 Sep 2017 08:35:27 +0000 (14:05 +0530)
committerBhupinder Thakur <bhupinder.thakur@linaro.org>
Sun, 17 Sep 2017 08:35:27 +0000 (14:05 +0530)
Signed-off-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
arch/arm/xen/enlighten.c
drivers/xen/manage.c
kernel/stop_machine.c

index fe4dd622f45bf74dd7b013f9b2d281ccfd297c2d..4c636c6c51d4c6f8a74d761f2483a9423857c58d 100644 (file)
@@ -158,6 +158,7 @@ static int xen_starting_cpu(unsigned int cpu)
        struct vcpu_register_vcpu_info info;
        struct vcpu_info *vcpup;
        int err;
+    int rc;
 
 #if 0
        /* 
@@ -169,6 +170,7 @@ static int xen_starting_cpu(unsigned int cpu)
                goto after_register_vcpu_info;
 #endif
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 21, "<xen_starting_cpu 1>\n");
        pr_info("Xen: initializing cpu%d\n", cpu);
        vcpup = per_cpu_ptr(xen_vcpu_info, cpu);
 
@@ -183,6 +185,7 @@ static int xen_starting_cpu(unsigned int cpu)
 after_register_vcpu_info:
        xen_setup_runstate_info(cpu);
        enable_percpu_irq(xen_events_irq, 0);
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 21, "<xen_starting_cpu 2>\n");
        return 0;
 }
 
@@ -319,7 +322,9 @@ int xen_register_shared_info(void)
 
 void xen_vcpu_restore(void)
 {
-       xen_percpu_init();
+       unsigned int cpu = get_cpu();
+
+       xen_starting_cpu(cpu);
 
        /* XXX TODO: xen_setup_runstate_info(cpu); */
 }
index 1a53e035f576b215989f687b57bb874ec82d2e42..1482b7d1417811c504ada3dd0da7899567079358 100644 (file)
@@ -62,18 +62,25 @@ static int xen_suspend(void *data)
 {
        struct suspend_info *si = data;
        int err;
+    int rc;
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<xen_suspend 1>\n");
        BUG_ON(!irqs_disabled());
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<xen_suspend 2>\n");
        err = syscore_suspend();
        if (err) {
+           rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<xen_suspend 3>\n");
                pr_err("%s: system core suspend failed: %d\n", __func__, err);
                return err;
        }
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<xen_suspend 4>\n");
        gnttab_suspend();
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<xen_suspend 5>\n");
        xen_arch_pre_suspend();
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<xen_suspend 6>\n");
        /*
         * This hypercall returns 1 if suspend was cancelled
         * or the domain was merely checkpointed, and 0 if it
@@ -82,17 +89,23 @@ static int xen_suspend(void *data)
        si->cancelled = HYPERVISOR_suspend(xen_pv_domain()
                                            ? virt_to_gfn(xen_start_info)
                                            : 0);
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<xen_suspend 7>\n");
 
        xen_arch_post_suspend(si->cancelled);
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<xen_suspend 8>\n");
        gnttab_resume();
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<xen_suspend 9>\n");
 
        if (!si->cancelled) {
+           rc = HYPERVISOR_console_io(CONSOLEIO_write, 17, "<xen_suspend 10>\n");
                xen_irq_resume();
                xen_timer_resume();
        }
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 17, "<xen_suspend 11>\n");
        syscore_resume();
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 17, "<xen_suspend 12>\n");
        return 0;
 }
 
@@ -100,6 +113,7 @@ static void do_suspend(void)
 {
        int err;
        struct suspend_info si;
+    int rc;
 
        shutting_down = SHUTDOWN_SUSPEND;
 
@@ -109,12 +123,14 @@ static void do_suspend(void)
                goto out;
        }
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 15, "<do_suspend 1>\n");
        err = freeze_kernel_threads();
        if (err) {
                pr_err("%s: freeze kernel threads failed %d\n", __func__, err);
                goto out_thaw;
        }
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 15, "<do_suspend 2>\n");
        err = dpm_suspend_start(PMSG_FREEZE);
        if (err) {
                pr_err("%s: dpm_suspend_start %d\n", __func__, err);
@@ -122,6 +138,7 @@ static void do_suspend(void)
        }
 
        printk(KERN_DEBUG "suspending xenstore...\n");
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 15, "<do_suspend 3>\n");
        xs_suspend();
 
        err = dpm_suspend_end(PMSG_FREEZE);
@@ -131,26 +148,32 @@ static void do_suspend(void)
                goto out_resume;
        }
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 15, "<do_suspend 4>\n");
        xen_arch_suspend();
 
        si.cancelled = 1;
 
        err = stop_machine(xen_suspend, &si, cpumask_of(0));
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 15, "<do_suspend 5>\n");
 
        /* Resume console as early as possible. */
        if (!si.cancelled)
                xen_console_resume();
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 15, "<do_suspend 6>\n");
        raw_notifier_call_chain(&xen_resume_notifier, 0, NULL);
 
        dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 15, "<do_suspend 7>\n");
 
        if (err) {
                pr_err("failed to start xen_suspend: %d\n", err);
+           rc = HYPERVISOR_console_io(CONSOLEIO_write, 15, "<do_suspend 8>\n");
                si.cancelled = 1;
        }
 
        xen_arch_resume(si.cancelled);
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 15, "<do_suspend 9>\n");
 
 out_resume:
        if (!si.cancelled)
@@ -158,11 +181,17 @@ out_resume:
        else
                xs_suspend_cancel();
 
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<do_suspend 10>\n");
+
        dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
 
 out_thaw:
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<do_suspend 11>\n");
+
        thaw_processes();
 out:
+       rc = HYPERVISOR_console_io(CONSOLEIO_write, 16, "<do_suspend 12>\n");
+
        shutting_down = SHUTDOWN_INVALID;
 }
 #endif /* CONFIG_HIBERNATE_CALLBACKS */
index b7591261652d3ea88811f9d2af2a3ce188fb3320..72b3686a254e75de2f8faea6f12c7ca6c1daf4f9 100644 (file)
@@ -195,6 +195,7 @@ static int multi_cpu_stop(void *data)
        do {
                /* Chill out and ensure we re-read multi_stop_state. */
                cpu_relax_yield();
+
                if (msdata->state != curstate) {
                        curstate = msdata->state;
                        switch (curstate) {