From patchwork Mon Feb 4 13:37:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 2092141 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 69271DFE82 for ; Mon, 4 Feb 2013 13:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754648Ab3BDNh0 (ORCPT ); Mon, 4 Feb 2013 08:37:26 -0500 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21]:59733 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753342Ab3BDNhZ (ORCPT ); Mon, 4 Feb 2013 08:37:25 -0500 Received: from mudshark.cambridge.arm.com (mudshark.cambridge.arm.com [10.1.79.58]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id r14Db7qT002625; Mon, 4 Feb 2013 13:37:07 GMT Date: Mon, 4 Feb 2013 13:37:06 +0000 From: Will Deacon To: Pekka Enberg Cc: Michael Ellerman , "kvm@vger.kernel.org" , "asias.hejun@gmail.com" Subject: Re: [PATCH] kvm tools: Fix powerpc build after kvm__dump_mem() change Message-ID: <20130204133706.GB28975@mudshark.cambridge.arm.com> References: <1359980265-26187-1-git-send-email-michael@ellerman.id.au> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Feb 04, 2013 at 12:45:53PM +0000, Pekka Enberg wrote: > On Mon, Feb 4, 2013 at 2:17 PM, Michael Ellerman 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 > > 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 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 --- 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, ®) < 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, ®) < 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, ®) < 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, ®) < 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)