LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 12-31-2010, 09:50 AM   #1
cosmonate
LQ Newbie
 
Registered: Feb 2003
Distribution: Slackware, CentOS
Posts: 18

Rep: Reputation: 0
kvm only shows virtual cpu!?


Hi,

I assume it is NOT normal/correct that qemu-kvm "using" hardware acceleration with intel-vt shows a "Qemu Virtual CPU" to the guest instead of the original host cpu and it's extensions?

I'm running a dual xeon 5620 server, intel-vt and all virtualization related bios settings are on.

===========
host os: fedora 14

each guest gets 8 cpus and 4gig ram.

guest1: windows 7 ultimate 64 -> shows ONLY 2 Qemu Virtual CPUs with a minimum set of extensions available, instead of 8 xeons

guest2: fedora 14 64 -> shows 8 Quemu Virtual CPUs and also only a few extensions:
fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good pni cx16 popcnt hypervisor lahf_lm

...instead of:
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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid

the virtual performance over all seems also quite poor, so i assume that the machine got emulated instead of virtualized using VT!?

the virt config is as followed:

<domain type='kvm'>
<name>shockwave</name>
<uuid>77c2483c-2449-8d86-ff8b-3169032eaa90</uuid>
<memory>4194304</memory>
<currentMemory>4194304</currentMemory>
<vcpu>8</vcpu>
<os>
<type arch='x86_64' machine='pc-0.13'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='localtime'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/mnt/data/virtualMachines/disks/shockwave01.img'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='bridge'>
<mac address='52:54:00:36:12:c6'/>
<source bridge='br0'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<video>
<model type='vga' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</memballoon>
</devices>
</domain>

============
virtual cpu info:

processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 2
model name : QEMU Virtual CPU version 0.13.0
stepping : 3
cpu MHz : 2400.134
cache size : 4096 KB
fpu : yes
fpu_exception : yes
cpuid level : 4
wp : yes
flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good pni cx16 popcnt hypervisor lahf_lm
bogomips : 4800.26
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:

=========
host cpu info:

processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 44
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
stepping : 2
cpu MHz : 1600.000
cache size : 12288 KB
physical id : 1
siblings : 8
core id : 10
cpu cores : 4
apicid : 52
initial apicid : 52
fpu : yes
fpu_exception : yes
cpuid level : 11
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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid
bogomips : 4799.93
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:

is there any way to determine if kvm is working correctly?
i can see that the extensions are loaded, but are they used?

lsmod | grep kvm
kvm_intel 41950 20
kvm 257356 1 kvm_intel

lsmod | grep intel
kvm_intel 41950 20
kvm 257356 1 kvm_intel
aesni_intel 12131 6
cryptd 7111 3 aesni_intel
aes_x86_64 7758 1 aesni_intel
aes_generic 26908 2 aesni_intel,aes_x86_64

... this one shows that the aes modules are used by cryptd, so shouldn't the kvm modules be used by libvirtd or kvm?

any ideas? suggestions?

thx
bernd
 
Old 12-31-2010, 10:00 AM   #2
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado
Distribution: Slackware
Posts: 501

Rep: Reputation: 96
Quote:
Originally Posted by cosmonate View Post
I assume it is NOT normal/correct that qemu-kvm "using" hardware acceleration with intel-vt shows a "Qemu Virtual CPU" to the guest instead of the original host cpu and it's extensions?
It is normal and correct. QEMU is an emulator and simulates peripherals to the guest OS.

http://wiki.qemu.org/download/qemu-d...5fintroduction

Quote:
The QEMU PC System emulator simulates the following peripherals:

* - i440FX host PCI bridge and PIIX3 PCI to ISA bridge
* - Cirrus CLGD 5446 PCI VGA card or dummy VGA card with Bochs VESA extensions (hardware level, including all non standard modes).
* - PS/2 mouse and keyboard
* - 2 PCI IDE interfaces with hard disk and CD-ROM support
* - Floppy disk
* - PCI and ISA network adapters
* - Serial ports
* - Creative SoundBlaster 16 sound card
* - ENSONIQ AudioPCI ES1370 sound card
* - Intel 82801AA AC97 Audio compatible sound card
* - Adlib(OPL2) - Yamaha YM3812 compatible chip
* - Gravis Ultrasound GF1 sound card
* - CS4231A compatible sound card
* - PCI UHCI USB controller and a virtual USB hub.

SMP is supported with up to 255 CPUs.

Note that adlib, gus and cs4231a are only available when QEMU was configured with –audio-card-list option containing the name(s) of required card(s).

QEMU uses the PC BIOS from the Bochs project and the Plex86/Bochs LGPL VGA BIOS.

QEMU uses YM3812 emulation by Tatsuyuki Satoh.

