From patchwork Wed Jul 4 13:39:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 1156221 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 D06B3DFF0F for ; Wed, 4 Jul 2012 13:40:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171Ab2GDNkg (ORCPT ); Wed, 4 Jul 2012 09:40:36 -0400 Received: from ozlabs.org ([203.10.76.45]:44028 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753118Ab2GDNke (ORCPT ); Wed, 4 Jul 2012 09:40:34 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 3D20B2C00E7; Wed, 4 Jul 2012 23:40:33 +1000 (EST) From: Michael Ellerman To: kvm@vger.kernel.org Cc: penberg@kernel.org, levinsasha928@gmail.com, asias.hejun@gmail.com, agraf@suse.de, Subject: [PATCH] kvm tool: Fix powerpc/kvm-cpu.c for new KVM_SET_ONE_REG API Date: Wed, 4 Jul 2012 23:39:58 +1000 Message-Id: <1341409198-30464-1-git-send-email-michael@ellerman.id.au> X-Mailer: git-send-email 1.7.9.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org I think this code was based on an earlier version of the KVM_SET_ONE_REG API, which at the time was in agraf's tree but not mainline? Either way it doesn't compile as is, so fix it up. Signed-off-by: Michael Ellerman --- tools/kvm/powerpc/kvm-cpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/kvm/powerpc/kvm-cpu.c b/tools/kvm/powerpc/kvm-cpu.c index 2505c69..97fc759 100644 --- a/tools/kvm/powerpc/kvm-cpu.c +++ b/tools/kvm/powerpc/kvm-cpu.c @@ -137,6 +137,7 @@ static void kvm_cpu__setup_sregs(struct kvm_cpu *vcpu) */ struct kvm_sregs sregs; struct kvm_one_reg reg = {}; + u64 value; if (ioctl(vcpu->vcpu_fd, KVM_GET_SREGS, &sregs) < 0) die("KVM_GET_SREGS failed"); @@ -147,8 +148,9 @@ static void kvm_cpu__setup_sregs(struct kvm_cpu *vcpu) if (ioctl(vcpu->vcpu_fd, KVM_SET_SREGS, &sregs) < 0) die("KVM_SET_SREGS failed"); - reg.id = KVM_ONE_REG_PPC_HIOR; - reg.u.reg64 = 0; + reg.id = KVM_REG_PPC_HIOR; + value = 0; + reg.addr = (u64)&value; if (ioctl(vcpu->vcpu_fd, KVM_SET_ONE_REG, ®) < 0) die("KVM_SET_ONE_REG failed"); }