From patchwork Fri Apr 26 06:14:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 239682 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 368332C00D7 for ; Fri, 26 Apr 2013 16:12:39 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751239Ab3DZGM1 (ORCPT ); Fri, 26 Apr 2013 02:12:27 -0400 Received: from [207.46.163.27] ([207.46.163.27]:40444 "EHLO co9outboundpool.messaging.microsoft.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751096Ab3DZGM0 (ORCPT ); Fri, 26 Apr 2013 02:12:26 -0400 Received: from mail144-co9-R.bigfish.com (10.236.132.228) by CO9EHSOBE017.bigfish.com (10.236.130.80) with Microsoft SMTP Server id 14.1.225.23; Fri, 26 Apr 2013 06:12:06 +0000 Received: from mail144-co9 (localhost [127.0.0.1]) by mail144-co9-R.bigfish.com (Postfix) with ESMTP id 1263A3A010F; Fri, 26 Apr 2013 06:12: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 mail144-co9 (localhost.localdomain [127.0.0.1]) by mail144-co9 (MessageSwitch) id 136695671285470_26883; Fri, 26 Apr 2013 06:11:52 +0000 (UTC) Received: from CO9EHSMHS019.bigfish.com (unknown [10.236.132.246]) by mail144-co9.bigfish.com (Postfix) with ESMTP id 1234680059; Fri, 26 Apr 2013 06:11:52 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO9EHSMHS019.bigfish.com (10.236.130.29) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 26 Apr 2013 06:11:51 +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:11:50 +0000 Received: from freescale.com ([10.232.15.72]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with SMTP id r3Q6BjF7030258; Thu, 25 Apr 2013 23:11:47 -0700 Received: by freescale.com (sSMTP sendmail emulation); Fri, 26 Apr 2013 11:44:10 +0530 From: Bharat Bhushan To: , , , CC: Bharat Bhushan , Bharat Bhushan , Stuart Yoder Subject: [PATCH] ppc: initialize GPRs as per epapr Date: Fri, 26 Apr 2013 11:44:08 +0530 Message-ID: <1366956848-21062-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 Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.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); }