From patchwork Thu Mar 15 12:14:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 146952 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1B724B6F9F for ; Fri, 16 Mar 2012 00:30:51 +1100 (EST) Received: from localhost ([::1]:47417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S89au-0005OT-7c for incoming@patchwork.ozlabs.org; Thu, 15 Mar 2012 08:15:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S89Zo-0002ux-Gt for qemu-devel@nongnu.org; Thu, 15 Mar 2012 08:14:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S89Ze-0002RO-JY for qemu-devel@nongnu.org; Thu, 15 Mar 2012 08:14:40 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48309 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S89Ze-0002QS-CD; Thu, 15 Mar 2012 08:14:30 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id E2D19920F7; Thu, 15 Mar 2012 13:14:27 +0100 (CET) From: Alexander Graf To: qemu-devel qemu-devel Date: Thu, 15 Mar 2012 13:14:20 +0100 Message-Id: <1331813662-15141-15-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1331813662-15141-1-git-send-email-agraf@suse.de> References: <1331813662-15141-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: blauwirbel@gmail.com, qemu-ppc@nongnu.org, aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 14/16] PPC: KVM: Synchronize regs on CPU dump X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When we dump the CPU registers, there's a certain chance they haven't been synchronized with KVM yet, so we have to manually trigger that. This aligns the code with x86 and fixes a bug where the register state was bogus on invalid/unknown kvm exit reasons. Reported-by: Benjamin Herrenschmidt Signed-off-by: Alexander Graf --- target-ppc/translate.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 4722a09..c9a503a 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -9319,6 +9319,8 @@ void cpu_dump_state (CPUPPCState *env, FILE *f, fprintf_function cpu_fprintf, int i; + cpu_synchronize_state(env); + cpu_fprintf(f, "NIP " TARGET_FMT_lx " LR " TARGET_FMT_lx " CTR " TARGET_FMT_lx " XER " TARGET_FMT_lx "\n", env->nip, env->lr, env->ctr, env->xer);