From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X8403-0005Jw-FW for qemu-devel@nongnu.org; Fri, 18 Jul 2014 04:58:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X83zv-0002J8-KT for qemu-devel@nongnu.org; Fri, 18 Jul 2014 04:58:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X83zv-0002J2-Cc for qemu-devel@nongnu.org; Fri, 18 Jul 2014 04:58:35 -0400 Date: Fri, 18 Jul 2014 14:27:54 +0530 From: Amit Shah Message-ID: <20140718085754.GB15020@grmbl.mre> References: <20140716115229.GA7741@amt.cnet> <53C6EE7C.60702@beyond.pl> <53C79C41.4000800@beyond.pl> <53C7B989.9000203@beyond.pl> <53C7CEE5.4080006@beyond.pl> <53C8DF68.5040705@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <53C8DF68.5040705@redhat.com> Content-Transfer-Encoding: quoted-printable 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: Paolo Bonzini Cc: Fam Zheng , Andrey Korolyov , Marcin =?utf-8?Q?Gibu=C5=82a?= , "qemu-devel@nongnu.org" , Marcelo Tosatti On (Fri) 18 Jul 2014 [10:48:40], Paolo Bonzini wrote: > Il 17/07/2014 15:25, Marcin Gibu=C5=82a ha scritto: > >+static void do_kvm_cpu_synchronize_state_always(void *arg) > >+{ > >+ CPUState *cpu =3D arg; > >+ > >+ kvm_arch_get_registers(cpu); > >+} > >+ >=20 > The name of the hack^Wfunction is tricky, because compared to > do_kvm_cpu_synchronize_state there are three things you change: >=20 > 1) you always synchronize the state >=20 > 2) the next call to do_kvm_cpu_synchronize_state will do > kvm_arch_get_registers >=20 > 3) the next CPU entry will call kvm_arch_put_registers: >=20 > if (cpu->kvm_vcpu_dirty) { > kvm_arch_put_registers(cpu, KVM_PUT_RUNTIME_STATE); > cpu->kvm_vcpu_dirty =3D false; > } >=20 > It is easy to find out if the "fix" is related to 1 or 2/3: just write >=20 > 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"); > } >=20 > To further refine between 2 and 3, I suppose you can set a breakpoint o= n > cpu_synchronize_all_states and kvm_cpu_exec, and see which is called fi= rst > after cpu_synchronize_all_states_always. >=20 > I still lean very much towards reverting the patches now. We can reapp= ly > them, fixed, in 2.1.1. FWIW I agree with this plan. Amit