[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] nvmx deadlock with MSR bitmaps
Hello, Testing has encountered this deadlock: (XEN) Watchdog timer detects that CPU0 is stuck! (XEN) ----[ Xen-4.14.0-9.0.4-d x86_64 debug=y Not tainted ]---- (XEN) CPU: 0 (XEN) RIP: e008:[<ffff82d08022d6ae>] _spin_lock+0x34/0x5e (XEN) RFLAGS: 0000000000000002 CONTEXT: hypervisor (d0v0) (XEN) rax: 0000000000009a44 rbx: ffff8308466712b8 rcx: 0000000000009a45 (XEN) rdx: ffff8308466712b8 rsi: 0000000000009a44 rdi: ffff8308466712be (XEN) rbp: ffff8300952c7b08 rsp: ffff8300952c7af8 r8: 0000000000000000 (XEN) r9: 0000000000000000 r10: 0000000000000000 r11: 0000000000000000 (XEN) r12: ffff8308466712be r13: ffff83084665a000 r14: 0000000000555e52 (XEN) r15: 0000000000000002 cr0: 000000008005003b cr4: 00000000001526e0 (XEN) cr3: 0000000555e52000 cr2: ffff820060001008 (XEN) fsb: 0000000000000000 gsb: 0000000000000000 gss: ffff8e80987a0000 (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: e008 (XEN) Xen code around <ffff82d08022d6ae> (_spin_lock+0x34/0x5e): (XEN) da 89 c1 f3 90 66 8b 02 <66> 39 c1 75 f6 4c 89 e7 e8 85 fe ff ff 48 8d 05 (XEN) Xen stack trace from rsp=ffff8300952c7af8: (XEN) ffff830846671000 ffff820060001008 ffff8300952c7b58 ffff82d0803219d7 (XEN) ffff8308466712b8 0000000000000086 ffff82d08038d979 ffff8300952c7bd8 (XEN) ffff820060001008 0000000000000000 0000000000000000 0000000000000001 (XEN) ffff8300952c7bc8 ffff82d080356332 0000000000000046 ffff82d08038d96d (XEN) 0000000000000000 000000008038d96d ffff82d08038d979 ffff82d08038d96d (XEN) ffff82d08038d979 ffff83084665a000 0000000000000000 0000000000000000 (XEN) ffff8300952c7fff 0000000000000000 00007cff6ad38407 ffff82d08038da3d (XEN) 0000000000000001 00000000005d4a49 ffff83084665a000 0000000000000080 (XEN) ffff8300952c7c88 000000000000005e 0000048ee9d28fde 0000048ee9c2fae4 (XEN) 0000000000002000 0000000000000000 0000000000000001 000000000000001e (XEN) 0000000000000022 0000000000000080 ffff820060001008 0000000e00000000 (XEN) ffff82d08031729f 000000000000e008 0000000000010016 ffff8300952c7c80 (XEN) 0000000000000000 ffff830846671000 ffff8300952c7cd8 ffff82d080321a4d (XEN) ffff8308466712b8 0000000000000086 0000000000557140 00000000b6a065fa (XEN) ffff830555e6e000 0000000010000000 00007d2000000000 ffff8305571a4000 (XEN) ffff8300952c7d08 ffff82d08029eeb2 ffff830555e6e000 ffff830846671000 (XEN) 0000000000000000 ffff830555e6e000 ffff8300952c7d28 ffff82d080299f5a (XEN) ffff830555e6e000 ffff830555e6e000 ffff8300952c7d48 ffff82d08029a3f7 (XEN) ffff8300952c7d48 ffff83084665a000 ffff8300952c7da8 ffff82d08031d796 (XEN) ffff8300952c7d78 ffff8300952c7ef8 ffff8300952c7d78 ffff82d08029e684 (XEN) Xen call trace: (XEN) [<ffff82d08022d6ae>] R _spin_lock+0x34/0x5e (XEN) [<ffff82d0803219d7>] F map_domain_page+0x250/0x527 (XEN) [<ffff82d080356332>] F do_page_fault+0x420/0x780 (XEN) [<ffff82d08038da3d>] F x86_64/entry.S#handle_exception_saved+0x68/0x94 (XEN) [<ffff82d08031729f>] F __find_next_zero_bit+0x28/0x69 (XEN) [<ffff82d080321a4d>] F map_domain_page+0x2c6/0x527 (XEN) [<ffff82d08029eeb2>] F nvmx_update_exec_control+0x1d7/0x323 (XEN) [<ffff82d080299f5a>] F vmx_update_cpu_exec_control+0x23/0x40 (XEN) [<ffff82d08029a3f7>] F arch/x86/hvm/vmx/vmx.c#vmx_ctxt_switch_from+0xb7/0x121 (XEN) [<ffff82d08031d796>] F arch/x86/domain.c#__context_switch+0x124/0x4a9 (XEN) [<ffff82d080320925>] F context_switch+0x154/0x62c (XEN) [<ffff82d080252f3e>] F common/sched/core.c#sched_context_switch+0x16a/0x175 (XEN) [<ffff82d080253877>] F common/sched/core.c#schedule+0x2ad/0x2bc (XEN) [<ffff82d08022cc97>] F common/softirq.c#__do_softirq+0xb7/0xc8 (XEN) [<ffff82d08022cd38>] F do_softirq+0x18/0x1a (XEN) [<ffff82d0802a2fbb>] F vmx_asm_do_vmentry+0x2b/0x30 (XEN) (XEN) CPU1 @ e008:ffff82d080252d45 (sched_context_switched+0xa3/0x132) (XEN) CPU7 @ e008:ffff82d08022d6ae (_spin_lock+0x34/0x5e) (XEN) CPU3 @ e008:ffff82d08022d6ae (_spin_lock+0x34/0x5e) (XEN) CPU5 @ e008:ffff82d08022d6ab (_spin_lock+0x31/0x5e) (XEN) CPU4 @ e008:ffff82d08022d547 (common/spinlock.c#got_lock+0x7/0x23) (XEN) CPU6 @ e008:ffff82d08025318a (common/sched/core.c#sched_wait_rendezvous_in+0x241/0x39e) (XEN) CPU2 @ e008:ffff82d08022d6ae (_spin_lock+0x34/0x5e) (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) FATAL TRAP: vector = 2 (nmi) (XEN) [error_code=0000] , IN INTERRUPT CONTEXT (XEN) **************************************** (XEN) (XEN) Reboot in five seconds... (XEN) Executing kexec image on cpu0 (XEN) Shot down all CPUs This is ultimately cased by c47984aab "nvmx: implement support for MSR bitmaps", which adds a map_domain_page() call in the middle of context_switch(), which isn't safe. Specifically, this is a switch from an HVM vcpu, to a PV vcpu, where the mapcache code tries to access the per-domain mappings on the HVM monitor table. It ends up trying to recursively acquire the mapcache lock while trying to walk %cr2 to identify the source of the fault. For nvmx->msr_merged, this needs to either be a xenheap page, or a globally mapped domheap page. I'll draft a patch in a moment. For map_domain_page(), is there anything we can rationally do to assert that it isn't called in the middle of a context switch? This is the kind of thing which needs to blow up reliably in a debug build. ~Andrew _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |