From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAuQD-0002Fw-8G for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:54:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAuQB-0002Cf-5t for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:54:16 -0500 Received: from [199.232.76.173] (port=47195 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAuQA-0002CI-Th for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:54:14 -0500 Received: from e2.ny.us.ibm.com ([32.97.182.142]:57673) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAuQA-0006k1-3x for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:54:14 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id mBBMrUfE001897 for ; Thu, 11 Dec 2008 17:53:30 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mBBMsCjI196634 for ; Thu, 11 Dec 2008 17:54:12 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mBBMrfXp016096 for ; Thu, 11 Dec 2008 17:53:41 -0500 Subject: Re: [Qemu-devel] [PATCH 3/6] Enable KVM for ppcemb. From: Hollis Blanchard In-Reply-To: <49418662.8000205@codemonkey.ws> References: <1229028752-9480-1-git-send-email-hollisb@us.ibm.com> <49418662.8000205@codemonkey.ws> Content-Type: text/plain Date: Thu, 11 Dec 2008 16:54:13 -0600 Message-Id: <1229036053.26586.41.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm-ppc@vger.kernel.org On Thu, 2008-12-11 at 15:30 -0600, Anthony Liguori wrote: > Hollis Blanchard wrote: > > +int kvm_arch_get_registers(CPUState *env) > > +{ > > + struct kvm_regs regs; > > + uint32_t i, ret; > > + > > + ret = kvm_vcpu_ioctl(env, KVM_GET_REGS, ®s); > > + if (ret < 0) > > + return ret; > > + > > + env->ctr = regs.ctr; > > + env->lr = regs.lr; > > + env->xer = regs.xer; > > + env->msr = regs.msr; > > + /* calculate hflags based on the current msr using the ppc qemu helper */ > > + hreg_compute_hflags(env); > > > > Do you need this? Practically speaking, I don't even think we need to > maintain them on x86 anymore. Ah, it seems you're right. That's good. > > diff --git a/target-ppc/kvm_ppc.c b/target-ppc/kvm_ppc.c > > new file mode 100644 > > index 0000000..b2b56df > > --- /dev/null > > +++ b/target-ppc/kvm_ppc.c > > > > Hence my confusion. These are just kvm related helper? > > I don't know that kvm_ppc.c is a very information name for this sort of > stuff. Since this is really host specific, not target specific, why not > move it out of target-ppc. I could combine kvm_ppc.c into target-ppc/kvm.c. However, they're really two different things, and I thought it would cause the least confusion if they were logically separate. Most of it is hooks required by common code, and then some of it isn't. (I'm thinking about e.g. IA64 doing a copy/paste, and then wondering which functions they actually need to implement.) Regardless, I will still need a kvm_ppc.h, so kvm_ppc.c seemed like a good place to match. I don't see that you can call any KVM code either host- or target-specific, since by definition they are the same. -- Hollis Blanchard IBM Linux Technology Center