All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] qemu: Enable KVM support on x86/x86-64 host
  2010-12-08  0:54 [PATCH 0/1] enable KVM in poky qemu Zhai Edwin
@ 2010-12-02  7:11 ` Zhai Edwin
  0 siblings, 0 replies; 2+ messages in thread
From: Zhai Edwin @ 2010-12-02  7:11 UTC (permalink / raw)
  To: poky

User need build kvm module for native kernel and install them by "modprobe
kvm_intel". Then add "kvm" option to poky-qemu to enable it.

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
---
 meta/recipes-devtools/qemu/qemu.inc |    2 +-
 scripts/poky-qemu                   |   12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 12ce82f..33c2c71 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -3,7 +3,7 @@ HOMEPAGE = "http://qemu.org"
 LICENSE = "GPLv2 & LGPLv2.1"
 DEPENDS = "zlib"
 
-EXTRA_OECONF = "--target-list=arm-linux-user,arm-softmmu,i386-linux-user,i386-softmmu,x86_64-linux-user,x86_64-softmmu,mips-linux-user,mips-softmmu,ppc-linux-user,ppc-softmmu,mipsel-linux-user --disable-werror --disable-vnc-tls"
+EXTRA_OECONF = "--target-list=arm-linux-user,arm-softmmu,i386-linux-user,i386-softmmu,x86_64-linux-user,x86_64-softmmu,mips-linux-user,mips-softmmu,ppc-linux-user,ppc-softmmu,mipsel-linux-user --disable-werror --disable-vnc-tls --enable-kvm"
 #EXTRA_OECONF += "--disable-sdl"
 
 inherit autotools
diff --git a/scripts/poky-qemu b/scripts/poky-qemu
index bc312e0..05deb81 100755
--- a/scripts/poky-qemu
+++ b/scripts/poky-qemu
@@ -84,6 +84,7 @@ process_filename() {
 
 # Parse command line args without requiring specific ordering. It's a
 # bit more complex, but offers a great user experience.
+KVM_ENABLED="no"
 i=1
 while [ $i -le $# ]; do
     arg=${!i}
@@ -124,6 +125,10 @@ while [ $i -le $# ]; do
             SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -serial stdio"
             SCRIPT_KERNEL_OPT="$SCRIPT_KERNEL_OPT console=ttyS0"
             ;;
+        "kvm")
+            KVM_ENABLED="yes"
+            KVM_CAPABLE=`grep 'vmx\|smx' /proc/cpuinfo`
+            ;;
         *)
             # A directory name is an nfs rootfs
             if [ -d "$arg" ]; then
@@ -152,6 +157,13 @@ while [ $i -le $# ]; do
     i=$((i + 1))
 done
 
+# Detect KVM configuration
+if [[ "x$KVM_ENABLED" == "xyes" && ! -z "$KVM_CAPABLE" ]]; then
+    if [[ "x$MACHINE" == "xqemux86" || "x$MACHINE" == "xqemux86-64" ]]; then
+        SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm"
+    fi
+fi
+
 # Report errors for missing combinations of options
 if [[ -z "$MACHINE" && -z "$KERNEL" ]]; then
     echo "Error: you must specify at least a MACHINE or KERNEL argument"
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 0/1] enable KVM in poky qemu
@ 2010-12-08  0:54 Zhai Edwin
  2010-12-02  7:11 ` [PATCH 1/1] qemu: Enable KVM support on x86/x86-64 host Zhai Edwin
  0 siblings, 1 reply; 2+ messages in thread
From: Zhai Edwin @ 2010-12-08  0:54 UTC (permalink / raw)
  To: poky

Saul,
This patch enables KVM in poky qemu. End user need build and install kvm module
for native linux kernel. I'll write a howto in wiki for this.

Thanks,
edwin


Pull URL: git://git.pokylinux.org/poky-contrib.git
  Branch: gzhai/distro05
  Browse: http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/distro05

Thanks,
    Zhai Edwin <edwin.zhai@intel.com>
---


Zhai Edwin (1):
  qemu: Enable KVM support on x86/x86-64 host

 meta/recipes-devtools/qemu/qemu.inc |    2 +-
 scripts/poky-qemu                   |   12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-08  1:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-08  0:54 [PATCH 0/1] enable KVM in poky qemu Zhai Edwin
2010-12-02  7:11 ` [PATCH 1/1] qemu: Enable KVM support on x86/x86-64 host Zhai Edwin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.