hello ,

thanks for comments .

I tried now with force options for CPU flag which were not supported . Now the command with non fully supported CPU model gets executed ,  But i am surprised to see that still Guest  cpu model is not changed and still same as host cpu model(SAndy Bridge)

Why don't i see the model as HAswell now , could you please comment.

Command used :

virt-install --virt-type kvm --name controller-0  --cpu Haswell-noTSX,+fma,+movbe,+fsgsbase,+bmi1,+avx2,+smep,+bmi2,+erms,+invpcid --ram=8120 --vcpus=4,sockets=1

Linux process for KVM :

7479     1 37 10:13 ?        01:13:21 /usr/libexec/qemu-kvm -name controller-0 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu SandyBridge,+fma,+pcid,+movbe,+fsgsbase,+bmi1,+avx2,+smep,+bmi2,+erms,+invpcid -m 8120 -realtime mlock=off -smp 4,sockets=1,cores=4,threads=1



cpu guest :
processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 42
model name    : Intel Xeon E312xx (Sandy Bridge)
stepping    : 1
microcode    : 0x1
cpu MHz        : 1994.450
cache size    : 4096 KB
physical id    : 0
siblings    : 4
core id        : 0
cpu cores    : 4
apicid        : 0
initial apicid    : 0
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 cx16 pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx hypervisor lahf_lm xsaveopt
bogomips    : 3988.90
clflush size    : 64
cache_alignment    : 64
address sizes    : 46 bits physical, 48 bits virtual
power management:


CPU Host :

processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 45
model name    : Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz
stepping    : 7
microcode    : 0x710
cpu MHz        : 1200.000
cache size    : 15360 KB
physical id    : 0
siblings    : 12
core id        : 0
cpu cores    : 6
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 dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb pln pts dtherm tpr_shadow vnmi flexpriority ept vpid xsaveopt
bogomips    : 3990.17
clflush size    : 64
cache_alignment    : 64
address sizes    : 46 bits physical, 48 bits virtual
power management:


Thanks
Aki


On Wed, Jan 25, 2017 at 2:36 PM, Jiri Denemark <jdenemar@redhat.com> wrote:
On Tue, Jan 24, 2017 at 16:21:14 +0530, akhilesh rawat wrote:
> hi,
>
> yes we are talking about same host here.
>
> You could've just used -cpu host-model-only
> >> I dont want to host model ( it is working with host model) .
>
> AS KVM seems to allow support Haswell with native commands . Does this mean
> in my case KVM is allowing software emulated cpu model.

No, QEMU will just drop the features which are not supported on your
host. Although there are some rare exceptions, such as x2apic, which can
be emulated even with KVM.

Anyway, starting QEMU directly should print several warnings about
features which are dropped. And when you start QEMU with
-cpu Haswell,enforce it should refuse to start.

> Can libvirt allow  software-emulated for non host model ?  if yes how .

You can bypass the libvirt check for specific features by setting the
feature policy to "force" (no idea if this can be done with
virt-install), but QEMU will still do the check itself and either drop
the features or refuse to start (with enforce) if they cannot be used on
the host.

Jirka