diff mbox

kvm tools: Fix powerpc build after kvm__dump_mem() change

Message ID 20130204133706.GB28975@mudshark.cambridge.arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Will Deacon Feb. 4, 2013, 1:37 p.m. UTC
On Mon, Feb 04, 2013 at 12:45:53PM +0000, Pekka Enberg wrote:
> On Mon, Feb 4, 2013 at 2:17 PM, Michael Ellerman <michael@ellerman.id.au> wrote:
> > Commit 21692d1 (Beautify debug output) broke the powerpc build because
> > it changed the signature for kvm__dump_mem() but didn't update all callers.
> >
> > Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> 
> Applied, thanks Michael!

D'oh! I was about to post a patch to fix this (arm is also broken)... I've
dropped the powerpc hunk from my patch (see below).

Cheers,

Will

--->8

From 9cdc8ecfdd2a1ec3075c0a129e934433f94c29dc Mon Sep 17 00:00:00 2001
From: Will Deacon <will.deacon@arm.com>
Date: Sun, 3 Feb 2013 15:37:48 +0000
Subject: [PATCH] kvm tools: arm: fix fallout from debug_fd refactoring

Commit 21692d19f744 ("kvm tools: Beautify debug output") changed the
kvm__dump_mem prototype but only fixed up calls from x86.

This patch fixes arm to pass the debug_fd as required.

Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 tools/kvm/arm/aarch32/kvm-cpu.c | 11 +++++------
 tools/kvm/arm/aarch64/kvm-cpu.c | 11 +++++------
 2 files changed, 10 insertions(+), 12 deletions(-)

Comments

Pekka Enberg Feb. 4, 2013, 2:26 p.m. UTC | #1
On Mon, Feb 4, 2013 at 3:37 PM, Will Deacon <will.deacon@arm.com> wrote:
> D'oh! I was about to post a patch to fix this (arm is also broken)... I've
> dropped the powerpc hunk from my patch (see below).

Applied, thanks Will!
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Asias He Feb. 6, 2013, 5:30 a.m. UTC | #2
On Mon, Feb 4, 2013 at 9:37 PM, Will Deacon <will.deacon@arm.com> wrote:
> On Mon, Feb 04, 2013 at 12:45:53PM +0000, Pekka Enberg wrote:
>> On Mon, Feb 4, 2013 at 2:17 PM, Michael Ellerman <michael@ellerman.id.au> wrote:
>> > Commit 21692d1 (Beautify debug output) broke the powerpc build because
>> > it changed the signature for kvm__dump_mem() but didn't update all callers.
>> >
>> > Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
>>
>> Applied, thanks Michael!
>
> D'oh! I was about to post a patch to fix this (arm is also broken)... I've
> dropped the powerpc hunk from my patch (see below).

Thanks, Michael and Will!

> Cheers,
>
> Will
>
> --->8
>
> From 9cdc8ecfdd2a1ec3075c0a129e934433f94c29dc Mon Sep 17 00:00:00 2001
> From: Will Deacon <will.deacon@arm.com>
> Date: Sun, 3 Feb 2013 15:37:48 +0000
> Subject: [PATCH] kvm tools: arm: fix fallout from debug_fd refactoring
>
> Commit 21692d19f744 ("kvm tools: Beautify debug output") changed the
> kvm__dump_mem prototype but only fixed up calls from x86.
>
> This patch fixes arm to pass the debug_fd as required.
>
> Signed-off-by: Will Deacon <will.deacon@arm.com>
> ---
>  tools/kvm/arm/aarch32/kvm-cpu.c | 11 +++++------
>  tools/kvm/arm/aarch64/kvm-cpu.c | 11 +++++------
>  2 files changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/tools/kvm/arm/aarch32/kvm-cpu.c b/tools/kvm/arm/aarch32/kvm-cpu.c
> index a528789..6a012db 100644
> --- a/tools/kvm/arm/aarch32/kvm-cpu.c
> +++ b/tools/kvm/arm/aarch32/kvm-cpu.c
> @@ -54,25 +54,24 @@ void kvm_cpu__show_code(struct kvm_cpu *vcpu)
>  {
>         struct kvm_one_reg reg;
>         u32 data;
> +       int debug_fd = kvm_cpu__get_debug_fd();
>
>         reg.addr = (u64)(unsigned long)&data;
>
> -       printf("*pc:\n");
> +       dprintf(debug_fd, "\n*pc:\n");
>         reg.id = ARM_CORE_REG(usr_regs.ARM_pc);
>         if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, &reg) < 0)
>                 die("KVM_GET_ONE_REG failed (show_code @ PC)");
>
> -       kvm__dump_mem(vcpu->kvm, data, 32);
> -       printf("\n");
> +       kvm__dump_mem(vcpu->kvm, data, 32, debug_fd);
>
> -       printf("*lr (svc):\n");
> +       dprintf(debug_fd, "\n*lr (svc):\n");
>         reg.id = ARM_CORE_REG(svc_regs[1]);
>         if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, &reg) < 0)
>                 die("KVM_GET_ONE_REG failed (show_code @ LR_svc)");
>         data &= ~0x1;
>
> -       kvm__dump_mem(vcpu->kvm, data, 32);
> -       printf("\n");
> +       kvm__dump_mem(vcpu->kvm, data, 32, debug_fd);
>  }
>
>  void kvm_cpu__show_registers(struct kvm_cpu *vcpu)
> diff --git a/tools/kvm/arm/aarch64/kvm-cpu.c b/tools/kvm/arm/aarch64/kvm-cpu.c
> index 2eb06ea..7cdcb70 100644
> --- a/tools/kvm/arm/aarch64/kvm-cpu.c
> +++ b/tools/kvm/arm/aarch64/kvm-cpu.c
> @@ -109,24 +109,23 @@ void kvm_cpu__show_code(struct kvm_cpu *vcpu)
>  {
>         struct kvm_one_reg reg;
>         unsigned long data;
> +       int debug_fd = kvm_cpu__get_debug_fd();
>
>         reg.addr = (u64)&data;
>
> -       printf("*pc:\n");
> +       dprintf(debug_fd, "\n*pc:\n");
>         reg.id = ARM64_CORE_REG(regs.pc);
>         if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, &reg) < 0)
>                 die("KVM_GET_ONE_REG failed (show_code @ PC)");
>
> -       kvm__dump_mem(vcpu->kvm, data, 32);
> -       printf("\n");
> +       kvm__dump_mem(vcpu->kvm, data, 32, debug_fd);
>
> -       printf("*lr:\n");
> +       dprintf(debug_fd, "\n*lr:\n");
>         reg.id = ARM64_CORE_REG(regs.regs[30]);
>         if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, &reg) < 0)
>                 die("KVM_GET_ONE_REG failed (show_code @ LR)");
>
> -       kvm__dump_mem(vcpu->kvm, data, 32);
> -       printf("\n");
> +       kvm__dump_mem(vcpu->kvm, data, 32, debug_fd);
>  }
>
>  void kvm_cpu__show_registers(struct kvm_cpu *vcpu)
> --
> 1.8.0
>
diff mbox

