From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X83qZ-0001O7-Ix for qemu-devel@nongnu.org; Fri, 18 Jul 2014 04:49:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X83qQ-0008BW-Bv for qemu-devel@nongnu.org; Fri, 18 Jul 2014 04:48:55 -0400 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]:63024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X83qQ-0008BH-4Q for qemu-devel@nongnu.org; Fri, 18 Jul 2014 04:48:46 -0400 Received: by mail-we0-f174.google.com with SMTP id x48so4376508wes.33 for ; Fri, 18 Jul 2014 01:48:44 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <53C8DF68.5040705@redhat.com> Date: Fri, 18 Jul 2014 10:48:40 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140715050318.GD26186@grmbl.mre> <20140715210948.GA20036@amt.cnet> <53C5A4C9.80609@redhat.com> <20140716011634.GA30717@amt.cnet> <20140716115229.GA7741@amt.cnet> <53C6EE7C.60702@beyond.pl> <53C79C41.4000800@beyond.pl> <53C7B989.9000203@beyond.pl> <53C7CEE5.4080006@beyond.pl> In-Reply-To: <53C7CEE5.4080006@beyond.pl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] latest rc: virtio-blk hangs forever after migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TWFyY2luIEdpYnXFgmE=?= , Andrey Korolyov Cc: Amit Shah , Marcelo Tosatti , Fam Zheng , "qemu-devel@nongnu.org" Il 17/07/2014 15:25, Marcin GibuĊ‚a ha scritto: > +static void do_kvm_cpu_synchronize_state_always(void *arg) > +{ > + CPUState *cpu = arg; > + > + kvm_arch_get_registers(cpu); > +} > + The name of the hack^Wfunction is tricky, because compared to do_kvm_cpu_synchronize_state there are three things you change: 1) you always synchronize the state 2) the next call to do_kvm_cpu_synchronize_state will do kvm_arch_get_registers 3) the next CPU entry will call kvm_arch_put_registers: if (cpu->kvm_vcpu_dirty) { kvm_arch_put_registers(cpu, KVM_PUT_RUNTIME_STATE); cpu->kvm_vcpu_dirty = false; } It is easy to find out if the "fix" is related to 1 or 2/3: just write if (cpu->kvm_vcpu_dirty) { printf ("do_kvm_cpu_synchronize_state_always: look at 2/3\n"); kvm_arch_get_registers(cpu); } else { printf ("do_kvm_cpu_synchronize_state_always: look at 1\n"); } To further refine between 2 and 3, I suppose you can set a breakpoint on cpu_synchronize_all_states and kvm_cpu_exec, and see which is called first after cpu_synchronize_all_states_always. I still lean very much towards reverting the patches now. We can reapply them, fixed, in 2.1.1. Paolo