From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [Xen-devel] x86info: dump kvm cpuid's Date: Tue, 1 May 2012 13:50:32 +0300 Message-ID: <20120501105032.GA6654@redhat.com> References: <20120429101019.GA21165@redhat.com> <20120430084319.GE15413@redhat.com> <20120430093811.GC5414@redhat.com> <1335868144.6038.89.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Gleb Natapov , "xen-devel@lists.xensource.com" , "kvm@vger.kernel.org" , "pv-drivers@vmware.com" , "virtualization@lists.linux-foundation.org" , "devel@linuxdriverproject.org" , "davej@redhat.com" To: Ian Campbell Return-path: Received: from mx1.redhat.com ([209.132.183.28]:15363 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754619Ab2EAKui (ORCPT ); Tue, 1 May 2012 06:50:38 -0400 Content-Disposition: inline In-Reply-To: <1335868144.6038.89.camel@zakaz.uk.xensource.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, May 01, 2012 at 11:29:04AM +0100, Ian Campbell wrote: > On Mon, 2012-04-30 at 10:38 +0100, Michael S. Tsirkin wrote: > > On Mon, Apr 30, 2012 at 11:43:19AM +0300, Gleb Natapov wrote: > > > On Sun, Apr 29, 2012 at 01:10:21PM +0300, Michael S. Tsirkin wrote: > > > > The following makes 'x86info -r' dump kvm cpu ids > > > > (signature+features) when running in a vm. > > > > > > > > On the guest we see the signature and the features: > > > > eax in: 0x40000000, eax = 00000000 ebx = 4b4d564b ecx = 564b4d56 edx = 0000004d > > > > eax in: 0x40000001, eax = 0100007b ebx = 00000000 ecx = 00000000 edx = 00000000 > > > > > > > > On the host it just adds a couple of zero lines: > > > > eax in: 0x40000000, eax = 00000000 ebx = 00000000 ecx = 00000000 edx = 00000000 > > > > eax in: 0x40000001, eax = 00000000 ebx = 00000000 ecx = 00000000 edx = 00000000 > > > > > > > This is too KVM specific. > > > > That's what I have. I scratch my own itch. > > > > > Other hypervisors may use more cpuid leafs. > > > > But not less so no harm's done. > > > > > As far as I see Hyper-V uses 5 and use cpuid.0x40000000.eax as max cpuid > > > leaf available. Haven't checked Xen or VMWare. > > Xen does the same, documentation in the Xen public interfaces header: > http://xenbits.xen.org/docs/unstable/hypercall/include,public,arch-x86,cpuid.h.html. So ack to my patch? > If compat mode for another h/v is enabled then those leaves will appear > at 0x40000000 and Xen's will be bumped up, so a fully Xen aware set of > drivers (or detection routine, etc) should check at 0x100 intervals > until 0x40010000 for the appropriate signatures (I realise that the docs > are somewhat lacking in this regard, I should cook up a patch). > > Ian. How does guest know that the data at 0x40000100 makes sense? -- MST