Skip to contentSkip to conversation

kvm tools: Fix powerpc build after kvm__dump_mem() change

PATCH Applied Michael Ellerman 4 participants 5 messages Feb 4, 2013 – Feb 6, 2013 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm tools: Fix powerpc build after kvm__dump_mem() change

Commit 21692d1 (Beautify debug output) broke the powerpc build because it changed the signature for kvm__dump_mem() but didn't update all callers.

---
 tools/kvm/powerpc/kvm-cpu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/kvm/powerpc/kvm-cpu.c +1 -1
index 8fce121..8f825bd 100644
@@ -281,7 +281,7 @@ void kvm_cpu__show_code(struct kvm_cpu *vcpu)
 	dprintf(debug_fd, "\n Stack:\n");
 	dprintf(debug_fd,   " ------\n");
 	/* Only works in real mode: */
-	kvm__dump_mem(vcpu->kvm, vcpu->regs.gpr[1], 32);
+	kvm__dump_mem(vcpu->kvm, vcpu->regs.gpr[1], 32, debug_fd);
 }
 
 void kvm_cpu__show_page_tables(struct kvm_cpu *vcpu)
Signature · 1 line
1.7.10.4
Applied
#1 lore raw
Quoted 4 lines · Michael Ellerman

Commit 21692d1 (Beautify debug output) broke the powerpc build because it changed the signature for kvm__dump_mem() but didn't update all callers.

Applied, thanks Michael!

#2 lore raw
Quoted 7 lines · Pekka Enberg
Quoted 4 lines · Michael Ellerman

Commit 21692d1 (Beautify debug output) broke the powerpc build because it changed the signature for kvm__dump_mem() but didn't update all callers.

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

Quoted 1 line

From 9cdc8ecfdd2a1ec3075c0a129e934433f94c29dc Mon Sep 17 00:00:00 2001

From: Will Deacon <[email protected]>
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.

---
 tools/kvm/arm/aarch32/kvm-cpu.c | 11 +++++------
 tools/kvm/arm/aarch64/kvm-cpu.c | 11 +++++------
 2 files changed, 10 insertions(+), 12 deletions(-)
tools/kvm/arm/aarch32/kvm-cpu.c +5 -6
index a528789..6a012db 100644
@@ -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)
tools/kvm/arm/aarch64/kvm-cpu.c +5 -6
index 2eb06ea..7cdcb70 100644
@@ -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)
Signature · 1 line
1.8.0
Applied
#3 lore raw
Quoted 2 lines · Will Deacon

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!

#4 lore raw
In reply to Will Deacon
Quoted 11 lines · Will Deacon
Quoted 7 lines · Pekka Enberg
Quoted 4 lines · Michael Ellerman

Commit 21692d1 (Beautify debug output) broke the powerpc build because it changed the signature for kvm__dump_mem() but didn't update all callers.

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!

Quoted 94 lines

Cheers,

Will

--->8

From 9cdc8ecfdd2a1ec3075c0a129e934433f94c29dc Mon Sep 17 00:00:00 2001
From: Will Deacon <[email protected]>
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.

---
 tools/kvm/arm/aarch32/kvm-cpu.c | 11 +++++------
 tools/kvm/arm/aarch64/kvm-cpu.c | 11 +++++------
 2 files changed, 10 insertions(+), 12 deletions(-)
tools/kvm/arm/aarch32/kvm-cpu.c +5 -6
index a528789..6a012db 100644
@@ -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)
tools/kvm/arm/aarch64/kvm-cpu.c +5 -7
index 2eb06ea..7cdcb70 100644
@@ -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

Signature · 1 line
Asias He