From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] call kvm_cpu_synchronize_state() on target vcpu Date: Wed, 09 Sep 2009 18:21:48 +0200 Message-ID: <4AA7D61C.7080004@siemens.com> References: <20090909153309.GD22885@redhat.com> <4AA7CE01.1030808@siemens.com> <20090909154919.GE22885@redhat.com> <4AA7D074.5010207@siemens.com> <20090909160734.GG22885@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "avi@redhat.com" , kvm-devel To: Gleb Natapov Return-path: Received: from goliath.siemens.de ([192.35.17.28]:24820 "EHLO goliath.siemens.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753717AbZIIQVo (ORCPT ); Wed, 9 Sep 2009 12:21:44 -0400 In-Reply-To: <20090909160734.GG22885@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Gleb Natapov wrote: > On Wed, Sep 09, 2009 at 05:57:40PM +0200, Jan Kiszka wrote: >> Gleb Natapov wrote: >>> On Wed, Sep 09, 2009 at 05:47:13PM +0200, Jan Kiszka wrote: >>>> Gleb Natapov wrote: >>>>> regs_modified logic doesn't work if io thread calls >>>>> kvm_cpu_synchronize_state() since kvm_arch_get_registers() >>>>> returns only after vcpu thread is back to kernel. Setting >>>>> regs_modified to 1 at this stage causes loading of wrong vcpu >>>>> state on the next vcpu_run(). >>>> We need this upstream too, right? Could you file the corresponding patch? >>>> >>> Upstream is single threaded. It shouldn't suffer from this bug. >> Not if you enable iothread support (though I don't remember if that > It can't work with kvm since all vcpu ioctls are called on the thread > that issues them. Yeah, I just recalled all that on_vcpu fuzz and that upstream is still horribly broken /wrt iothread+kvm. But once that is fixed, we also need this fix here. > >> works now for kvm) + you are also touching shared code here. So qemu-kvm >> would benefit from keeping the diff small. >> > The patch doesn't touch shared code. (it is almost impossible to tell > what code is shared and what's not nowadays) cpu_dump_state() is definitely shared. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux