Patchwork ppc: initialize GPRs as per epapr

login
register
mail settings
Submitter Bharat Bhushan
Date April 26, 2013, 6:14 a.m.
Message ID <1366956848-21062-1-git-send-email-Bharat.Bhushan@freescale.com>
Download mbox | patch
Permalink /patch/239682/
State New
Headers show

Comments

Bharat Bhushan - April 26, 2013, 6:13 a.m.
This was supposed to go to qemu-devel.

Please Ignore this patch:

Thanks
-Bharat

> -----Original Message-----
> From: Bhushan Bharat-R65777
> Sent: Friday, April 26, 2013 11:44 AM
> To: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; agraf@suse.de; Wood Scott-
> B07421
> Cc: Bhushan Bharat-R65777; Bhushan Bharat-R65777; Yoder Stuart-B08248
> Subject: [PATCH] ppc: initialize GPRs as per epapr
> 
> 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 <bharat.bhushan@freescale.com>
> Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
> ---
>  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);
>  }
> --
> 1.7.0.4


--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bharat Bhushan - April 26, 2013, 6:14 a.m.
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 <bharat.bhushan@freescale.com>
Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
---
 hw/ppc/e500.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Patch

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);
 }