Patch

diff --git a/tools/kvm/arm/aarch32/kvm-cpu.c b/tools/kvm/arm/aarch32/kvm-cpu.c
index a528789..6a012db 100644
--- a/tools/kvm/arm/aarch32/kvm-cpu.c
+++ b/tools/kvm/arm/aarch32/kvm-cpu.c
@@ -54,25 +54,24 @@  void kvm_cpu__show_code(struct kvm_cpu *vcpu)
 {
 	struct kvm_one_reg reg;
 	u32 data;
+	int debug_fd = kvm_cpu__get_debug_fd();
 
 	reg.addr = (u64)(unsigned long)&data;
 
-	printf("*pc:\n");
+	dprintf(debug_fd, "\n*pc:\n");
 	reg.id = ARM_CORE_REG(usr_regs.ARM_pc);
 	if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, &reg) < 0)
 		die("KVM_GET_ONE_REG failed (show_code @ PC)");
 
-	kvm__dump_mem(vcpu->kvm, data, 32);
-	printf("\n");
+	kvm__dump_mem(vcpu->kvm, data, 32, debug_fd);
 
-	printf("*lr (svc):\n");
+	dprintf(debug_fd, "\n*lr (svc):\n");
 	reg.id = ARM_CORE_REG(svc_regs[1]);
 	if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, &reg) < 0)
 		die("KVM_GET_ONE_REG failed (show_code @ LR_svc)");
 	data &= ~0x1;
 
-	kvm__dump_mem(vcpu->kvm, data, 32);
-	printf("\n");
+	kvm__dump_mem(vcpu->kvm, data, 32, debug_fd);
 }
 
 void kvm_cpu__show_registers(struct kvm_cpu *vcpu)
diff --git a/tools/kvm/arm/aarch64/kvm-cpu.c b/tools/kvm/arm/aarch64/kvm-cpu.c
index 2eb06ea..7cdcb70 100644
--- a/tools/kvm/arm/aarch64/kvm-cpu.c
+++ b/tools/kvm/arm/aarch64/kvm-cpu.c
@@ -109,24 +109,23 @@  void kvm_cpu__show_code(struct kvm_cpu *vcpu)
 {
 	struct kvm_one_reg reg;
 	unsigned long data;
+	int debug_fd = kvm_cpu__get_debug_fd();
 
 	reg.addr = (u64)&data;
 
-	printf("*pc:\n");
+	dprintf(debug_fd, "\n*pc:\n");
 	reg.id = ARM64_CORE_REG(regs.pc);
 	if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, &reg) < 0)
 		die("KVM_GET_ONE_REG failed (show_code @ PC)");
 
-	kvm__dump_mem(vcpu->kvm, data, 32);
-	printf("\n");
+	kvm__dump_mem(vcpu->kvm, data, 32, debug_fd);
 
-	printf("*lr:\n");
+	dprintf(debug_fd, "\n*lr:\n");
 	reg.id = ARM64_CORE_REG(regs.regs[30]);
 	if (ioctl(vcpu->vcpu_fd, KVM_GET_ONE_REG, &reg) < 0)
 		die("KVM_GET_ONE_REG failed (show_code @ LR)");
 
-	kvm__dump_mem(vcpu->kvm, data, 32);
-	printf("\n");
+	kvm__dump_mem(vcpu->kvm, data, 32, debug_fd);
 }
 
 void kvm_cpu__show_registers(struct kvm_cpu *vcpu)