All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] fix migrate failed when vm is in booting
@ 2017-09-06 13:05 wanghaibin
  2017-09-06 13:05 ` [RFC PATCH 1/3] kvm: arm/arm64: vgic-vits: separate vgic_its_free_list() function wanghaibin
                   ` (3 more replies)
  0 siblings, 4 replies; 29+ messages in thread
From: wanghaibin @ 2017-09-06 13:05 UTC (permalink / raw)
  To: marc.zyngier, cdall, kvmarm, andre.przywara; +Cc: wu.wubin

We have a test scenario: vmlife and migrate fixed test.

Here is a problem; VM migration failed caused the qemu core which gdb trace:

#0  0x0000ffffb023fe84 in raise () from /usr/lib64/libc.so.6
#1  0x0000ffffb0241b80 in abort () from /usr/lib64/libc.so.6
#2  0x000000000046b408 in kvm_device_access (fd=<optimized out>, group=4, attr=1, val=<optimized out>, write=<optimized out>)
    at /usr/src/debug/qemu-2.6.0/kvm-all.c:2064
#3  0x000000000059ade8 in vm_state_notify (running=running@entry=0, state=state@entry=RUN_STATE_FINISH_MIGRATE) at vl.c:1728
#4  0x000000000045736c in do_vm_stop (state=state@entry=RUN_STATE_FINISH_MIGRATE) at /usr/src/debug/qemu-2.6.0/cpus.c:744
#5  0x00000000004573bc in vm_stop (state=state@entry=RUN_STATE_FINISH_MIGRATE) at /usr/src/debug/qemu-2.6.0/cpus.c:1434
#6  0x0000000000457428 in vm_stop_force_state (state=state@entry=RUN_STATE_FINISH_MIGRATE) at /usr/src/debug/qemu-2.6.0/cpus.c:1442
#7  0x00000000006d68d0 in migration_completion (s=s@entry=0xb92d60 <current_migration.37525>, current_active_state=4, 
    current_active_state@entry=65535, old_vm_running=0xffffb03c2000, old_vm_running@entry=0xfffe934fc53f, 
    start_time=0xfffe934fcce0, start_time@entry=0xfffe934fc540) at migration/migration.c:1798
#8  0x00000000006d7480 in migration_thread (opaque=0xb92d60 <current_migration.37525>) at migration/migration.c:1995
#9  0x0000ffffb0398dc4 in start_thread () from /usr/lib64/libpthread.so.0
#10 0x0000ffffb02ef020 in thread_start () from /usr/lib64/libc.so.6

qemu failed log :
2017-08-28T12:34:29.654396Z qemu-kvm: KVM_SET_DEVICE_ATTR failed: Invalid argument

I try to debug it, and I found the migrate at the moment that the vm is still booting.

So just change the guest like :
diff --git a/drivers/pci/host/pci-host-common.c b/drivers/pci/host/pci-host-common.c
index e9a53ba..d73fc03 100644
--- a/drivers/pci/host/pci-host-common.c
+++ b/drivers/pci/host/pci-host-common.c
@@ -23,6 +23,7 @@
 #include <linux/of_pci.h>
 #include <linux/pci-ecam.h>
 #include <linux/platform_device.h>
+#include <linux/delay.h>
 
 static int gen_pci_parse_request_of_pci_ranges(struct device *dev,
                       struct list_head *resources, struct resource **bus_range)
@@ -119,6 +120,7 @@ int pci_host_common_probe(struct platform_device *pdev,
        struct pci_bus *bus, *child;
        struct pci_config_window *cfg;
        struct list_head resources;
+       int i;
 
        type = of_get_property(np, "device_type", NULL);
        if (!type || strcmp(type, "pci")) {
@@ -164,6 +166,8 @@ int pci_host_common_probe(struct platform_device *pdev,
                        pcie_bus_configure_settings(child);
        }
 
+       for (i=0;i<20000; i++)
+               udelay(1000);
        pci_bus_add_devices(bus);
        return 0;
 }

And migrate at this delay time, It must be failed.

This patchset try to fix this problem.

BTW: This patchset just a demo, haven't do more test, and the implement maybe a little evil.

Thanks



wanghaibin (3):
  kvm: arm/arm64: vgic-vits: separate vgic_its_free_list() function
  kvm: arm/arm64: vgic-vits: free its resource when vm reboot/reset
  kvm: arm/arm64: vgic-its: fix return value for restore

 virt/kvm/arm/arm.c           |  5 ++++-
 virt/kvm/arm/vgic/vgic-its.c | 26 +++++++++++++++++++-------
 virt/kvm/arm/vgic/vgic.h     |  1 +
 3 files changed, 24 insertions(+), 8 deletions(-)

-- 
1.8.3.1


_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2017-09-21 12:20 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-06 13:05 [RFC PATCH 0/3] fix migrate failed when vm is in booting wanghaibin
2017-09-06 13:05 ` [RFC PATCH 1/3] kvm: arm/arm64: vgic-vits: separate vgic_its_free_list() function wanghaibin
2017-09-12  8:50   ` wanghaibin
2017-09-12 10:08     ` Auger Eric
2017-09-13 19:13       ` Christoffer Dall
2017-09-13 19:14   ` Christoffer Dall
2017-09-16  1:59     ` wanghaibin
2017-09-16 22:17       ` Christoffer Dall
2017-09-06 13:05 ` [RFC PATCH 2/3] kvm: arm/arm64: vgic-vits: free its resource when vm reboot/reset wanghaibin
2017-09-06 16:20   ` Auger Eric
2017-09-07  1:32     ` wanghaibin
2017-09-07 11:28       ` Auger Eric
2017-09-10 18:46         ` Auger Eric
2017-09-12 11:15           ` wanghaibin
2017-09-13  8:49             ` Auger Eric
2017-09-13 19:34   ` Christoffer Dall
2017-09-13 21:13     ` Auger Eric
2017-09-14  5:34       ` Christoffer Dall
2017-09-06 13:05 ` [RFC PATCH 3/3] kvm: arm/arm64: vgic-its: fix return value for restore wanghaibin
2017-09-06 15:18   ` Auger Eric
2017-09-13 20:02     ` Christoffer Dall
2017-09-13 21:25       ` Auger Eric
2017-09-14  5:35         ` Christoffer Dall
2017-09-13 20:04   ` Christoffer Dall
2017-09-14  8:30   ` Auger Eric
2017-09-16  2:02     ` wanghaibin
2017-09-20  1:57 ` [RFC PATCH 0/3] fix migrate failed when vm is in booting wanghaibin
2017-09-20  7:16   ` Auger Eric
2017-09-21 12:17     ` wanghaibin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.