Skip to contentSkip to conversation

x86info: dump kvm cpuid's

PATCH Michael S. Tsirkin 3 participants 9 messages Apr 29, 2012 – May 1, 2012

Subsystems (2)
lore
Share & tools
lore

Michael S. Tsirkin

author maintainer
#0 lore raw

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

---

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!

x86info.c +1 -0
index 22c4734..dee5ed1 100644
@@ -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) {
#1 lore raw
Quoted 11 lines · Michael S. Tsirkin

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. Other hypervisors may use more cpuid leafs. 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.

Quoted 15 lines

---

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!

x86info.c +0 -0
index 22c4734..dee5ed1 100644

x86info.c static void display_detailed_info(struct cpudata *cpu) · line 50

Quoted 7 lines
x86info.c +1 -0
@@ -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.

author maintainer
#2 lore raw
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Michael S. Tsirkin

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

Quoted 5 lines
Quoted 4 lines

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.

Quoted 1 line

Other hypervisors may use more cpuid leafs.

But not less so no harm's done.

Quoted 2 lines

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.

Quoted 25 lines
Quoted 15 lines

---

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!

x86info.c +0 -0
index 22c4734..dee5ed1 100644

x86info.c static void display_detailed_info(struct cpudata *cpu) · line 50

Quoted 7 lines
x86info.c +1 -0
@@ -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.

#3 lore raw
Quoted 19 lines · Michael S. Tsirkin
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Michael S. Tsirkin

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

Quoted 5 lines
Quoted 4 lines

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.

Quoted 1 line

Other hypervisors may use more cpuid leafs.

Quoted 8 lines

But not less so no harm's done.

Quoted 2 lines

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

Quoted 29 lines

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.

Quoted 25 lines
Quoted 15 lines

---

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!

x86info.c +0 -0
index 22c4734..dee5ed1 100644

x86info.c static void display_detailed_info(struct cpudata *cpu) · line 50

Quoted 7 lines
x86info.c +1 -0
@@ -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.

#4 lore raw
In reply to Michael S. Tsirkin
Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Gleb Natapov
Quoted 11 lines · Michael S. Tsirkin

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

Quoted 10 lines
Quoted 1 line

This is too KVM specific.

That's what I have. I scratch my own itch.

Quoted 1 line

Other hypervisors may use more cpuid leafs.

But not less so no harm's done.

Quoted 2 lines

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.

author maintainer
#5 lore raw
Quoted 20 lines · Ian Campbell
Quoted 19 lines · Michael S. Tsirkin
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Michael S. Tsirkin

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

Quoted 5 lines
Quoted 4 lines

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.

Quoted 1 line

Other hypervisors may use more cpuid leafs.

Quoted 7 lines
Quoted 4 lines

But not less so no harm's done.

Quoted 2 lines

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?

Quoted 7 lines

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?

Signature · 1 line
MST
#6 lore raw
Quoted 23 lines · Michael S. Tsirkin
Quoted 22 lines · Ian Campbell
Quoted 21 lines · Michael S. Tsirkin
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Michael S. Tsirkin

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

Quoted 5 lines
Quoted 4 lines

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.

Quoted 1 line

Other hypervisors may use more cpuid leafs.

But not less so no harm's done.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

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?

Quoted 9 lines
Quoted 7 lines

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.

#7 lore raw
In reply to Michael S. Tsirkin
Quoted 23 lines · Michael S. Tsirkin
Quoted 22 lines · Ian Campbell
Quoted 21 lines · Michael S. Tsirkin
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Michael S. Tsirkin

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

Quoted 5 lines
Quoted 4 lines

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.

Quoted 1 line

Other hypervisors may use more cpuid leafs.

But not less so no harm's done.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

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?

Quoted 9 lines
Quoted 7 lines

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.

author maintainer
#8 lore raw
In reply to Ian Campbell
Quoted 20 lines · Ian Campbell
Quoted 19 lines · Michael S. Tsirkin
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Michael S. Tsirkin

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

Quoted 5 lines
Quoted 4 lines

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.

Quoted 1 line

Other hypervisors may use more cpuid leafs.

Quoted 7 lines
Quoted 4 lines

But not less so no harm's done.

Quoted 2 lines

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?

Quoted 7 lines

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?

Signature · 1 line
MST