Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Intel Core2 Duo w/ vmx and KVM/Qemu: info needed
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Sun Jun 17, 2007 4:59 pm    Post subject: Intel Core2 Duo w/ vmx and KVM/Qemu: info needed Reply with quote

Hi.

I have a Dell Inspiron 9400 with a Core2 Duo and virtualization enabled. I have compiled Gentoo Sources 2.6.21-r2 and added intel-kvm built-in to my kernel configuration.

I'd like to know if Qemu 0.9.0 can take profit from my CPU virtualization capabilities. BTW I am completely lost between KVM and Qemu. I've seen KVM is a program but it's also a kernel module that has been included since 2.6.20.

I've also seen many references between QEMU/KVM in which Qemu is a modified version but every link I've seen shows KVM is independent of Qemu and examples run KVM instead of Qemu :?:

Can anybody clarify this a little bit for me, please?

Here are my questions:
  • What is QEMU/KVM and how do they relate together?
  • Can Qemu use a Core2 Duo virtualization capabilities?
  • Does Qemu have anything to do with kernel module KVM?
  • Can Qemu use kernel module KVM?
  • What target CPU does qemu-system-x86_64 emulate? 32 or 64 bits?
  • Can Qemu on a Core2 Duo emulate a 32-bit CPU?
  • KVM and Xen are often associated in articles on the web. Is KVM for paravirtualization or just virtualization?
The fact is I have run Qemu both with virtualization enabled and disabled and I don't seem to see a difference when I run my W2K virtual machine. There is a windows service, csrss, which constantly consumes CPU (around 5-12%).
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Baribeault
n00b
n00b


Joined: 17 Jun 2007
Posts: 8

PostPosted: Sun Jun 17, 2007 5:21 pm    Post subject: Intel Core2 Duo w/ vmx and KVM/Qemu: info needed Reply with quote

What is QEMU/KVM and how do they relate together?
KVM is a kernel module that add functionaly to QEMU. KVM cannot be without QEMU.

Can Qemu use a Core2 Duo virtualization capabilities?
No. But KVM can with kvm_intel module.

Does Qemu have anything to do with kernel module KVM?
No. But KVM need Qemu for virtualization.

Can Qemu use kernel module KVM?
Yes.

What target CPU does qemu-system-x86_64 emulate? 32 or 64 bits?
It can do both as far I know.

Can Qemu on a Core2 Duo emulate a 32-bit CPU?
Yes.

KVM and Xen are often associated in articles on the web. Is KVM for paravirtualization or just virtualization?
Paravirtualization is in progress for KVM, for now it is just virtualization but soon it will support paravirtualization.

P.S. Don't use the in kernel module, download the most recent KVM source and compile and install. A much better approach because of the speed of KVM development.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Sun Jun 17, 2007 6:32 pm    Post subject: Re: Intel Core2 Duo w/ vmx and KVM/Qemu: info needed Reply with quote

Thanks for your replies. Would you mind going on for further questions?

Baribeault wrote:
Q. What is QEMU/KVM and how do they relate together?
A. KVM is a kernel module that add functionaly to QEMU. KVM cannot be without QEMU.

Q. Does Qemu have anything to do with kernel module KVM?
A. No. But KVM need Qemu for virtualization.

So if I understand when I run qemu or qemu-system-x86_64 I get only emulation, not virtualization, even with -kernel-kqemu? In fact I thought kqemu (qemu kernel module) would add virtualization, hence faster than using qemu alone... I suppose I'm wrong? To be clear, Qemu+KQemu doesn't do virtualization, just emulation, is that correct?

EDIT: As per Fabrice Bellard's documentation, Qemu+KQemu provides full virtualization.

Baribeault wrote:
Q. Can Qemu use a Core2 Duo virtualization capabilities?
A. No. But KVM can with kvm_intel module.

Fine, I have KVM_INTEL enabled in my kernel. But since KVM is just a module, how can it do virtualization - I mean through what means? I suppose it's Qemu? Is there a special flavor of Qemu that uses kvm_intel? If yes where can I find it?

Note I've seen that QEMU/KQEMU and KVM/QEMU have almost the same performance figures. Is there an advantage to using KVM/Qemu over Qemu/KQemu?

