All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
@ 2008-12-11 12:52 ` Christian Ehrhardt
  0 siblings, 0 replies; 14+ messages in thread
From: Christian Ehrhardt @ 2008-12-11 12:52 UTC (permalink / raw)
  To: avi; +Cc: ehrhardt, kvm-ppc, kvm, hollisb

# HG changeset patch
# User Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
# Date 1228999833 -3600
# Node ID dc1466c9077ab162f4637fffee1869f26be02299
# Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
[PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub

From: Hollis Blanchard <hollisb@us.ibm.com>

Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
mmu implementation that uses the kvm_translate ioctl.
This also requires to save the kvm registers prior to the 'm' gdb operations.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---

[diffstat]
 gdbstub.c                   |    2 ++
 hw/ppc440_bamboo.c          |    1 +
 qemu-kvm-powerpc.c          |   28 ++++++++++++++++++++++++++++
 target-ppc/cpu.h            |    2 ++
 target-ppc/helper.c         |    4 ++++
 target-ppc/translate_init.c |    5 +++++
 6 files changed, 42 insertions(+)

[diff]

diff --git a/qemu/gdbstub.c b/qemu/gdbstub.c
--- a/qemu/gdbstub.c
+++ b/qemu/gdbstub.c
@@ -1374,6 +1374,7 @@ static int gdb_handle_packet(GDBState *s
         if (*p == ',')
             p++;
         len = strtoull(p, NULL, 16);
+        kvm_save_registers(s->g_cpu);
         if (cpu_memory_rw_debug(s->g_cpu, addr, mem_buf, len, 0) != 0) {
             put_packet (s, "E14");
         } else {
@@ -1389,6 +1390,7 @@ static int gdb_handle_packet(GDBState *s
         if (*p == ':')
             p++;
         hextomem(mem_buf, p, len);
+        kvm_save_registers(s->g_cpu);
         if (cpu_memory_rw_debug(s->g_cpu, addr, mem_buf, len, 1) != 0)
             put_packet(s, "E14");
         else
diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c
--- a/qemu/hw/ppc440_bamboo.c
+++ b/qemu/hw/ppc440_bamboo.c
@@ -99,6 +99,7 @@ void bamboo_init(ram_addr_t ram_size, in
 		fprintf(stderr, "Unable to initialize CPU!\n");
 		exit(1);
 	}
+	env->mmu_model = POWERPC_MMU_KVM;
 
 	/* call init */
 	printf("Calling function ppc440_init\n");
diff --git a/qemu/qemu-kvm-powerpc.c b/qemu/qemu-kvm-powerpc.c
--- a/qemu/qemu-kvm-powerpc.c
+++ b/qemu/qemu-kvm-powerpc.c
@@ -102,6 +102,7 @@ void kvm_arch_save_regs(CPUState *env)
 
     env->spr[SPR_SRR0] = regs.srr0;
     env->spr[SPR_SRR1] = regs.srr1;
+    env->spr[SPR_BOOKE_PID] = regs.pid;
 
     env->spr[SPR_SPRG0] = regs.sprg0;
     env->spr[SPR_SPRG1] = regs.sprg1;
@@ -219,6 +220,33 @@ int handle_powerpc_dcr_write(int vcpu, u
     return 0; /* XXX ignore failed DCR ops */
 }
 
+int mmukvm_get_physical_address(CPUState *env, mmu_ctx_t *ctx,
+                                target_ulong eaddr, int rw, int access_type)
+{
+    struct kvm_translation tr;
+    uint64_t pid;
+    uint64_t as;
+    int r;
+
+    pid = env->spr[SPR_BOOKE_PID];
+
+    if (access_type == ACCESS_CODE)
+        as = env->msr & msr_ir;
+    else
+        as = env->msr & msr_dr;
+
+    tr.linear_address = as << 40 | pid << 32 | eaddr;
+    r = kvm_translate(kvm_context, env->cpu_index, &tr);
+    if (r == -1)
+        return r;
+
+    if (!tr.valid)
+        return -EFAULT;
+
+    ctx->raddr = tr.physical_address;
+    return 0;
+}
+
 void kvm_arch_cpu_reset(CPUState *env)
 {
 }
diff --git a/qemu/target-ppc/cpu.h b/qemu/target-ppc/cpu.h
--- a/qemu/target-ppc/cpu.h
+++ b/qemu/target-ppc/cpu.h
@@ -98,6 +98,8 @@ enum powerpc_mmu_t {
     POWERPC_MMU_BOOKE_FSL  = 0x00000009,
     /* PowerPC 601 MMU model (specific BATs format)            */
     POWERPC_MMU_601        = 0x0000000A,
+    /* KVM managing the MMU state                              */
+    POWERPC_MMU_KVM        = 0x0000000B,
 #if defined(TARGET_PPC64)
 #define POWERPC_MMU_64       0x00010000
     /* 64 bits PowerPC MMU                                     */
diff --git a/qemu/target-ppc/helper.c b/qemu/target-ppc/helper.c
--- a/qemu/target-ppc/helper.c
+++ b/qemu/target-ppc/helper.c
@@ -1429,6 +1429,10 @@ int get_physical_address (CPUState *env,
         fprintf(logfile, "%s\n", __func__);
     }
 #endif
+
+    if (env->mmu_model == POWERPC_MMU_KVM)
+        return mmukvm_get_physical_address(env, ctx, eaddr, rw, access_type);
+
     if ((access_type == ACCESS_CODE && msr_ir == 0) ||
         (access_type != ACCESS_CODE && msr_dr == 0)) {
         /* No address translation */
diff --git a/qemu/target-ppc/translate_init.c b/qemu/target-ppc/translate_init.c
--- a/qemu/target-ppc/translate_init.c
+++ b/qemu/target-ppc/translate_init.c
@@ -9273,6 +9273,11 @@ int cpu_ppc_register_internal (CPUPPCSta
         case POWERPC_MMU_601:
             mmu_model = "PowerPC 601";
             break;
+#ifdef KVM
+        case POWERPC_MMU_KVM:
+            mmu_model = "PowerPC KVM";
+            break;
+#endif
 #if defined (TARGET_PPC64)
         case POWERPC_MMU_64B:
             mmu_model = "PowerPC 64";

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for
@ 2008-12-11 12:52 ` Christian Ehrhardt
  0 siblings, 0 replies; 14+ messages in thread
