From patchwork Wed Dec 2 22:20:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 40096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B1E96B7B3E for ; Thu, 3 Dec 2009 10:43:33 +1100 (EST) Received: from localhost ([127.0.0.1]:47358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFyr5-00055b-4S for incoming@patchwork.ozlabs.org; Wed, 02 Dec 2009 18:43:31 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFxYq-0007sQ-Ax for qemu-devel@nongnu.org; Wed, 02 Dec 2009 17:20:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFxYl-0007nD-6o for qemu-devel@nongnu.org; Wed, 02 Dec 2009 17:20:35 -0500 Received: from [199.232.76.173] (port=38058 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFxYk-0007mw-Vp for qemu-devel@nongnu.org; Wed, 02 Dec 2009 17:20:31 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59890 helo=mx2.suse.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFxYk-0002pP-MB for qemu-devel@nongnu.org; Wed, 02 Dec 2009 17:20:30 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 2C2578726A; Wed, 2 Dec 2009 23:20:30 +0100 (CET) From: Alexander Graf To: qemu-devel@nongnu.org Date: Wed, 2 Dec 2009 23:20:29 +0100 Message-Id: <1259792429-24293-1-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: Blue Swirl , Avi Kivity , Aurelien Jarno Subject: [Qemu-devel] [PATCH] PPC: Sync CPU state for KVM X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Some recent change made PPC guests always start at address 0x0 because env isn't synced to kvm_state on first bootup. I'm not sure if this is the correct bugfix, but at least it makes PPC boot again with KVM enabled. Signed-off-by: Alexander Graf --- hw/ppc_newworld.c | 4 ++++ hw/ppc_oldworld.c | 4 ++++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c index da868d3..2f2f091 100644 --- a/hw/ppc_newworld.c +++ b/hw/ppc_newworld.c @@ -38,6 +38,7 @@ #include "ide.h" #include "loader.h" #include "elf.h" +#include "kvm.h" #define MAX_IDE_BUS 2 #define VGA_BIOS_SIZE 65536 @@ -134,6 +135,9 @@ static void ppc_core99_init (ram_addr_t ram_size, envs[i] = env; } + /* Make sure all register sets take effect */ + cpu_synchronize_state(env); + /* allocate RAM */ ram_offset = qemu_ram_alloc(ram_size); cpu_register_physical_memory(0, ram_size, ram_offset); diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c index 9b49a3d..4d89805 100644 --- a/hw/ppc_oldworld.c +++ b/hw/ppc_oldworld.c @@ -38,6 +38,7 @@ #include "ide.h" #include "loader.h" #include "elf.h" +#include "kvm.h" #define MAX_IDE_BUS 2 #define VGA_BIOS_SIZE 65536 @@ -162,6 +163,9 @@ static void ppc_heathrow_init (ram_addr_t ram_size, envs[i] = env; } + /* Make sure all register sets take effect */ + cpu_synchronize_state(env); + /* allocate RAM */ if (ram_size > (2047 << 20)) { fprintf(stderr,