Baribeault wrote:
Q. Can Qemu use kernel module KVM?
A. Yes.

So... how? :-)

Baribeault wrote:
Q. What target CPU does qemu-system-x86_64 emulate? 32 or 64 bits?
A. It can do both as far I know.

Q. Can Qemu on a Core2 Duo emulate a 32-bit CPU?
A. Yes.

Same question then: how? Is qemu for 32-bit emulation and qemu-system-x86_64 for 64-bit? BTW I'd like virtualization, not emulation; will I be able to have a virtual machine with a 32-bit guest CPU running on my 64-bit host CPU?

Baribeault wrote:
Q. KVM and Xen are often associated in articles on the web. Is KVM for paravirtualization or just virtualization?
A. Paravirtualization is in progress for KVM, for now it is just virtualization but soon it will support paravirtualization.

Fair enough for I don't need paravirtualization now, I think.

Baribeault wrote:
P.S. Don't use the in kernel module, download the most recent KVM source and compile and install. A much better approach because of the speed of KVM development.

I s'pose it involves using an overlay? Is there an overlay I can use or should I write my own ebuild from scratch?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!


Last edited by VinzC on Sun Jun 17, 2007 8:39 pm; edited 2 times in total
Back to top
View user's profile Send private message
Jjeje007
Tux's lil' helper
Tux's lil' helper


Joined: 29 Sep 2006
Posts: 142
Location: France, La Croix Valmer

PostPosted: Sun Jun 17, 2007 6:33 pm    Post subject: Reply with quote

Hi,

kvm user space ebuild (work in progress) :

https://bugs.gentoo.org/show_bug.cgi?id=157987

Jjeje007
Back to top
View user's profile Send private message
rmh3093
Advocate
Advocate


Joined: 06 Aug 2003
Posts: 2138
Location: Albany, NY

PostPosted: Sun Jun 17, 2007 6:57 pm    Post subject: Re: Intel Core2 Duo w/ vmx and KVM/Qemu: info needed Reply with quote

VinzC wrote:
Hi.

I have a Dell Inspiron 9400 with a Core2 Duo and virtualization enabled. I have compiled Gentoo Sources 2.6.21-r2 and added intel-kvm built-in to my kernel configuration.

I'd like to know if Qemu 0.9.0 can take profit from my CPU virtualization capabilities. BTW I am completely lost between KVM and Qemu. I've seen KVM is a program but it's also a kernel module that has been included since 2.6.20.

I've also seen many references between QEMU/KVM in which Qemu is a modified version but every link I've seen shows KVM is independent of Qemu and examples run KVM instead of Qemu :?:

Can anybody clarify this a little bit for me, please?

Here are my questions:
  • What is QEMU/KVM and how do they relate together?
  • Can Qemu use a Core2 Duo virtualization capabilities?
  • Does Qemu have anything to do with kernel module KVM?
  • Can Qemu use kernel module KVM?
  • What target CPU does qemu-system-x86_64 emulate? 32 or 64 bits?
  • Can Qemu on a Core2 Duo emulate a 32-bit CPU?
  • KVM and Xen are often associated in articles on the web. Is KVM for paravirtualization or just virtualization?
The fact is I have run Qemu both with virtualization enabled and disabled and I don't seem to see a difference when I run my W2K virtual machine. There is a windows service, csrss, which constantly consumes CPU (around 5-12%).


VinzC: KVM (the software) is a port QEMU with support for kernel kvm-modules (which use the vmx instructions).... KVM only exists as a port due to the constant changing they are doing in the software once it settles down they are going to submit a patch to upstream qemu development

so better emerge -Q qemu if you are going to install kvm because kvm installs a binary called qemu ;)

EDIT: KVM works with paravirt and fullvirt... however, to use paravirt the OS needs to be aware is being run as a guest OS, linux on linux paravirt will work with KVM but not windows on linux paravirt
_________________
Do not meddle in the affairs of wizards, for they are subtle and quick to anger.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Sun Jun 17, 2007 8:01 pm    Post subject: Reply with quote

Thanks for your lights rmh3093.

