All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: kvm@vger.kernel.org
Cc: penberg@kernel.org, levinsasha928@gmail.com,
	asias.hejun@gmail.com, agraf@suse.de, <matt@ozlabs.org>
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	[thread overview]
Message-ID: <1341409198-30464-1-git-send-email-michael@ellerman.id.au> (raw)

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 <michael@ellerman.id.au>
---
 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, &reg) < 0)
 		die("KVM_SET_ONE_REG failed");
 }
-- 
1.7.9.5


             reply	other threads:[~2012-07-04 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04 13:39 Michael Ellerman [this message]
2012-07-04 14:07 ` [PATCH] kvm tool: Fix powerpc/kvm-cpu.c for new KVM_SET_ONE_REG API Alexander Graf
2012-07-04 14:13   ` Pekka Enberg
2012-07-04 20:03 ` Matt Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1341409198-30464-1-git-send-email-michael@ellerman.id.au \
    --to=michael@ellerman.id.au \
    --cc=agraf@suse.de \
    --cc=asias.hejun@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=matt@ozlabs.org \
    --cc=penberg@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.