From: Christian Ehrhardt @ 2008-12-11 12:52 UTC (permalink / raw)
  To: avi; +Cc: ehrhardt, kvm-ppc, kvm, hollisb

# HG changeset patch
# User Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
# Date 1228999833 -3600
# Node ID dc1466c9077ab162f4637fffee1869f26be02299
# Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
[PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub

From: Hollis Blanchard <hollisb@us.ibm.com>

Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
mmu implementation that uses the kvm_translate ioctl.
This also requires to save the kvm registers prior to the 'm' gdb operations.

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---

[diffstat]
 gdbstub.c                   |    2 ++
 hw/ppc440_bamboo.c          |    1 +
 qemu-kvm-powerpc.c          |   28 ++++++++++++++++++++++++++++
 target-ppc/cpu.h            |    2 ++
 target-ppc/helper.c         |    4 ++++
 target-ppc/translate_init.c |    5 +++++
 6 files changed, 42 insertions(+)

[diff]

diff --git a/qemu/gdbstub.c b/qemu/gdbstub.c
--- a/qemu/gdbstub.c
+++ b/qemu/gdbstub.c
@@ -1374,6 +1374,7 @@ static int gdb_handle_packet(GDBState *s
         if (*p = ',')
             p++;
         len = strtoull(p, NULL, 16);
+        kvm_save_registers(s->g_cpu);
         if (cpu_memory_rw_debug(s->g_cpu, addr, mem_buf, len, 0) != 0) {
             put_packet (s, "E14");
         } else {
@@ -1389,6 +1390,7 @@ static int gdb_handle_packet(GDBState *s
         if (*p = ':')
             p++;
         hextomem(mem_buf, p, len);
+        kvm_save_registers(s->g_cpu);
         if (cpu_memory_rw_debug(s->g_cpu, addr, mem_buf, len, 1) != 0)
             put_packet(s, "E14");
         else
diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c
--- a/qemu/hw/ppc440_bamboo.c
+++ b/qemu/hw/ppc440_bamboo.c
@@ -99,6 +99,7 @@ void bamboo_init(ram_addr_t ram_size, in
 		fprintf(stderr, "Unable to initialize CPU!\n");
 		exit(1);
 	}
+	env->mmu_model = POWERPC_MMU_KVM;
 
 	/* call init */
 	printf("Calling function ppc440_init\n");
diff --git a/qemu/qemu-kvm-powerpc.c b/qemu/qemu-kvm-powerpc.c
--- a/qemu/qemu-kvm-powerpc.c
+++ b/qemu/qemu-kvm-powerpc.c
@@ -102,6 +102,7 @@ void kvm_arch_save_regs(CPUState *env)
 
     env->spr[SPR_SRR0] = regs.srr0;
     env->spr[SPR_SRR1] = regs.srr1;
+    env->spr[SPR_BOOKE_PID] = regs.pid;
 
     env->spr[SPR_SPRG0] = regs.sprg0;
     env->spr[SPR_SPRG1] = regs.sprg1;
@@ -219,6 +220,33 @@ int handle_powerpc_dcr_write(int vcpu, u
     return 0; /* XXX ignore failed DCR ops */
 }
 
+int mmukvm_get_physical_address(CPUState *env, mmu_ctx_t *ctx,
+                                target_ulong eaddr, int rw, int access_type)
+{
+    struct kvm_translation tr;
+    uint64_t pid;
+    uint64_t as;
+    int r;
+
+    pid = env->spr[SPR_BOOKE_PID];
+
+    if (access_type = ACCESS_CODE)
+        as = env->msr & msr_ir;
+    else
+        as = env->msr & msr_dr;
+
+    tr.linear_address = as << 40 | pid << 32 | eaddr;
+    r = kvm_translate(kvm_context, env->cpu_index, &tr);
+    if (r = -1)
+        return r;
+
+    if (!tr.valid)
+        return -EFAULT;
+
+    ctx->raddr = tr.physical_address;
+    return 0;
+}
+
 void kvm_arch_cpu_reset(CPUState *env)
 {
 }
diff --git a/qemu/target-ppc/cpu.h b/qemu/target-ppc/cpu.h
--- a/qemu/target-ppc/cpu.h
+++ b/qemu/target-ppc/cpu.h
@@ -98,6 +98,8 @@ enum powerpc_mmu_t {
     POWERPC_MMU_BOOKE_FSL  = 0x00000009,
     /* PowerPC 601 MMU model (specific BATs format)            */
     POWERPC_MMU_601        = 0x0000000A,
+    /* KVM managing the MMU state                              */
+    POWERPC_MMU_KVM        = 0x0000000B,
 #if defined(TARGET_PPC64)
 #define POWERPC_MMU_64       0x00010000
     /* 64 bits PowerPC MMU                                     */
diff --git a/qemu/target-ppc/helper.c b/qemu/target-ppc/helper.c
--- a/qemu/target-ppc/helper.c
+++ b/qemu/target-ppc/helper.c
@@ -1429,6 +1429,10 @@ int get_physical_address (CPUState *env,
         fprintf(logfile, "%s\n", __func__);
     }
 #endif
+
+    if (env->mmu_model = POWERPC_MMU_KVM)
+        return mmukvm_get_physical_address(env, ctx, eaddr, rw, access_type);
+
     if ((access_type = ACCESS_CODE && msr_ir = 0) ||
         (access_type != ACCESS_CODE && msr_dr = 0)) {
         /* No address translation */
diff --git a/qemu/target-ppc/translate_init.c b/qemu/target-ppc/translate_init.c
--- a/qemu/target-ppc/translate_init.c
+++ b/qemu/target-ppc/translate_init.c
@@ -9273,6 +9273,11 @@ int cpu_ppc_register_internal (CPUPPCSta
         case POWERPC_MMU_601:
             mmu_model = "PowerPC 601";
             break;
+#ifdef KVM
+        case POWERPC_MMU_KVM:
+            mmu_model = "PowerPC KVM";
+            break;
+#endif
 #if defined (TARGET_PPC64)
         case POWERPC_MMU_64B:
             mmu_model = "PowerPC 64";

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
  2008-12-11 12:52 ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for Christian Ehrhardt
@ 2008-12-11 12:53   ` Christian Ehrhardt
  -1 siblings, 0 replies; 14+ messages in thread
From: Christian Ehrhardt @ 2008-12-11 12:53 UTC (permalink / raw)
  To: avi-H+wXaHxf7aLQT0dZR+AlfA
  Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
	hollisb-r/Jw6+rmf7HQT0dZR+AlfA

This is v2 as version one had a type in it occured when splitting patches.
Mercurial somehow lost my changes to the patch description explaining 
that, but the patch is right this way.

Christian Ehrhardt wrote:
> # HG changeset patch
> # User Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> # Date 1228999833 -3600
> # Node ID dc1466c9077ab162f4637fffee1869f26be02299
> # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
> [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
>
> From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>
> Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
> mmu implementation that uses the kvm_translate ioctl.
> This also requires to save the kvm registers prior to the 'm' gdb operations.
>
> Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> ---
>
> [diffstat]
>  gdbstub.c                   |    2 ++
>  hw/ppc440_bamboo.c          |    1 +
>  qemu-kvm-powerpc.c          |   28 ++++++++++++++++++++++++++++
>  target-ppc/cpu.h            |    2 ++
>  target-ppc/helper.c         |    4 ++++
>  target-ppc/translate_init.c |    5 +++++
>  6 files changed, 42 insertions(+)
>
> [diff]
>
> diff --git a/qemu/gdbstub.c b/qemu/gdbstub.c
> --- a/qemu/gdbstub.c
> +++ b/qemu/gdbstub.c
> @@ -1374,6 +1374,7 @@ static int gdb_handle_packet(GDBState *s
>          if (*p == ',')
>              p++;
>          len = strtoull(p, NULL, 16);
> +        kvm_save_registers(s->g_cpu);
>          if (cpu_memory_rw_debug(s->g_cpu, addr, mem_buf, len, 0) != 0) {
>              put_packet (s, "E14");
>          } else {
> @@ -1389,6 +1390,7 @@ static int gdb_handle_packet(GDBState *s
>          if (*p == ':')
>              p++;
>          hextomem(mem_buf, p, len);
> +        kvm_save_registers(s->g_cpu);
>          if (cpu_memory_rw_debug(s->g_cpu, addr, mem_buf, len, 1) != 0)
>              put_packet(s, "E14");
>          else
> diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c
> --- a/qemu/hw/ppc440_bamboo.c
> +++ b/qemu/hw/ppc440_bamboo.c
> @@ -99,6 +99,7 @@ void bamboo_init(ram_addr_t ram_size, in
>  		fprintf(stderr, "Unable to initialize CPU!\n");
>  		exit(1);
>  	}
> +	env->mmu_model = POWERPC_MMU_KVM;
>
>  	/* call init */
>  	printf("Calling function ppc440_init\n");
> diff --git a/qemu/qemu-kvm-powerpc.c b/qemu/qemu-kvm-powerpc.c
> --- a/qemu/qemu-kvm-powerpc.c
> +++ b/qemu/qemu-kvm-powerpc.c
> @@ -102,6 +102,7 @@ void kvm_arch_save_regs(CPUState *env)
>
>      env->spr[SPR_SRR0] = regs.srr0;
>      env->spr[SPR_SRR1] = regs.srr1;
> +    env->spr[SPR_BOOKE_PID] = regs.pid;
>
>      env->spr[SPR_SPRG0] = regs.sprg0;
>      env->spr[SPR_SPRG1] = regs.sprg1;
> @@ -219,6 +220,33 @@ int handle_powerpc_dcr_write(int vcpu, u
>      return 0; /* XXX ignore failed DCR ops */
>  }
>
> +int mmukvm_get_physical_address(CPUState *env, mmu_ctx_t *ctx,
> +                                target_ulong eaddr, int rw, int access_type)
> +{
> +    struct kvm_translation tr;
> +    uint64_t pid;
> +    uint64_t as;
> +    int r;
> +
> +    pid = env->spr[SPR_BOOKE_PID];
> +
> +    if (access_type == ACCESS_CODE)
> +        as = env->msr & msr_ir;
> +    else
> +        as = env->msr & msr_dr;
> +
> +    tr.linear_address = as << 40 | pid << 32 | eaddr;
> +    r = kvm_translate(kvm_context, env->cpu_index, &tr);
> +    if (r == -1)
> +        return r;
> +
> +    if (!tr.valid)
> +        return -EFAULT;
> +
> +    ctx->raddr = tr.physical_address;
> +    return 0;
> +}
> +
>  void kvm_arch_cpu_reset(CPUState *env)
>  {
>  }
> diff --git a/qemu/target-ppc/cpu.h b/qemu/target-ppc/cpu.h
> --- a/qemu/target-ppc/cpu.h
> +++ b/qemu/target-ppc/cpu.h
> @@ -98,6 +98,8 @@ enum powerpc_mmu_t {
>      POWERPC_MMU_BOOKE_FSL  = 0x00000009,
>      /* PowerPC 601 MMU model (specific BATs format)            */
>      POWERPC_MMU_601        = 0x0000000A,
> +    /* KVM managing the MMU state                              */
> +    POWERPC_MMU_KVM        = 0x0000000B,
>  #if defined(TARGET_PPC64)
>  #define POWERPC_MMU_64       0x00010000
>      /* 64 bits PowerPC MMU                                     */
> diff --git a/qemu/target-ppc/helper.c b/qemu/target-ppc/helper.c
> --- a/qemu/target-ppc/helper.c
> +++ b/qemu/target-ppc/helper.c
> @@ -1429,6 +1429,10 @@ int get_physical_address (CPUState *env,
>          fprintf(logfile, "%s\n", __func__);
>      }
>  #endif
> +
> +    if (env->mmu_model == POWERPC_MMU_KVM)
> +        return mmukvm_get_physical_address(env, ctx, eaddr, rw, access_type);
> +
>      if ((access_type == ACCESS_CODE && msr_ir == 0) ||
>          (access_type != ACCESS_CODE && msr_dr == 0)) {
>          /* No address translation */
> diff --git a/qemu/target-ppc/translate_init.c b/qemu/target-ppc/translate_init.c
> --- a/qemu/target-ppc/translate_init.c
> +++ b/qemu/target-ppc/translate_init.c
> @@ -9273,6 +9273,11 @@ int cpu_ppc_register_internal (CPUPPCSta
>          case POWERPC_MMU_601:
>              mmu_model = "PowerPC 601";
>              break;
> +#ifdef KVM
> +        case POWERPC_MMU_KVM:
> +            mmu_model = "PowerPC KVM";
> +            break;
> +#endif
>  #if defined (TARGET_PPC64)
>          case POWERPC_MMU_64B:
>              mmu_model = "PowerPC 64";
>   


-- 

Grüsse / regards, 
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support
@ 2008-12-11 12:53   ` Christian Ehrhardt
  0 siblings, 0 replies; 14+ messages in thread
From: Christian Ehrhardt @ 2008-12-11 12:53 UTC (permalink / raw)
  To: avi-H+wXaHxf7aLQT0dZR+AlfA
  Cc: kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
	hollisb-r/Jw6+rmf7HQT0dZR+AlfA

This is v2 as version one had a type in it occured when splitting patches.
Mercurial somehow lost my changes to the patch description explaining 
that, but the patch is right this way.

Christian Ehrhardt wrote:
> # HG changeset patch
> # User Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
> # Date 1228999833 -3600
> # Node ID dc1466c9077ab162f4637fffee1869f26be02299
> # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
> [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
>
> From: Hollis Blanchard <hollisb@us.ibm.com>
>
> Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
> mmu implementation that uses the kvm_translate ioctl.
> This also requires to save the kvm registers prior to the 'm' gdb operations.
>
> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
> Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
> ---
>
> [diffstat]
>  gdbstub.c                   |    2 ++
>  hw/ppc440_bamboo.c          |    1 +
>  qemu-kvm-powerpc.c          |   28 ++++++++++++++++++++++++++++
>  target-ppc/cpu.h            |    2 ++
>  target-ppc/helper.c         |    4 ++++
>  target-ppc/translate_init.c |    5 +++++
>  6 files changed, 42 insertions(+)
>
> [diff]
>
> diff --git a/qemu/gdbstub.c b/qemu/gdbstub.c
> --- a/qemu/gdbstub.c
> +++ b/qemu/gdbstub.c
> @@ -1374,6 +1374,7 @@ static int gdb_handle_packet(GDBState *s
>          if (*p = ',')
>              p++;
>          len = strtoull(p, NULL, 16);
> +        kvm_save_registers(s->g_cpu);
>          if (cpu_memory_rw_debug(s->g_cpu, addr, mem_buf, len, 0) != 0) {
>              put_packet (s, "E14");
>          } else {
> @@ -1389,6 +1390,7 @@ static int gdb_handle_packet(GDBState *s
>          if (*p = ':')
>              p++;
>          hextomem(mem_buf, p, len);
> +        kvm_save_registers(s->g_cpu);
>          if (cpu_memory_rw_debug(s->g_cpu, addr, mem_buf, len, 1) != 0)
>              put_packet(s, "E14");
>          else
> diff --git a/qemu/hw/ppc440_bamboo.c b/qemu/hw/ppc440_bamboo.c
> --- a/qemu/hw/ppc440_bamboo.c
> +++ b/qemu/hw/ppc440_bamboo.c
> @@ -99,6 +99,7 @@ void bamboo_init(ram_addr_t ram_size, in
>  		fprintf(stderr, "Unable to initialize CPU!\n");
>  		exit(1);
>  	}
> +	env->mmu_model = POWERPC_MMU_KVM;
>
>  	/* call init */
>  	printf("Calling function ppc440_init\n");
> diff --git a/qemu/qemu-kvm-powerpc.c b/qemu/qemu-kvm-powerpc.c
> --- a/qemu/qemu-kvm-powerpc.c
> +++ b/qemu/qemu-kvm-powerpc.c
> @@ -102,6 +102,7 @@ void kvm_arch_save_regs(CPUState *env)
>
>      env->spr[SPR_SRR0] = regs.srr0;
>      env->spr[SPR_SRR1] = regs.srr1;
> +    env->spr[SPR_BOOKE_PID] = regs.pid;
>
>      env->spr[SPR_SPRG0] = regs.sprg0;
>      env->spr[SPR_SPRG1] = regs.sprg1;
> @@ -219,6 +220,33 @@ int handle_powerpc_dcr_write(int vcpu, u
>      return 0; /* XXX ignore failed DCR ops */
>  }
>
> +int mmukvm_get_physical_address(CPUState *env, mmu_ctx_t *ctx,
> +                                target_ulong eaddr, int rw, int access_type)
> +{
> +    struct kvm_translation tr;
> +    uint64_t pid;
> +    uint64_t as;
> +    int r;
> +
> +    pid = env->spr[SPR_BOOKE_PID];
> +
> +    if (access_type = ACCESS_CODE)
> +        as = env->msr & msr_ir;
> +    else
> +        as = env->msr & msr_dr;
> +
> +    tr.linear_address = as << 40 | pid << 32 | eaddr;
> +    r = kvm_translate(kvm_context, env->cpu_index, &tr);
> +    if (r = -1)
> +        return r;
> +
> +    if (!tr.valid)
> +        return -EFAULT;
> +
> +    ctx->raddr = tr.physical_address;
> +    return 0;
> +}
> +
>  void kvm_arch_cpu_reset(CPUState *env)
>  {
>  }
> diff --git a/qemu/target-ppc/cpu.h b/qemu/target-ppc/cpu.h
> --- a/qemu/target-ppc/cpu.h
> +++ b/qemu/target-ppc/cpu.h
> @@ -98,6 +98,8 @@ enum powerpc_mmu_t {
>      POWERPC_MMU_BOOKE_FSL  = 0x00000009,
>      /* PowerPC 601 MMU model (specific BATs format)            */
>      POWERPC_MMU_601        = 0x0000000A,
> +    /* KVM managing the MMU state                              */
> +    POWERPC_MMU_KVM        = 0x0000000B,
>  #if defined(TARGET_PPC64)
>  #define POWERPC_MMU_64       0x00010000
>      /* 64 bits PowerPC MMU                                     */
> diff --git a/qemu/target-ppc/helper.c b/qemu/target-ppc/helper.c
> --- a/qemu/target-ppc/helper.c
> +++ b/qemu/target-ppc/helper.c
> @@ -1429,6 +1429,10 @@ int get_physical_address (CPUState *env,
>          fprintf(logfile, "%s\n", __func__);
>      }
>  #endif
> +
> +    if (env->mmu_model = POWERPC_MMU_KVM)
> +        return mmukvm_get_physical_address(env, ctx, eaddr, rw, access_type);
> +
>      if ((access_type = ACCESS_CODE && msr_ir = 0) ||
>          (access_type != ACCESS_CODE && msr_dr = 0)) {
>          /* No address translation */
> diff --git a/qemu/target-ppc/translate_init.c b/qemu/target-ppc/translate_init.c
> --- a/qemu/target-ppc/translate_init.c
> +++ b/qemu/target-ppc/translate_init.c
> @@ -9273,6 +9273,11 @@ int cpu_ppc_register_internal (CPUPPCSta
>          case POWERPC_MMU_601:
>              mmu_model = "PowerPC 601";
>              break;
> +#ifdef KVM
> +        case POWERPC_MMU_KVM:
> +            mmu_model = "PowerPC KVM";
> +            break;
> +#endif
>  #if defined (TARGET_PPC64)
>          case POWERPC_MMU_64B:
>              mmu_model = "PowerPC 64";
>   


-- 

Grüsse / regards, 
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
       [not found]   ` <49410D61.9090309-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
@ 2008-12-11 15:53       ` Hollis Blanchard
  0 siblings, 0 replies; 14+ messages in thread
From: Hollis Blanchard @ 2008-12-11 15:53 UTC (permalink / raw)
  To: Christian Ehrhardt
  Cc: avi-H+wXaHxf7aLQT0dZR+AlfA, kvm-ppc-u79uwXL29TY76Z2rM5mHXA,
	kvm-u79uwXL29TY76Z2rM5mHXA

On Thu, 2008-12-11 at 13:53 +0100, Christian Ehrhardt wrote:
> This is v2 as version one had a type in it occured when splitting patches.
> Mercurial somehow lost my changes to the patch description explaining 
> that, but the patch is right this way.
> 
> Christian Ehrhardt wrote:
> > # HG changeset patch
> > # User Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> > # Date 1228999833 -3600
> > # Node ID dc1466c9077ab162f4637fffee1869f26be02299
> > # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
> > [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
> >
> > From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> >
> > Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
> > mmu implementation that uses the kvm_translate ioctl.
> > This also requires to save the kvm registers prior to the 'm' gdb operations.
> >
> > Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> > Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>

Let's *not* apply this to kvm-userspace. We will submit this to qemu,
and once we work out the right solution there it will be merged
naturally.

-- 
Hollis Blanchard
IBM Linux Technology Center

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support
@ 2008-12-11 15:53       ` Hollis Blanchard
  0 siblings, 0 replies; 14+ messages in thread
From: Hollis Blanchard @ 2008-12-11 15:53 UTC (permalink / raw)
  To: Christian Ehrhardt
  Cc: avi-H+wXaHxf7aLQT0dZR+AlfA, kvm-ppc-u79uwXL29TY76Z2rM5mHXA,
	kvm-u79uwXL29TY76Z2rM5mHXA

On Thu, 2008-12-11 at 13:53 +0100, Christian Ehrhardt wrote:
> This is v2 as version one had a type in it occured when splitting patches.
> Mercurial somehow lost my changes to the patch description explaining 
> that, but the patch is right this way.
> 
> Christian Ehrhardt wrote:
> > # HG changeset patch
> > # User Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
> > # Date 1228999833 -3600
> > # Node ID dc1466c9077ab162f4637fffee1869f26be02299
> > # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
> > [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
> >
> > From: Hollis Blanchard <hollisb@us.ibm.com>
> >
> > Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
> > mmu implementation that uses the kvm_translate ioctl.
> > This also requires to save the kvm registers prior to the 'm' gdb operations.
> >
> > Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
> > Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>

Let's *not* apply this to kvm-userspace. We will submit this to qemu,
and once we work out the right solution there it will be merged
naturally.

-- 
Hollis Blanchard
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
  2008-12-11 15:53       ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support Hollis Blanchard
@ 2008-12-11 16:05         ` Jan Kiszka
  -1 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2008-12-11 16:05 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: Christian Ehrhardt, Avi Kivity, kvm-ppc, kvm-devel

Hollis Blanchard wrote:
> On Thu, 2008-12-11 at 13:53 +0100, Christian Ehrhardt wrote:
>> This is v2 as version one had a type in it occured when splitting patches.
>> Mercurial somehow lost my changes to the patch description explaining 
>> that, but the patch is right this way.
>>
>> Christian Ehrhardt wrote:
>>> # HG changeset patch
>>> # User Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>>> # Date 1228999833 -3600
>>> # Node ID dc1466c9077ab162f4637fffee1869f26be02299
>>> # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
>>> [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
>>>
>>> From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>>>
>>> Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
>>> mmu implementation that uses the kvm_translate ioctl.
>>> This also requires to save the kvm registers prior to the 'm' gdb operations.
>>>
>>> Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>>> Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> 
> Let's *not* apply this to kvm-userspace. We will submit this to qemu,
> and once we work out the right solution there it will be merged
> naturally.
> 

I don't oversee yet what you want to push upstream, but in case it's the
gdbstub support for kvm (including ppc bits): please note that I plan to
push the new interface once it is merged into kvm-userspace, avoiding to
spread the current, limited one as far as possible.

BTW, would be great if you could have a look / provide patches for ppc
to support the new interface already. I am open for feedback,
specifically regarding its suitability beyond x86.

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT SE 26
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support
@ 2008-12-11 16:05         ` Jan Kiszka
  0 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2008-12-11 16:05 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: Christian Ehrhardt, Avi Kivity, kvm-ppc, kvm-devel

Hollis Blanchard wrote:
> On Thu, 2008-12-11 at 13:53 +0100, Christian Ehrhardt wrote:
>> This is v2 as version one had a type in it occured when splitting patches.
>> Mercurial somehow lost my changes to the patch description explaining 
>> that, but the patch is right this way.
>>
>> Christian Ehrhardt wrote:
>>> # HG changeset patch
>>> # User Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>>> # Date 1228999833 -3600
>>> # Node ID dc1466c9077ab162f4637fffee1869f26be02299
>>> # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
>>> [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
>>>
>>> From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>>>
>>> Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
>>> mmu implementation that uses the kvm_translate ioctl.
>>> This also requires to save the kvm registers prior to the 'm' gdb operations.
>>>
>>> Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>>> Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> 
> Let's *not* apply this to kvm-userspace. We will submit this to qemu,
> and once we work out the right solution there it will be merged
> naturally.
> 

I don't oversee yet what you want to push upstream, but in case it's the
gdbstub support for kvm (including ppc bits): please note that I plan to
push the new interface once it is merged into kvm-userspace, avoiding to
spread the current, limited one as far as possible.

BTW, would be great if you could have a look / provide patches for ppc
to support the new interface already. I am open for feedback,
specifically regarding its suitability beyond x86.

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT SE 26
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
  2008-12-11 16:05         ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support Jan Kiszka
@ 2008-12-11 18:31           ` Hollis Blanchard
  -1 siblings, 0 replies; 14+ messages in thread
From: Hollis Blanchard @ 2008-12-11 18:31 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Christian Ehrhardt, Avi Kivity, kvm-ppc, kvm-devel

On Thu, 2008-12-11 at 17:05 +0100, Jan Kiszka wrote:
> Hollis Blanchard wrote:
> > On Thu, 2008-12-11 at 13:53 +0100, Christian Ehrhardt wrote:
> >> This is v2 as version one had a type in it occured when splitting patches.
> >> Mercurial somehow lost my changes to the patch description explaining 
> >> that, but the patch is right this way.
> >>
> >> Christian Ehrhardt wrote:
> >>> # HG changeset patch
> >>> # User Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> >>> # Date 1228999833 -3600
> >>> # Node ID dc1466c9077ab162f4637fffee1869f26be02299
> >>> # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
> >>> [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
> >>>
> >>> From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> >>>
> >>> Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
> >>> mmu implementation that uses the kvm_translate ioctl.
> >>> This also requires to save the kvm registers prior to the 'm' gdb operations.
> >>>
> >>> Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> >>> Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> > 
> > Let's *not* apply this to kvm-userspace. We will submit this to qemu,
> > and once we work out the right solution there it will be merged
> > naturally.
> > 
> 
> I don't oversee yet what you want to push upstream, but in case it's the
> gdbstub support for kvm (including ppc bits): please note that I plan to
> push the new interface once it is merged into kvm-userspace, avoiding to
> spread the current, limited one as far as possible.
> 
> BTW, would be great if you could have a look / provide patches for ppc
> to support the new interface already. I am open for feedback,
> specifically regarding its suitability beyond x86.

I've been meaning to do this for a while, sorry. We'll take a look soon.

-- 
Hollis Blanchard
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support
@ 2008-12-11 18:31           ` Hollis Blanchard
  0 siblings, 0 replies; 14+ messages in thread
From: Hollis Blanchard @ 2008-12-11 18:31 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Christian Ehrhardt, Avi Kivity, kvm-ppc, kvm-devel

On Thu, 2008-12-11 at 17:05 +0100, Jan Kiszka wrote:
> Hollis Blanchard wrote:
> > On Thu, 2008-12-11 at 13:53 +0100, Christian Ehrhardt wrote:
> >> This is v2 as version one had a type in it occured when splitting patches.
> >> Mercurial somehow lost my changes to the patch description explaining 
> >> that, but the patch is right this way.
> >>
> >> Christian Ehrhardt wrote:
> >>> # HG changeset patch
> >>> # User Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> >>> # Date 1228999833 -3600
> >>> # Node ID dc1466c9077ab162f4637fffee1869f26be02299
> >>> # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
> >>> [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
> >>>
> >>> From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> >>>
> >>> Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
> >>> mmu implementation that uses the kvm_translate ioctl.
> >>> This also requires to save the kvm registers prior to the 'm' gdb operations.
> >>>
> >>> Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> >>> Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> > 
> > Let's *not* apply this to kvm-userspace. We will submit this to qemu,
> > and once we work out the right solution there it will be merged
> > naturally.
> > 
> 
> I don't oversee yet what you want to push upstream, but in case it's the
> gdbstub support for kvm (including ppc bits): please note that I plan to
> push the new interface once it is merged into kvm-userspace, avoiding to
> spread the current, limited one as far as possible.
> 
> BTW, would be great if you could have a look / provide patches for ppc
> to support the new interface already. I am open for feedback,
> specifically regarding its suitability beyond x86.

I've been meaning to do this for a while, sorry. We'll take a look soon.

-- 
Hollis Blanchard
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
       [not found]           ` <1229020274.26586.24.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
@ 2008-12-12 12:42               ` Christian Ehrhardt
  0 siblings, 0 replies; 14+ messages in thread
From: Christian Ehrhardt @ 2008-12-12 12:42 UTC (permalink / raw)
  To: Hollis Blanchard
  Cc: Jan Kiszka, Avi Kivity, kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-devel

Hollis Blanchard wrote:
> On Thu, 2008-12-11 at 17:05 +0100, Jan Kiszka wrote:
>   
>> Hollis Blanchard wrote:
>>     
>>> On Thu, 2008-12-11 at 13:53 +0100, Christian Ehrhardt wrote:
>>>       
>>>> This is v2 as version one had a type in it occured when splitting patches.
>>>> Mercurial somehow lost my changes to the patch description explaining 
>>>> that, but the patch is right this way.
>>>>
>>>> Christian Ehrhardt wrote:
>>>>         
>>>>> # HG changeset patch
>>>>> # User Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>
>>>>> # Date 1228999833 -3600
>>>>> # Node ID dc1466c9077ab162f4637fffee1869f26be02299
>>>>> # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
>>>>> [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
>>>>>
>>>>> From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA-XMD5yJDbdMRS5n6/RkiaJA@public.gmane.orgne.org>
>>>>>
>>>>> Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
>>>>> mmu implementation that uses the kvm_translate ioctl.
>>>>> This also requires to save the kvm registers prior to the 'm' gdb operations.
>>>>>
>>>>> Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>>>>> Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>
>>>>>           
>>> Let's *not* apply this to kvm-userspace. We will submit this to qemu,
>>> and once we work out the right solution there it will be merged
>>> naturally.
>>>
>>>       
>> I don't oversee yet what you want to push upstream, but in case it's the
>> gdbstub support for kvm (including ppc bits): please note that I plan to
>> push the new interface once it is merged into kvm-userspace, avoiding to
>> spread the current, limited one as far as possible.
>>
>> BTW, would be great if you could have a look / provide patches for ppc
>> to support the new interface already. I am open for feedback,
>> specifically regarding its suitability beyond x86.
>>     
>
> I've been meaning to do this for a while, sorry. We'll take a look soon.
>
>   
Hi Jan,
I saw that you already had that env->s->g_cpu fix, so if you change all that
anyway it might really be better to test/extend your patches for powerpc 
now.

If it is ok for you I would submit my patches that apply on top of yours to
you and cc the kvm list. But as Hollis mentioned I would prefer go for qemu
upstream first and then assist Avi in merging it into kvm-userspace because
this is the natural direction patches flow atm (and if you need to change it
multiple times until you get qemu acceptance you would have to extensivly
patch both projects to match again).

As my code in that case depend on your patches it would be nice if you could
put them into your series once you are happy with it.

-- 

Grüsse / regards, 
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support
@ 2008-12-12 12:42               ` Christian Ehrhardt
  0 siblings, 0 replies; 14+ messages in thread
From: Christian Ehrhardt @ 2008-12-12 12:42 UTC (permalink / raw)
  To: Hollis Blanchard
  Cc: Jan Kiszka, Avi Kivity, kvm-ppc-u79uwXL29TY76Z2rM5mHXA, kvm-devel

Hollis Blanchard wrote:
> On Thu, 2008-12-11 at 17:05 +0100, Jan Kiszka wrote:
>   
>> Hollis Blanchard wrote:
>>     
>>> On Thu, 2008-12-11 at 13:53 +0100, Christian Ehrhardt wrote:
>>>       
>>>> This is v2 as version one had a type in it occured when splitting patches.
>>>> Mercurial somehow lost my changes to the patch description explaining 
>>>> that, but the patch is right this way.
>>>>
>>>> Christian Ehrhardt wrote:
>>>>         
>>>>> # HG changeset patch
>>>>> # User Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>>>>> # Date 1228999833 -3600
>>>>> # Node ID dc1466c9077ab162f4637fffee1869f26be02299
>>>>> # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
>>>>> [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
>>>>>
>>>>> From: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>>>>>
>>>>> Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm ppc style
>>>>> mmu implementation that uses the kvm_translate ioctl.
>>>>> This also requires to save the kvm registers prior to the 'm' gdb operations.
>>>>>
>>>>> Signed-off-by: Hollis Blanchard <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>>>>> Signed-off-by: Christian Ehrhardt <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>>>>>           
>>> Let's *not* apply this to kvm-userspace. We will submit this to qemu,
>>> and once we work out the right solution there it will be merged
>>> naturally.
>>>
>>>       
>> I don't oversee yet what you want to push upstream, but in case it's the
>> gdbstub support for kvm (including ppc bits): please note that I plan to
>> push the new interface once it is merged into kvm-userspace, avoiding to
>> spread the current, limited one as far as possible.
>>
>> BTW, would be great if you could have a look / provide patches for ppc
>> to support the new interface already. I am open for feedback,
>> specifically regarding its suitability beyond x86.
>>     
>
> I've been meaning to do this for a while, sorry. We'll take a look soon.
>
>   
Hi Jan,
I saw that you already had that env->s->g_cpu fix, so if you change all that
anyway it might really be better to test/extend your patches for powerpc 
now.

If it is ok for you I would submit my patches that apply on top of yours to
you and cc the kvm list. But as Hollis mentioned I would prefer go for qemu
upstream first and then assist Avi in merging it into kvm-userspace because
this is the natural direction patches flow atm (and if you need to change it
multiple times until you get qemu acceptance you would have to extensivly
patch both projects to match again).

As my code in that case depend on your patches it would be nice if you could
put them into your series once you are happy with it.

-- 

Grüsse / regards, 
Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub
       [not found]               ` <49425C2B.5040701-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
@ 2008-12-13  8:35                   ` Jan Kiszka
  0 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2008-12-13  8:35 UTC (permalink / raw)
  To: Christian Ehrhardt
  Cc: Hollis Blanchard, Avi Kivity, kvm-ppc-u79uwXL29TY76Z2rM5mHXA,
	kvm-devel, Jan Kiszka

[-- Attachment #1: Type: text/plain, Size: 3710 bytes --]

Christian Ehrhardt wrote:
> Hollis Blanchard wrote:
>> On Thu, 2008-12-11 at 17:05 +0100, Jan Kiszka wrote:
>>  
>>> Hollis Blanchard wrote:
>>>    
>>>> On Thu, 2008-12-11 at 13:53 +0100, Christian Ehrhardt wrote:
>>>>      
>>>>> This is v2 as version one had a type in it occured when splitting
>>>>> patches.
>>>>> Mercurial somehow lost my changes to the patch description
>>>>> explaining that, but the patch is right this way.
>>>>>
>>>>> Christian Ehrhardt wrote:
>>>>>        
>>>>>> # HG changeset patch
>>>>>> # User Christian Ehrhardt
>>>>>> <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>
>>>>>> # Date 1228999833 -3600
>>>>>> # Node ID dc1466c9077ab162f4637fffee1869f26be02299
>>>>>> # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
>>>>>> [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu
>>>>>> gdbstub
>>>>>>
>>>>>> From: Hollis Blanchard
>>>>>> <hollisb-r/Jw6+rmf7HQT0dZR+AlfA-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>
>>>>>>
>>>>>> Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm
>>>>>> ppc style
>>>>>> mmu implementation that uses the kvm_translate ioctl.
>>>>>> This also requires to save the kvm registers prior to the 'm' gdb
>>>>>> operations.
>>>>>>
>>>>>> Signed-off-by: Hollis Blanchard
>>>>>> <hollisb-r/Jw6+rmf7HQT0dZR+AlfA-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>
>>>>>> Signed-off-by: Christian Ehrhardt
>>>>>> <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org>
>>>>>>           
>>>> Let's *not* apply this to kvm-userspace. We will submit this to qemu,
>>>> and once we work out the right solution there it will be merged
>>>> naturally.
>>>>
>>>>       
>>> I don't oversee yet what you want to push upstream, but in case it's the
>>> gdbstub support for kvm (including ppc bits): please note that I plan to
>>> push the new interface once it is merged into kvm-userspace, avoiding to
>>> spread the current, limited one as far as possible.
>>>
>>> BTW, would be great if you could have a look / provide patches for ppc
>>> to support the new interface already. I am open for feedback,
>>> specifically regarding its suitability beyond x86.
>>>     
>>
>> I've been meaning to do this for a while, sorry. We'll take a look soon.
>>
>>   
> Hi Jan,
> I saw that you already had that env->s->g_cpu fix, so if you change all
> that
> anyway it might really be better to test/extend your patches for powerpc
> now.
> 
> If it is ok for you I would submit my patches that apply on top of yours to
> you and cc the kvm list. But as Hollis mentioned I would prefer go for qemu
> upstream first and then assist Avi in merging it into kvm-userspace because
> this is the natural direction patches flow atm (and if you need to
> change it
> multiple times until you get qemu acceptance you would have to extensivly
> patch both projects to match again).

My current roadmap is first merging kernel bits and corresponding
kvm-userspace changes so that we can test both extensively in the
context of full-blown kvm, and then push an adopted userspace interface
into qemu. The other way around would create the risk of missing
problems that only pop up under full-featured kvm (upstream is still
fairly limited, specifically as there is no threaded smp support).

That said, if you have (ppc-)changes that can be pushed immediately and
independently, there is surely no need to wait for the kvm-gdb series.

> 
> As my code in that case depend on your patches it would be nice if you
> could
> put them into your series once you are happy with it.
> 

I will happily carry them, no problem.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support
@ 2008-12-13  8:35                   ` Jan Kiszka
  0 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2008-12-13  8:35 UTC (permalink / raw)
  To: Christian Ehrhardt
  Cc: Hollis Blanchard, Avi Kivity, kvm-ppc-u79uwXL29TY76Z2rM5mHXA,
	kvm-devel, Jan Kiszka

[-- Attachment #1: Type: text/plain, Size: 3618 bytes --]

Christian Ehrhardt wrote:
> Hollis Blanchard wrote:
>> On Thu, 2008-12-11 at 17:05 +0100, Jan Kiszka wrote:
>>  
>>> Hollis Blanchard wrote:
>>>    
>>>> On Thu, 2008-12-11 at 13:53 +0100, Christian Ehrhardt wrote:
>>>>      
>>>>> This is v2 as version one had a type in it occured when splitting
>>>>> patches.
>>>>> Mercurial somehow lost my changes to the patch description
>>>>> explaining that, but the patch is right this way.
>>>>>
>>>>> Christian Ehrhardt wrote:
>>>>>        
>>>>>> # HG changeset patch
>>>>>> # User Christian Ehrhardt
>>>>>> <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>>>>>> # Date 1228999833 -3600
>>>>>> # Node ID dc1466c9077ab162f4637fffee1869f26be02299
>>>>>> # Parent  4c07fe2a56c7653a9113e05bb08c2de9aec210ce
>>>>>> [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu
>>>>>> gdbstub
>>>>>>
>>>>>> From: Hollis Blanchard
>>>>>> <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>>>>>>
>>>>>> Add basic KVM PowerPC support to qemu's gdbstub introducing a kvm
>>>>>> ppc style
>>>>>> mmu implementation that uses the kvm_translate ioctl.
>>>>>> This also requires to save the kvm registers prior to the 'm' gdb
>>>>>> operations.
>>>>>>
>>>>>> Signed-off-by: Hollis Blanchard
>>>>>> <hollisb-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
>>>>>> Signed-off-by: Christian Ehrhardt
>>>>>> <ehrhardt-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>>>>>>           
>>>> Let's *not* apply this to kvm-userspace. We will submit this to qemu,
>>>> and once we work out the right solution there it will be merged
>>>> naturally.
>>>>
>>>>       
>>> I don't oversee yet what you want to push upstream, but in case it's the
>>> gdbstub support for kvm (including ppc bits): please note that I plan to
>>> push the new interface once it is merged into kvm-userspace, avoiding to
>>> spread the current, limited one as far as possible.
>>>
>>> BTW, would be great if you could have a look / provide patches for ppc
>>> to support the new interface already. I am open for feedback,
>>> specifically regarding its suitability beyond x86.
>>>     
>>
>> I've been meaning to do this for a while, sorry. We'll take a look soon.
>>
>>   
> Hi Jan,
> I saw that you already had that env->s->g_cpu fix, so if you change all
> that
> anyway it might really be better to test/extend your patches for powerpc
> now.
> 
> If it is ok for you I would submit my patches that apply on top of yours to
> you and cc the kvm list. But as Hollis mentioned I would prefer go for qemu
> upstream first and then assist Avi in merging it into kvm-userspace because
> this is the natural direction patches flow atm (and if you need to
> change it
> multiple times until you get qemu acceptance you would have to extensivly
> patch both projects to match again).

My current roadmap is first merging kernel bits and corresponding
kvm-userspace changes so that we can test both extensively in the
context of full-blown kvm, and then push an adopted userspace interface
into qemu. The other way around would create the risk of missing
problems that only pop up under full-featured kvm (upstream is still
fairly limited, specifically as there is no threaded smp support).

That said, if you have (ppc-)changes that can be pushed immediately and
independently, there is surely no need to wait for the kvm-gdb series.

> 
> As my code in that case depend on your patches it would be nice if you
> could
> put them into your series once you are happy with it.
> 

I will happily carry them, no problem.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-12-13  8:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-11 12:52 [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub Christian Ehrhardt
2008-12-11 12:52 ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for Christian Ehrhardt
2008-12-11 12:53 ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub Christian Ehrhardt
2008-12-11 12:53   ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support Christian Ehrhardt
     [not found]   ` <49410D61.9090309-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-12-11 15:53     ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub Hollis Blanchard
2008-12-11 15:53       ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support Hollis Blanchard
2008-12-11 16:05       ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub Jan Kiszka
2008-12-11 16:05         ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support Jan Kiszka
2008-12-11 18:31         ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub Hollis Blanchard
2008-12-11 18:31           ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support Hollis Blanchard
     [not found]           ` <1229020274.26586.24.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-12-12 12:42             ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub Christian Ehrhardt
2008-12-12 12:42               ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support Christian Ehrhardt
     [not found]               ` <49425C2B.5040701-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-12-13  8:35                 ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support for qemu gdbstub Jan Kiszka
2008-12-13  8:35                   ` [PATCH] [PATCH] qemu: ppc: kvm-userspace: KVM PowerPC support Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.