QEMU uses GUS emulation(GUSEMU32 http://www.deinmeister.de/gusemu/) by Tibor "TS" Schütz.

Not that, by default, GUS shares IRQ(7) with parallel ports and so qemu must be told to not have parallel ports to have working GUS
 
Old 12-31-2010, 10:10 AM   #3
cosmonate
LQ Newbie
 
Registered: Feb 2003
Distribution: Slackware, CentOS
Posts: 18

Original Poster
Rep: Reputation: 0
thx for the fast reply!

Quote:
It is normal and correct. QEMU is an emulator and simulates peripherals to the guest OS.
... i know that qemu is an emulator but i also thought when using qemu-kvm with intel-vt i get hardware acceleration and paravirtzualized performance like using a bare metal hypervisor due to intel-vt. as far as i i remember when using virtualbox i see the host cpu in the virtual machine with all it's extensions fully supported!? shouldn't this be also the case when using kvm resp. qemu-kvm?

greetings
bernd
 
Old 12-31-2010, 11:25 AM   #4
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado
Distribution: Slackware
Posts: 501

Rep: Reputation: 96
It sounds like you're using some type of virt manager program to start your VMs. I use the CLI and have custom scripts that pass start up parameters. If the KVM modules are not loaded there is an error message that states KVM is not activated. Symptoms are the VM is extremely slow to boot up and slow to operate.

Why your Windows VM doesn't show the right number of virt CPUs is probably due to a setting in the virt manager. With qemu-kvm there is a CLI "-smp" option that sets the number of CPUs. Maybe someone else uses the same program and can assist.

Beyond the CPU controls, qemu-kvm uses virtio drivers for network, block devices and balloon memory. Those drivers can help speed up your VMs depending on how they are configured.
 
Old 12-31-2010, 03:21 PM   #5
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, Portugal
Distribution: Slackware
Posts: 427

Rep: Reputation: 185Reputation: 185
You are using livirt, right?
Next time, please mention it because "I'm using qemu-kvm" is not the same as "I'm using qemu-kvm with libvirt"...

Anyway, your first stop should have been livirt's documentation.
I think this is what you are looking for: http://libvirt.org/formatdomain.html#elementsCPU
 
Old 01-01-2011, 12:20 PM   #6
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by cosmonate View Post
thx for the fast reply!



... i know that qemu is an emulator but i also thought when using qemu-kvm with intel-vt i get hardware acceleration and paravirtzualized performance like using a bare metal hypervisor due to intel-vt.
That's correct, and it has nothing to do with the CPU NAME provided to the guest OS by the hypervisor.

Quote:
as far as i i remember when using virtualbox i see the host cpu in the virtual machine with all it's extensions fully supported!? shouldn't this be also the case when using kvm resp. qemu-kvm?
Do you see any missing extensions, or is it only that the CPU name that bothers you?
 
Old 01-02-2011, 04:50 AM   #7
cosmonate
LQ Newbie
 
Registered: Feb 2003
Distribution: Slackware, CentOS
Posts: 18

Original Poster
Rep: Reputation: 0
thx for the replys and happy new year :-D

... @ Slax-Dude:
yes i'm using libvirt/virtmanager, and the params set by the application should be correct as the config i posted shows. the documentation states the same. anyway the settings should get automatically detected by qemu-kvm if not set, so it's more a configuration by exception pattern meaning restricting the guest if necessary?

Quote:
"I'm using qemu-kvm" is not the same as "I'm using qemu-kvm with libvirt"...
.. whats the difference? isn't libvirt is only a wrapper around qemu-kvm!?!?

... @ Chuck56:
yes, as stated above i'm using virtmanager and libvirt for creating and start/stopping vms.
the umber of cpus is configured correcty -> same for both, virtual linux and windows as the config in my initial post shows:

Quote:
<domain type='kvm'>
<name>shockwave</name>
<uuid>77c2483c-2449-8d86-ff8b-3169032eaa90</uuid>
<memory>4194304</memory>
<currentMemory>4194304</currentMemory>
<vcpu>8</vcpu>
<os>
<type arch='x86_64' machine='pc-0.13'>hvm</type>
<boot dev='hd'/>
</os>
... and i'm also using virtio devices but they perform quite poor:
linux I/O -> write 40mb/s read 70-80mb/s
windows I/O -> write 2-3mb/s!! read 70-80mb/s
the host hardware is a raid5 performing @ 130-140mb/s write and far above 200mb/s read. so there seems to be something wrong with the IO to not only the cpus, especially in the windows vm. virtio network speed to the host via nfs is also 40 read and 70 write.

as i also posted kvm mods are loaded but i'm not sure if they are used:
Quote:
i can see that the extensions are loaded, but are they used?

lsmod | grep kvm
kvm_intel 41950 20
kvm 257356 1 kvm_intel

lsmod | grep intel
kvm_intel 41950 20
kvm 257356 1 kvm_intel
aesni_intel 12131 6
cryptd 7111 3 aesni_intel
aes_x86_64 7758 1 aesni_intel
aes_generic 26908 2 aesni_intel,aes_x86_64

... this one shows that the aes modules are used by cryptd, so shouldn't the kvm modules be used by libvirtd or kvm?
... @ dyasny:

Quote:
That's correct, and it has nothing to do with the CPU NAME provided to the guest OS by the hypervisor.
... well i think if the cpu isn't "passed" directly to the guest, it's "emulated" not "virtualized" using intel-vt!?
isn't it that due to vt support a correctly implemented hypervisor can share the cpu completely with the guests!? i thought that is the purpose of intel-vt and amd-v!?

Quote:
Do you see any missing extensions, or is it only that the CPU name that bothers you?
...
Quote:
guest2: fedora 14 64 -> shows 8 Quemu Virtual CPUs and also only a few extensions:
fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm rep_good pni cx16 popcnt hypervisor lahf_lm

...instead of:
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 xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 popcnt aes lahf_lm ida arat tpr_shadow vnmi flexpriority ept vpid

the virtual performance over all seems also quite poor, so i assume that the machine got emulated instead of virtualized using VT!?
... as you can see most of the extensions are missing! looking at the windows host it's even worse, because cpu-z tells me there are only 3 or 4 extensions available.

again: i'm using fedora 14 (quite new virtualiztion stuff) with kvm/libvirt/virt-manager) settings are triple checked and should be ok from what i understood (there is not much one can do wrong in the gui :-) )
as i stated -> virtualbox showed me the "complete cpu" in the guest with all extensions available and usable and nearly host like performance, which is essential if i want to virtualize a server completely. i thought this should be possible with kvm too, especially now, since redhat dropped xen in favor of kvm. i don't think enterprise virtualization works using emulation. whats wrong here!? :-(

again thx for the replys, and hopefully we find a solution for that since i like tight integration of kvm.

thx
bernd
 
Old 01-02-2011, 04:22 PM   #8
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by cosmonate View Post



... well i think if the cpu isn't "passed" directly to the guest, it's "emulated" not "virtualized" using intel-vt!?
isn't it that due to vt support a correctly implemented hypervisor can share the cpu completely with the guests!? i thought that is the purpose of intel-vt and amd-v!?
no, you're wrong. VT allows for kvm to pass more CPU instructions directly from the CPU to the VM. If you pass the CPU directly over to the VM, what will the host use?

Quote:
... as you can see most of the extensions are missing! looking at the windows host it's even worse, because cpu-z tells me there are only 3 or 4 extensions available.
you could try and start a VM up with pure qemu and compare the available CPU flags. It may be possible you're not using kvm at all for some reason.
 
Old 01-03-2011, 05:49 AM   #9
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, Portugal
Distribution: Slackware
Posts: 427

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by cosmonate View Post
... @ Slax-Dude:
yes i'm using libvirt/virtmanager, and the params set by the application should be correct as the config i posted shows. the documentation states the same. anyway the settings should get automatically detected by qemu-kvm if not set, so it's more a configuration by exception pattern meaning restricting the guest if necessary?
Please read the documentation carefully...
Note that you will have to edit the config file for your VM manually, as virt-manager does not yet support all qemu-kvm options... so no: using qemu-kvm is not the same as using qemu-kvm through libvirt.

If the "wrapper" supported ALL the functions of the "wrapped", then there would be no problem

I also use virt-manager, and I had a bit of trouble installing slackware64 13.1 because virt-manager was not able to specify a 64bit to the guest.
I had to add this manually to my VM config file:
Code:
  <cpu match='exact'>
    <model>core2duo</model>
    <vendor>Intel</vendor>
    <topology sockets='1' cores='2' threads='1'/>
    <feature policy='disable' name='lahf_lm'/>
  </cpu>
 
Old 01-10-2011, 08:14 AM   #10
cosmonate
LQ Newbie
 
Registered: Feb 2003
Distribution: Slackware, CentOS
Posts: 18

Original Poster
Rep: Reputation: 0
Thx for the advice slax-dude, i'll give this a try as soon as i install my new slackware server. I'm excited if this works since i need aes-ni and different sse extensions inside my virtual machines.

l8r
bernd
 
Old 02-02-2011, 10:38 AM   #11
brulz
LQ Newbie
 
Registered: Feb 2011
Location: Rochester, Mn
Distribution: CentOS, Debian, Ubuntu
Posts: 1

Rep: Reputation: 0
As far as my understanding the "model name : QEMU Virtual CPU version 0.13.0" is presented to the guest OS so that enterprise server features like live migration can occur between different vendor's processors (Intel,AMD). The guest operating system is presented with a processor feature set that all x86_64 processors have in common so that migrated between them while running can be seemless. This behavior can be disabled by adding
args: -cpu host to the VMs config file.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Read guest virtual memory in KVM raghu2383 Linux - Virtualization and Cloud 0 11-29-2010 05:08 AM
XEN, KVM, Virtual iron, some doubts michaelux Linux - Virtualization and Cloud 7 06-08-2010 06:54 AM
KVM and DOS - cpu to 100% GoinEasy9 Linux - Virtualization and Cloud 2 10-20-2009 11:27 AM
Are KVM guest able to use CPU features ? PlatinumX Linux - Hardware 1 01-03-2009 10:30 AM
KVM Virtual Machine CD CHANGE ashishverma1984 Fedora 2 12-12-2008 03:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 07:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration