From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd9Nw-0000ed-RM for qemu-devel@nongnu.org; Thu, 04 Feb 2010 16:37:12 -0500 Received: from [199.232.76.173] (port=33989 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd9Nv-0000eV-HL for qemu-devel@nongnu.org; Thu, 04 Feb 2010 16:37:11 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd9Nt-0006f3-6U for qemu-devel@nongnu.org; Thu, 04 Feb 2010 16:37:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47226) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd9Ns-0006et-Mb for qemu-devel@nongnu.org; Thu, 04 Feb 2010 16:37:08 -0500 Date: Thu, 4 Feb 2010 18:50:10 -0200 From: Marcelo Tosatti Message-ID: <20100204205010.GA2766@amt.cnet> References: <372238c800e0d57815f472502fdf78e53463bbb6.1265232579.git.jan.kiszka@siemens.com> <20100203234929.GA11012@amt.cnet> <4B6A15EE.4050501@web.de> <20100204130038.GA15671@amt.cnet> <4B6AE1E6.9040805@siemens.com> <4B6AEAB8.3030509@siemens.com> <20100204180555.GA3861@amt.cnet> <4B6B179A.3080704@siemens.com> <4B6B1E24.2090505@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B6B1E24.2090505@siemens.com> Subject: [Qemu-devel] Re: [PATCH 4/4] KVM: Rework of guest debug state writing List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Anthony Liguori , "qemu-devel@nongnu.org" , "kvm@vger.kernel.org" , Avi Kivity On Thu, Feb 04, 2010 at 08:21:08PM +0100, Jan Kiszka wrote: > Jan Kiszka wrote: > > Marcelo Tosatti wrote: > >> With kvm-autotest the failure is not sporadic (and the above commit > >> applied): with KVM_SET_GUEST_DEBUG in arch_put_regs all migration > >> tests fail, without, all of them succeed. > >> > >> So env->kvm_guest_debug has been zeroed by cpu_x86_init, which means > >> the writeback via KVM_SET_GUEST_DEBUG does almost nothing. It does > >> get_rflags and set_rflags in the kernel. > > > > Hmm, it also copies debug regs around... BTW, where do we save/restore > > dr0..7 between kernel and user space? They're not. > > But that should not be a problem, both shadow as well as effective regs > > should be properly initialized, specifically for a newly created VCPU. Yep. > Could you retry after pushing SET_GUEST_DEBUG at the end of > kvm_arch_put_registers? Maybe it is no good idea to run get/set_rflags > without having the sregs properly initialized. Will do next week. Another tricky thing with this is that the definition of whats the kernel job and whats userspace job is somewhat blurry in points. For example set_regs clears pending exceptions, which made sense in the past, but breaks now if userspace does put_vcpu_events before set_regs (which is not the case with current userspace but just an example). Makes sense to heavily document things as suggested.