From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRlyq-0000LM-A0 for qemu-devel@nongnu.org; Fri, 17 Jul 2009 07:52:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRlyl-0000GF-BL for qemu-devel@nongnu.org; Fri, 17 Jul 2009 07:51:59 -0400 Received: from [199.232.76.173] (port=36962 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRlyl-0000Fu-3V for qemu-devel@nongnu.org; Fri, 17 Jul 2009 07:51:55 -0400 Received: from cantor.suse.de ([195.135.220.2]:43123 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MRlyj-0001b4-Uw for qemu-devel@nongnu.org; Fri, 17 Jul 2009 07:51:54 -0400 From: Alexander Graf Date: Fri, 17 Jul 2009 13:51:43 +0200 Message-Id: <1247831508-19023-3-git-send-email-agraf@suse.de> In-Reply-To: <1247831508-19023-2-git-send-email-agraf@suse.de> References: <1247831508-19023-1-git-send-email-agraf@suse.de> <1247831508-19023-2-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 2/7] Set PVR in sregs List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: hollisb@us.ibm.com We need to tell the kernel about some initial CPU state we don't have yet, so let's use the "sregs" IOCTL for that and simply put the Processor Version Register in there. Now the kernel knows which guest CPU to virtualize. Signed-off-by: Alexander Graf --- target-ppc/kvm.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index acbb1ab..04bb305 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -44,7 +44,13 @@ int kvm_arch_init(KVMState *s, int smp_cpus) int kvm_arch_init_vcpu(CPUState *cenv) { - return 0; + int ret = 0; + struct kvm_sregs sregs; + + sregs.pvr = cenv->spr[SPR_PVR]; + ret = kvm_vcpu_ioctl(cenv, KVM_SET_SREGS, &sregs); + + return ret; } int kvm_arch_put_registers(CPUState *env) -- 1.6.0.2