* Re: x86info: dump kvm cpuid's [not found] ` <20120430084319.GE15413@redhat.com> @ 2012-04-30 9:38 ` Michael S. Tsirkin 2012-04-30 9:41 ` Gleb Natapov 2012-05-01 10:29 ` [Xen-devel] " Ian Campbell 0 siblings, 2 replies; 5+ messages in thread From: Michael S. Tsirkin @ 2012-04-30 9:38 UTC (permalink / raw) To: Gleb Natapov; +Cc: xen-devel, kvm, pv-drivers, virtualization, devel, davej 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. I don't think guessing at the CPU behaviour from linux source is the right thing to do. I Cc'd some addresses found in MAINTAINERS in the linux kernel. This will give more people the opportunity to ask for their stuff to be added, if they care. > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > > > --- > > > > Dave - not sure whether there's a mailing list for x86info. > > The patch is on top of the master branch in > > git://git.codemonkey.org.uk/x86info.git > > > > Thanks! > > > > diff --git a/x86info.c b/x86info.c > > index 22c4734..dee5ed1 100644 > > --- a/x86info.c > > +++ b/x86info.c > > @@ -44,6 +44,7 @@ static void display_detailed_info(struct cpudata *cpu) > > > > if (cpu->maxei2 >=0xC0000000) > > dump_raw_cpuid(cpu->number, 0xC0000000, cpu->maxei2); > > + dump_raw_cpuid(cpu->number, 0x40000000, 0x40000001); > > } > > > > if (show_cacheinfo) { > > -- > Gleb. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: x86info: dump kvm cpuid's 2012-04-30 9:38 ` x86info: dump kvm cpuid's Michael S. Tsirkin @ 2012-04-30 9:41 ` Gleb Natapov 2012-05-01 10:29 ` [Xen-devel] " Ian Campbell 1 sibling, 0 replies; 5+ messages in thread From: Gleb Natapov @ 2012-04-30 9:41 UTC (permalink / raw) To: Michael S. Tsirkin Cc: xen-devel, kvm, pv-drivers, virtualization, devel, davej On Mon, Apr 30, 2012 at 12:38:13PM +0300, 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. > > I don't think guessing at the CPU behaviour from linux source > is the right thing to do. > That is guessing from Hyper-V specification. The best kind of guess. http://msdn.microsoft.com/en-us/library/windows/hardware/ff542700%28v=vs.85%29.aspx > I Cc'd some addresses found in MAINTAINERS in the linux > kernel. This will give more people the opportunity > to ask for their stuff to be added, if they care. > > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com> > > > > > > --- > > > > > > Dave - not sure whether there's a mailing list for x86info. > > > The patch is on top of the master branch in > > > git://git.codemonkey.org.uk/x86info.git > > > > > > Thanks! > > > > > > diff --git a/x86info.c b/x86info.c > > > index 22c4734..dee5ed1 100644 > > > --- a/x86info.c > > > +++ b/x86info.c > > > @@ -44,6 +44,7 @@ static void display_detailed_info(struct cpudata *cpu) > > > > > > if (cpu->maxei2 >=0xC0000000) > > > dump_raw_cpuid(cpu->number, 0xC0000000, cpu->maxei2); > > > + dump_raw_cpuid(cpu->number, 0x40000000, 0x40000001); > > > } > > > > > > if (show_cacheinfo) { > > > > -- > > Gleb. -- Gleb. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xen-devel] x86info: dump kvm cpuid's 2012-04-30 9:38 ` x86info: dump kvm cpuid's Michael S. Tsirkin 2012-04-30 9:41 ` Gleb Natapov @ 2012-05-01 10:29 ` Ian Campbell 2012-05-01 10:50 ` Michael S. Tsirkin 1 sibling, 1 reply; 5+ messages in thread From: Ian Campbell @ 2012-05-01 10:29 UTC (permalink / raw) To: Michael S. Tsirkin Cc: xen-devel@lists.xensource.com, kvm@vger.kernel.org, pv-drivers@vmware.com, virtualization@lists.linux-foundation.org, davej@redhat.com, devel@linuxdriverproject.org 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. 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. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xen-devel] x86info: dump kvm cpuid's 2012-05-01 10:29 ` [Xen-devel] " Ian Campbell @ 2012-05-01 10:50 ` Michael S. Tsirkin 2012-05-01 12:17 ` Ian Campbell 0 siblings, 1 reply; 5+ messages in thread From: Michael S. Tsirkin @ 2012-05-01 10:50 UTC (permalink / raw) To: Ian Campbell 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 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 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xen-devel] x86info: dump kvm cpuid's 2012-05-01 10:50 ` Michael S. Tsirkin @ 2012-05-01 12:17 ` Ian Campbell 0 siblings, 0 replies; 5+ messages in thread From: Ian Campbell @ 2012-05-01 12:17 UTC (permalink / raw) To: Michael S. Tsirkin 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 On Tue, 2012-05-01 at 11:50 +0100, Michael S. Tsirkin wrote: > 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? I didn't see the patch, where should I be looking? > > 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? http://xenbits.xen.org/docs/unstable/hypercall/include,public,arch-x86,cpuid.h.html EBX, ECX and EDX contain a signature "XenVMMXenVMM". I'm fairly certain that hyperv has it's own magic number here. Ian. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-01 12:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20120429101019.GA21165@redhat.com>
[not found] ` <20120430084319.GE15413@redhat.com>
2012-04-30 9:38 ` x86info: dump kvm cpuid's Michael S. Tsirkin
2012-04-30 9:41 ` Gleb Natapov
2012-05-01 10:29 ` [Xen-devel] " Ian Campbell
2012-05-01 10:50 ` Michael S. Tsirkin
2012-05-01 12:17 ` Ian Campbell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).