Bug 1378704

Summary: Flag smap should not be enabled in rhel6 machine type
Product: Red Hat Enterprise Linux 7 Reporter: Guo, Zhiyi <zhguo>
Component: qemu-kvmAssignee: Amnon Ilan <ailan>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: chayang, ehabkost, juzhang, knoel, michen, pbonzini, rbalakri, virt-maint, xfu, zhguo
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-23 12:41:55 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:

Description Guo, Zhiyi 2016-09-23 06:59:51 UTC
Description of problem:
Flag smap should not be enabled not be enabled in rhel6 machine type

Version-Release number of selected component (if applicable):
qemu-kvm-1.5.3-126.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Boot rhel7.3 guest with cli:
/usr/libexec/qemu-kvm -name rhel7.3 -m 2048 \
        -smp 6,threads=2,cores=1,sockets=3,maxcpus=6 \
        -vga qxl\
        -spice port=3001,disable-ticketing \
        -device virtio-serial -chardev spicevmc,id=vdagent,debug=0,name=vdagent \
        -serial unix:/tmp/m,server,nowait \
        -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
        -drive file=/home/skylake.qcow2,if=none,id=drive-scsi-disk0,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-scsi-pci,id=scsi0 -device scsi-hd,drive=drive-scsi-disk0,bus=scsi0.0,scsi-id=0,lun=0,id=scsi-disk0,bootindex=1 \
        -monitor stdio \
        -usb -device usb-kbd,id=input0 \
        -netdev tap,id=idinWyYp,vhost=on -device virtio-net-pci,mac=42:ce:a9:d2:4d:d7,id=idlbq7eA,netdev=idinWyYp \
        -qmp tcp:localhost:4444,server,nowait \
	-machine rhel6.6.0\
	-cpu Skylake-Client,check,enforce \
2. Check flags inside guest by cat /proc/cpuinfo
3.

Actual results:
smap flag can be found 

Expected results:
smap flag cannot be found

Additional info:
If boot guest with -cpu Broadwell,check,enforce -machine rhel6.6.0, smap flag cannot be found inside guest.
guest cpuinfo:
# cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 94
model name	: Intel Core Processor (Skylake)
stepping	: 3
microcode	: 0x1
cpu MHz		: 2903.996
cache size	: 4096 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap xsaveopt xsavec xgetbv1
bogomips	: 5807.99
clflush size	: 64
cache_alignment	: 64
address sizes	: 39 bits physical, 48 bits virtual
power management:

Comment 2 Paolo Bonzini 2016-09-23 12:41:55 UTC
The Skylake Client CPU model never existed in RHEL 6.6, so you cannot execute "/usr/libexec/qemu-kvm -m rhel6.6.0 -cpu Skylake-client" on RHEL6.6.

So there is no need for compatibility measures to disable SMAP.