From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] kvm: sync cpu state on internal error before dump Date: Sat, 24 Aug 2013 13:37:30 +0300 Message-ID: <20130824103729.GF15513@redhat.com> References: <1377260760-32056-1-git-send-email-james.hogan@imgtec.com> <20130823125846.GE15513@redhat.com> <52176679.6020006@imgtec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, Paolo Bonzini , kvm@vger.kernel.org To: James Hogan Return-path: Received: from mx1.redhat.com ([209.132.183.28]:60614 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754092Ab3HXKhe (ORCPT ); Sat, 24 Aug 2013 06:37:34 -0400 Content-Disposition: inline In-Reply-To: <52176679.6020006@imgtec.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Aug 23, 2013 at 02:41:13PM +0100, James Hogan wrote: > On 23/08/13 13:58, Gleb Natapov wrote: > > On Fri, Aug 23, 2013 at 01:26:00PM +0100, James Hogan wrote: > >> When a KVM internal error occurs QEMU dumps the CPU state, however it > >> doesn't synchronise the state from KVM first so the dumped state is out > >> of date. Add the synchronisation calls before the dump in both locations > >> (which is used depends on whether the arch says to stop or not). > >> > > x86_cpu_dump_state() calls cpu_synchronize_state() already. > > Ah yes, thanks. I hadn't noticed that. > > Out of the arches that support KVM only x86 and ppc call it. arm, mips > (qemu support not upstream yet), and s390 don't. s390 never seems to > emit that exit code, and arm only does so for unsupported exceptions > (which should never happen). > > I'll fix in mips_cpu_dump_state() instead. > Moving cpu_synchronize_state() up to cpu_dump_state() would be better. -- Gleb. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46815) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDBDw-0003ab-Rt for qemu-devel@nongnu.org; Sat, 24 Aug 2013 06:37:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDBDq-0006Yn-Sc for qemu-devel@nongnu.org; Sat, 24 Aug 2013 06:37:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDBDq-0006Yb-LJ for qemu-devel@nongnu.org; Sat, 24 Aug 2013 06:37:34 -0400 Date: Sat, 24 Aug 2013 13:37:30 +0300 From: Gleb Natapov Message-ID: <20130824103729.GF15513@redhat.com> References: <1377260760-32056-1-git-send-email-james.hogan@imgtec.com> <20130823125846.GE15513@redhat.com> <52176679.6020006@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52176679.6020006@imgtec.com> Subject: Re: [Qemu-devel] [PATCH] kvm: sync cpu state on internal error before dump List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: James Hogan Cc: Paolo Bonzini , qemu-devel@nongnu.org, kvm@vger.kernel.org On Fri, Aug 23, 2013 at 02:41:13PM +0100, James Hogan wrote: > On 23/08/13 13:58, Gleb Natapov wrote: > > On Fri, Aug 23, 2013 at 01:26:00PM +0100, James Hogan wrote: > >> When a KVM internal error occurs QEMU dumps the CPU state, however it > >> doesn't synchronise the state from KVM first so the dumped state is out > >> of date. Add the synchronisation calls before the dump in both locations > >> (which is used depends on whether the arch says to stop or not). > >> > > x86_cpu_dump_state() calls cpu_synchronize_state() already. > > Ah yes, thanks. I hadn't noticed that. > > Out of the arches that support KVM only x86 and ppc call it. arm, mips > (qemu support not upstream yet), and s390 don't. s390 never seems to > emit that exit code, and arm only does so for unsupported exceptions > (which should never happen). > > I'll fix in mips_cpu_dump_state() instead. > Moving cpu_synchronize_state() up to cpu_dump_state() would be better. -- Gleb.