Patchwork qemu: use default qemu CPU definition

login
register
mail settings
Submitter Alexandru DAMIAN
Date April 9, 2013, 2:46 p.m.
Message ID <1365518803-11025-1-git-send-email-alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/47721/
State New
Headers show

Comments

Alexandru DAMIAN - April 9, 2013, 2:46 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

This fixes guest crashes when trying to use restricted
instructions based on CPU description. Using default qemu
CPU descriptions restrict faults on using restricted
model-specific registers.

[YOCTO #3908]

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
---
 scripts/runqemu          |    2 +-
 scripts/runqemu-internal |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/scripts/runqemu b/scripts/runqemu
index 8ed1226..43d7600 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -261,7 +261,7 @@  if [ "x$KVM_ENABLED" = "xyes" ]; then
         exit 1;
     fi
     if [ -w /dev/kvm -a -r /dev/kvm ]; then
-        SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm -cpu host"
+        SCRIPT_QEMU_OPT="$SCRIPT_QEMU_OPT -enable-kvm "
         KVM_ACTIVE="yes"
     else
         echo "You have no rights on /dev/kvm."
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index e8191d1..a7813e5 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -323,10 +323,11 @@  fi
 
 if [ "$MACHINE" = "qemux86" ]; then
     QEMU=qemu-system-i386
+    QEMU_CPU_OPTIONS="-cpu qemu32"
     QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -vga vmware"
     if [ "$FSTYPE" = "ext2" -o "$FSTYPE" = "ext3" -o "$FSTYPE" = "btrfs" ]; then
         KERNCMDLINE="vga=0 uvesafb.mode_option=640x480-32 root=$DROOT rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD"
-        QEMUOPTIONS="$QEMU_NETWORK_CMD $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"
+        QEMUOPTIONS="$QEMU_NETWORK_CMD $ROOTFS_OPTIONS $QEMU_CPU_OPTIONS $QEMU_UI_OPTIONS"
     fi
     if [ "$FSTYPE" = "nfs" ]; then
         if [ "$NFS_SERVER" = "192.168.7.1" -a ! -d "$NFS_DIR" ]; then
@@ -347,10 +348,11 @@  fi
 
 if [ "$MACHINE" = "qemux86-64" ]; then
     QEMU=qemu-system-x86_64
+    QEMU_CPU_OPTIONS="-cpu qemu64"
     QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS -vga vmware"
     if [ "$FSTYPE" = "ext3" -o "$FSTYPE" = "btrfs" ]; then
         KERNCMDLINE="vga=0 root=$DROOT rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD"
-        QEMUOPTIONS="$QEMU_NETWORK_CMD $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"
+        QEMUOPTIONS="$QEMU_NETWORK_CMD $ROOTFS_OPTIONS $QEMU_CPU_OPTIONS $QEMU_UI_OPTIONS"
     fi
     if [ "$FSTYPE" = "nfs" ]; then
         if [ "x$ROOTFS" = "x" ]; then