From patchwork Wed Aug 15 04:33:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 177542 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 A74E02C0080 for ; Wed, 15 Aug 2012 14:59:01 +1000 (EST) Received: from localhost ([::1]:58903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1VJe-00088w-7v for incoming@patchwork.ozlabs.org; Wed, 15 Aug 2012 00:34:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1VJ3-0006mB-S7 for qemu-devel@nongnu.org; Wed, 15 Aug 2012 00:34:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1VJ0-0008PC-BK for qemu-devel@nongnu.org; Wed, 15 Aug 2012 00:34:09 -0400 Received: from ozlabs.org ([203.10.76.45]:39285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1VJ0-0008Oy-0Q; Wed, 15 Aug 2012 00:34:06 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id C3E612C009F; Wed, 15 Aug 2012 14:34:00 +1000 (EST) From: David Gibson To: agraf@suse.de Date: Wed, 15 Aug 2012 14:33:48 +1000 Message-Id: <1345005228-4380-8-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1345005228-4380-1-git-send-email-david@gibson.dropbear.id.au> References: <1345005228-4380-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 203.10.76.45 Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, paulus@samba.org, David Gibson Subject: [Qemu-devel] [PATCH 7/7] ppc/pseries: Reset VPA registration on CPU reset 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 The ppc specific CPU state contains several variables which track the VPA, SLB shadow and dispatch trace log. These are structures shared between OS and hypervisor that are used on the pseries machine to track various per-CPU quantities. The address of these structures needs to be registered by the guest on each boot, however currently this registration is not cleared when we reset the cpu. This patch corrects this bug. Well, it corrects it for the full emu case anyway. To fix the KVM case, we need some KVM extensions to actually make the KVM internal VPA registration accessible to qemu. Patches coming for qemu once the kernel updates are merged. Signed-off-by: David Gibson --- target-ppc/translate_init.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 6fe4168..2bc4a3f 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -10423,6 +10423,14 @@ static void ppc_cpu_reset(CPUState *s) env->pending_interrupts = 0; env->exception_index = POWERPC_EXCP_NONE; env->error_code = 0; + +#if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY) + env->vpa = 0; + env->slb_shadow = 0; + env->dispatch_trace_log = 0; + env->dtl_size = 0; +#endif /* TARGET_PPC64 */ + /* Flush all TLBs */ tlb_flush(env, 1); }