From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NV60S-0004Ab-VZ for qemu-devel@nongnu.org; Wed, 13 Jan 2010 11:23:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NV60O-00049R-9e for qemu-devel@nongnu.org; Wed, 13 Jan 2010 11:23:40 -0500 Received: from [199.232.76.173] (port=42801 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NV60O-00049N-3b for qemu-devel@nongnu.org; Wed, 13 Jan 2010 11:23:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1025) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NV60N-00057J-KT for qemu-devel@nongnu.org; Wed, 13 Jan 2010 11:23:35 -0500 Date: Wed, 13 Jan 2010 18:23:32 +0200 From: Gleb Natapov Subject: Re: [Qemu-devel] [PATCHv3] Add KVM paravirt cpuid leaf Message-ID: <20100113162332.GO7549@redhat.com> References: <20100107124449.GY4905@redhat.com> <20100107162427.GF4905@redhat.com> <20100113132506.GY7549@redhat.com> <4B4DEF4D.9080101@codemonkey.ws> <20100113161454.GN7549@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100113161454.GN7549@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, avi@redhat.com On Wed, Jan 13, 2010 at 06:14:54PM +0200, Gleb Natapov wrote: > On Wed, Jan 13, 2010 at 10:05:33AM -0600, Anthony Liguori wrote: > > >+#ifdef CONFIG_KVM_PARA > > >+ /* Paravirtualization CPUIDs */ > > >+ memcpy(signature, "KVMKVMKVM\0\0\0", 12); > > >+ c =&cpuid_data.entries[cpuid_i++]; > > >+ memset(c, 0, sizeof(*c)); > > >+ c->function = KVM_CPUID_SIGNATURE; > > >+ c->eax = 0; > > >+ c->ebx = signature[0]; > > >+ c->ecx = signature[1]; > > >+ c->edx = signature[2]; > > >+ > > >+ c =&cpuid_data.entries[cpuid_i++]; > > >+ memset(c, 0, sizeof(*c)); > > >+ c->function = KVM_CPUID_FEATURES; > > >+ c->eax = env->cpuid_kvm_features& get_para_features(env); > > >+#endif > > >+ > > > cpu_x86_cpuid(env, 0, 0,&limit,&unused,&unused,&unused); > > > > Instead of hooking here, would it make more sense to tie into the > > generic cpuid function in helper.c? > > > What do you mean? This patch ties into generic cpuid function in > helper.c and pars kvm cpu flags there. Here we just configure > kernel. > Or do you mean making so that PV leaf will be available via cpu_x86_cpuid()? This make sense, but lets do it after merging this code path with qemu-kvm and the proposed patch brings qemu and qemu-kvm close together. -- Gleb.