I think I understood Windows could run under paravirtualized environment provided the CPU had virtualization abilities (like vmx for Intel). I thought that as soon as one had such a CPU Windows + Paravirtualization was possible, is that correct? Unless it means only KVM is not ready for running Windows under paravirtualization but Xen is? Erm... is Xen ready for that BTW?
_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
Bones
n00b
n00b


Joined: 07 Dec 2002
Posts: 31

PostPosted: Sun Jun 17, 2007 10:47 pm    Post subject: Reply with quote

Paravirtualization requires a guest kernel that is aware that it is running in a virtualized environment, and can use the paravirt interface of the host kernel. So the question should be "Is Windows ready to run as a paravirtualized guest on KVM?" And the answer is no. But it can be run as a normal, fully virtualized guest.

I recommend compiling the KVM userspace and kernel module from the source tarball. The kernel module included in 2.6.22 doesn't have the recent performance enhancements, which make a very large difference.
_________________
I have a computer.
Back to top
View user's profile Send private message
rmh3093
Advocate
Advocate


Joined: 06 Aug 2003
Posts: 2138
Location: Albany, NY

PostPosted: Mon Jun 18, 2007 3:36 am    Post subject: Reply with quote

VinzC wrote:
Thanks for your lights rmh3093.

I think I understood Windows could run under paravirtualized environment provided the CPU had virtualization abilities (like vmx for Intel). I thought that as soon as one had such a CPU Windows + Paravirtualization was possible, is that correct? Unless it means only KVM is not ready for running Windows under paravirtualization but Xen is? Erm... is Xen ready for that BTW?


I think one of the server versions of Vista is licensed to be virtualized and has its own supervisor.... I do not think there is a linux supervisor that is compatible with that yet.... which means no paravirt windows at the moment only fullvirt
_________________
Do not meddle in the affairs of wizards, for they are subtle and quick to anger.
Back to top
View user's profile Send private message
tomekki
n00b
n00b


Joined: 29 May 2007
Posts: 40

PostPosted: Mon Jun 18, 2007 6:06 pm    Post subject: Reply with quote

Hi,
your answers brought some light in the dark for me as well.
I have a question of my own. Is it possible to run kvm with kernel support by kqemu?
I managed to run kvm, but I am not sure whether the ring 0 operations are managed by the kqemu kernel module or not. It follows what I tried so far.

First I compiled a kernel with kvm support, then I emerged and loaded kqemu-1.3.0_pre11:
Code:
duo ~ # lsmod
Module                  Size  Used by
kvm_intel              20108  0
kvm                    57708  1 kvm_intel
kqemu                 161576  0


After this I downloaded kvm-28 and performed the following:
Code:

duo kvm-28 # ./configure --prefix=/opt/kvm --with-patched-kernel
Install prefix    /opt/kvm
BIOS directory    /opt/kvm/share/qemu
binary directory  /opt/kvm/bin
Manual directory  /opt/kvm/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /opt/kvm/kvm-28/qemu
C compiler        /usr/bin/gcc-3.4.6
Host C compiler   gcc
make              make
install           install
host CPU          x86_64
host big endian   no
target list       x86_64-softmmu
gprof enabled     no
profiler          no
static build      no
SDL support       yes
SDL static link   yes
mingw32 support   no
Adlib support     no
CoreAudio support no
ALSA support      yes
DSound support    no
FMOD support      no
kqemu support     no
kvm support       yes
Documentation     yes
duo kvm-28 # make   
duo kvm-28 # make install 
duo kvm-28 # /opt/kvm/bin/qemu-system-x86_64 -hda /opt/50GB.img -cdrom /opt/windows-xen/WindowsXP.iso -boot c -m 512


It concerns me that the configure script shows that kqemu support is not enabled.
Code:

kqemu support     no

Or do you think I should just wait a while longer until the ebuild is done?

Greetings, Tomekki
Back to top
View user's profile Send private message
Bones
n00b
n00b


Joined: 07 Dec 2002
Posts: 31

PostPosted: Mon Jun 18, 2007 6:22 pm    Post subject: Reply with quote

KVM has nothing to do with kqemu. The KVM module completely replaces it, that's why support for kqemu is not in KVM's version of QEMU.
_________________
I have a computer.
Back to top
View user's profile Send private message
tomekki
n00b
n00b


Joined: 29 May 2007
Posts: 40

