From patchwork Fri Apr 26 06:17:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 239683 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 260332C00F1 for ; Fri, 26 Apr 2013 16:15:47 +1000 (EST) Received: from localhost ([::1]:57559 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVbwf-0000Vx-3y for incoming@patchwork.ozlabs.org; Fri, 26 Apr 2013 02:15:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVbwI-0000HR-SZ for qemu-devel@nongnu.org; Fri, 26 Apr 2013 02:15:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVbwD-0001yZ-Ol for qemu-devel@nongnu.org; Fri, 26 Apr 2013 02:15:22 -0400 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12]:36374 helo=tx2outboundpool.messaging.microsoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVbw4-0001vg-5F; Fri, 26 Apr 2013 02:15:08 -0400 Received: from mail217-tx2-R.bigfish.com (10.9.14.236) by TX2EHSOBE011.bigfish.com (10.9.40.31) with Microsoft SMTP Server id 14.1.225.23; Fri, 26 Apr 2013 06:15:07 +0000 Received: from mail217-tx2 (localhost [127.0.0.1]) by mail217-tx2-R.bigfish.com (Postfix) with ESMTP id C2D89480236; Fri, 26 Apr 2013 06:15:06 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VS3(zzzz1f42h1fc6h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1082kzz8275bhz2dh2a8h668h839he5bhf0ah107ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1155h) Received: from mail217-tx2 (localhost.localdomain [127.0.0.1]) by mail217-tx2 (MessageSwitch) id 1366956905904724_12977; Fri, 26 Apr 2013 06:15:05 +0000 (UTC) Received: from TX2EHSMHS014.bigfish.com (unknown [10.9.14.246]) by mail217-tx2.bigfish.com (Postfix) with ESMTP id DA3BB94004A; Fri, 26 Apr 2013 06:15:05 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS014.bigfish.com (10.9.99.114) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 26 Apr 2013 06:15:04 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.328.11; Fri, 26 Apr 2013 06:15:03 +0000 Received: from freescale.com ([10.232.15.72]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with SMTP id r3Q6EwV1032449; Thu, 25 Apr 2013 23:15:00 -0700 Received: by freescale.com (sSMTP sendmail emulation); Fri, 26 Apr 2013 11:47:26 +0530 From: Bharat Bhushan To: , , , Date: Fri, 26 Apr 2013 11:47:25 +0530 Message-ID: <1366957045-21133-1-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 65.55.88.12 Cc: Bharat Bhushan , Stuart Yoder Subject: [Qemu-devel] [PATCH] ppc: initialize GPRs as per epapr 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 ePAPR defines the initial values of cpu registers. This patch initialize the GPRs as per ePAPR specification. This resolves the issue of guest reboot/reset (guest hang on reboot). Signed-off-by: Bharat Bhushan Signed-off-by: Stuart Yoder --- hw/ppc/e500.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index c1bdb6b..a47f976 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -37,6 +37,7 @@ #include "qemu/host-utils.h" #include "hw/pci-host/ppce500.h" +#define EPAPR_MAGIC (0x45504150) #define BINARY_DEVICE_TREE_FILE "mpc8544ds.dtb" #define UIMAGE_LOAD_BASE 0 #define DTC_LOAD_PAD 0x1800000 @@ -444,6 +445,12 @@ static void ppce500_cpu_reset(void *opaque) cs->halted = 0; env->gpr[1] = (16<<20) - 8; env->gpr[3] = bi->dt_base; + env->gpr[4] = 0; + env->gpr[5] = 0; + env->gpr[6] = EPAPR_MAGIC; + env->gpr[7] = (64 * 1024 * 1024); + env->gpr[8] = 0; + env->gpr[9] = 0; env->nip = bi->entry; mmubooke_create_initial_mapping(env); }