Bug 1005695

Summary: QEMU should hide CPUID.0Dh values that it does not support
Product: Red Hat Enterprise Linux 7 Reporter: Paolo Bonzini <pbonzini>
Component: qemu-kvmAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: acathrow, hhuang, huding, juzhang, mrezanin, pbonzini, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-15.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1007897 1007899 (view as bug list) Environment:
Last Closed: 2014-06-13 13:19:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1007897    
Bug Blocks: 1007899    

Description Paolo Bonzini 2013-09-09 08:25:50 UTC
CPUID.0Dh reports in EAX/ECX/EDX the size of the supported save areas.  KVM guests should not be presented more information than that available in the chosen CPU model.

This is important to run QEMU on hosts that support AVX-512 or MPX.

Comment 2 Miroslav Rezanina 2013-11-07 08:23:18 UTC
Fix included in qemu-kvm-1.5.3-15.el7

Comment 4 FuXiangChun 2013-12-25 06:05:41 UTC
Paolo,
QE want to verify this bug, but do not know how to check register's value inside guest. could you tell me to check which register's value?  e.g

eax in: 0x00000000, eax = 00000005 ebx = 68747541 ecx = 444d4163 edx = 69746e65
eax in: 0x00000001, eax = 00000f61 ebx = 00040800 ecx = 80002001 edx = 178bfbfd
eax in: 0x00000002, eax = 00000001 ebx = 00000000 ecx = 00000000 edx = 002c307d
eax in: 0x00000003, eax = 00000000 ebx = 00000000 ecx = 00000000 edx = 00000000
eax in: 0x00000004, eax = 04000121 ebx = 01c0003f ecx = 0000003f edx = 00000001
eax in: 0x00000005, eax = 00000000 ebx = 00000000 ecx = 00000003 edx = 00000000

eax in: 0x80000000, eax = 80000008 ebx = 68747541 ecx = 444d4163 edx = 69746e65
eax in: 0x80000001, eax = 00000f61 ebx = 00000000 ecx = 00000007 edx = 2193fbfd
eax in: 0x80000002, eax = 20444d41 ebx = 6574704f ecx = 206e6f72 edx = 78783232
eax in: 0x80000003, eax = 65472820 ebx = 2032206e ecx = 73616c43 edx = 704f2073
eax in: 0x80000004, eax = 6f726574 ebx = 0000296e ecx = 00000000 edx = 00000000
eax in: 0x80000005, eax = 01ff01ff ebx = 01ff01ff ecx = 40020140 edx = 40020140
eax in: 0x80000006, eax = 00000000 ebx = 42004200 ecx = 02008140 edx = 00000000
eax in: 0x80000007, eax = 00000000 ebx = 00000000 ecx = 00000000 edx = 00000000
eax in: 0x80000008, eax = 00003028 ebx = 00000000 ecx = 00000003 edx = 00000000

Comment 5 juzhang 2014-01-13 07:00:10 UTC
Hi Paolo,

Could you have a look comment4 and add your comment?

Best Regards,
Junyi

Comment 6 Paolo Bonzini 2014-01-13 12:11:34 UTC
Sorry for the delay Junyi and Fu, I was on PTO.  You have to run on Sandy Bridge or newer, and look at "eax in: 0x0000000d".

Try with "-cpu SandyBridge" and "-cpu SandyBridge,-avx", and you should see different output in that line.

Comment 7 juzhang 2014-02-08 00:13:46 UTC
Thanks Paolo.

Hi Xiangchun,

Could you verify this bz according to comment6?

Best Regards,
Junyi

Comment 8 FuXiangChun 2014-02-08 02:58:25 UTC
(In reply to Paolo Bonzini from comment #6)
> Sorry for the delay Junyi and Fu, I was on PTO.  You have to run on Sandy
> Bridge or newer, and look at "eax in: 0x0000000d".
> 
> Try with "-cpu SandyBridge" and "-cpu SandyBridge,-avx", and you should see
> different output in that line.

Verify this bug with qemu-kvm-1.5.3-45.el7.x86_64 and Haswell host.

Scenaro-1
1.1 Boot RHEL7.0 guest() with -cpu SandyBridge. 
1.2 check register value inside guest via x86info tool
result:
eax in: 0x0000000d, eax = 00000007 ebx = 00000340 ecx = 00000340 edx = 00000000

Scenaro-2
2.1 Boot RHEL7.0 guest with -cpu SandyBridge,-axv
2.2 check register value inside guest via x86info tool
result:
eax in: 0x0000000d, eax = 00000003 ebx = 00000240 ecx = 00000240 edx = 00000000

Paolo,
According to comment 6, QE get register's values above. Base on this result. Is this bug fixed?

Comment 9 FuXiangChun 2014-02-08 08:46:47 UTC
Additional, Tested qemu-kvm-1.5.3-15.el7.x86_64(unfix version)
Boot RHEL7.0 guest with -cpu SandyBridge/-cpu SandyBridge,-axv, register's values is no change. always is this below.
eax in: 0x0000000d, eax = 00000007 ebx = 00000340 ecx = 00000340 edx = 00000000

Comment 10 FuXiangChun 2014-02-08 08:48:44 UTC
Ignore comment 9. 

correct comment9.
Tested qemu-kvm-1.5.3-14.el7.x86_64(unfix version)
Boot RHEL7.0 guest with -cpu SandyBridge/-cpu SandyBridge,-axv, register's values is no change. always is this below.
eax in: 0x0000000d, eax = 00000007 ebx = 00000340 ecx = 00000340 edx = 00000000

Comment 11 Paolo Bonzini 2014-02-13 23:48:50 UTC
Yes, the fix is verified.

Comment 13 Ludek Smid 2014-06-13 13:19:49 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.