PostPosted: Tue Jun 19, 2007 7:25 am    Post subject: Reply with quote

Got it, thanks for your answer.

The explanation form http://kvm.qumranet.com/kvmwiki just confused me:
Quote:
KVM also requires a modified QEMU [...]


Greetings, Tomek
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue Jun 19, 2007 6:06 pm    Post subject: Reply with quote

tomekki wrote:
Got it, thanks for your answer.

The explanation form http://kvm.qumranet.com/kvmwiki just confused me:

Quote:
KVM also requires a modified QEMU [...]

I agree with you as it did on me too. I'd have doubtlessly understood if it had been:
Quote:
KVM also includes a modified QEMU [...]

_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
ciphermonk
n00b
n00b


Joined: 25 Jun 2007
Posts: 1
Location: Atlanta

PostPosted: Mon Jun 25, 2007 6:47 pm    Post subject: Reply with quote

From what I've read on LKML, you have to pass the kvm-paravirt=1 boot option to the kernel to enable paravirt under KVM? Is this the case? Once paravirt is enabled in the kernel, do you simply use virt-manager to install the guests?
Back to top
View user's profile Send private message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1217
Location: Motown

PostPosted: Mon Jun 25, 2007 7:19 pm    Post subject: Re: Intel Core2 Duo w/ vmx and KVM/Qemu: info needed Reply with quote

rmh3093 wrote:
so better emerge -Q qemu

I see no -Q option for emerge in the help or man. I'm guessing it's a typo but I can't figure out what you meant to type.

Chris
_________________
WYSIWYG - What You See Is What You Grep
Back to top
View user's profile Send private message
rmh3093
Advocate
Advocate


Joined: 06 Aug 2003
Posts: 2138
Location: Albany, NY

PostPosted: Mon Jun 25, 2007 7:23 pm    Post subject: Re: Intel Core2 Duo w/ vmx and KVM/Qemu: info needed Reply with quote

darkphader wrote:
rmh3093 wrote:
so better emerge -Q qemu

I see no -Q option for emerge in the help or man. I'm guessing it's a typo but I can't figure out what you meant to type.

Chris


that could have been -C for clean...
_________________
Do not meddle in the affairs of wizards, for they are subtle and quick to anger.
Back to top
View user's profile Send private message
VinzC
Watchman
Watchman


Joined: 17 Apr 2004
Posts: 5098
Location: Dark side of the mood

PostPosted: Tue Jun 26, 2007 8:30 am    Post subject: Re: Intel Core2 Duo w/ vmx and KVM/Qemu: info needed Reply with quote

rmh3093 wrote:
darkphader wrote:
rmh3093 wrote:
so better emerge -Q qemu

I see no -Q option for emerge in the help or man. I'm guessing it's a typo but I can't figure out what you meant to type.

Chris


that could have been -C for clean...

We had already rectified that in our mind ;-) .

EDIT: BTW rmh3093 is an active member of the Q-Collective. Didn't you ever heard of portage Q-lean feature? ;)
cat /etc/make.conf:
...
FEATURES="parallel-fetch ccache Q"
...

_________________
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739!
Back to top
View user's profile Send private message
tomekki
n00b
n00b


Joined: 29 May 2007
Posts: 40

PostPosted: Wed Jun 27, 2007 2:51 pm    Post subject: Reply with quote

Hi ciphermonk,
where have you red about the kernel parameter?
ciphermonk wrote:
From what I've read on LKML, you have to pass the kvm-paravirt=1 boot option to the kernel to enable paravirt under KVM


Greetings, Tomekki
Back to top
View user's profile Send private message
rmh3093
Advocate
Advocate


Joined: 06 Aug 2003
Posts: 2138
Location: Albany, NY

PostPosted: Wed Jun 27, 2007 6:59 pm    Post subject: Reply with quote

tomekki wrote:
Hi ciphermonk,
where have you red about the kernel parameter?
ciphermonk wrote:
From what I've read on LKML, you have to pass the kvm-paravirt=1 boot option to the kernel to enable paravirt under KVM


Greetings, Tomekki


if you build paravirt and kvm into the kernel your will see a message about that option in dmesg
_________________
Do not meddle in the affairs of wizards, for they are subtle and quick to anger.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum