aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-05 16:04:33 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-05 16:04:33 +0000
commit7ba1e61953f4592606e60b2e7507ff6a6faf861a (patch)
tree9a7e55d78062271b6c9e1e5aa01bcbb2eab4b6ef /exec.c
parent6fd805e1d45308d156469562bc6fd6d1e8d92360 (diff)
downloadqemu-7ba1e61953f4592606e60b2e7507ff6a6faf861a.zip
qemu-7ba1e61953f4592606e60b2e7507ff6a6faf861a.tar.gz
qemu-7ba1e61953f4592606e60b2e7507ff6a6faf861a.tar.bz2
Add KVM support to QEMU
This patch adds very basic KVM support. KVM is a kernel module for Linux that allows userspace programs to make use of hardware virtualization support. It current supports x86 hardware virtualization using Intel VT-x or AMD-V. It also supports IA64 VT-i, PPC 440, and S390. This patch only implements the bare minimum support to get a guest booting. It has very little impact the rest of QEMU and attempts to integrate nicely with the rest of QEMU. Even though this implementation is basic, it is significantly faster than TCG. Booting and shutting down a Linux guest: w/TCG: 1:32.36 elapsed 84% CPU w/KVM: 0:31.14 elapsed 59% CPU Right now, KVM is disabled by default and must be explicitly enabled with -enable-kvm. We can enable it by default later when we have had better testing. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5627 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 697a19e..ef1072b 100644
--- a/exec.c
+++ b/exec.c
@@ -39,6 +39,7 @@
#include "tcg.h"
#include "hw/hw.h"
#include "osdep.h"
+#include "kvm.h"
#if defined(CONFIG_USER_ONLY)
#include <qemu.h>
#endif
@@ -2212,6 +2213,9 @@ void cpu_register_physical_memory(target_phys_addr_t start_addr,
kqemu_set_phys_mem(start_addr, size, phys_offset);
}
#endif
+ if (kvm_enabled())
+ kvm_set_phys_mem(start_addr, size, phys_offset);
+
size = (size + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK;
end_addr = start_addr + (target_phys_addr_t)size;
for(addr = start_addr; addr != end_addr; addr += TARGET_PAGE_SIZE) {