Patchwork scripts/runqemu-internal: use -cpu core2duo for qemux86-64

login
register
mail settings
Submitter Stanacar, StefanX
Date Jan. 28, 2014, 5:16 p.m.
Message ID <1390929399-28383-1-git-send-email-stefanx.stanacar@intel.com>
Download mbox | patch
Permalink /patch/65969/
State Accepted
Commit 9532004b527fdf3a819b8b0e7e64833003a4b1d4
Headers show

Comments

Darren Hart - Jan. 28, 2014, 9:33 a.m.
On Tue, 2014-01-28 at 19:16 +0200, Stefan Stanacar wrote:
> Now that the tune for qemux86-64 changed to core2-64 we need to
> tell the emulator to use a proper CPU model. With the default setting
> of qemu64 we'll get things like:
> 
> root@qemux86-64:~# smart --help
> traps: python[758] trap invalid opcode ip:7f2af01f6be7 sp:7fff49466ef0 error:0 in strop.so[7f2af01f5000+6000]
> Illegal instruction
> 
> If the tune for qemux86 changes, that needs to be updated too.
> 
> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
> ---
>  scripts/runqemu-internal | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
> index e3b0729..0893107 100755
> --- a/scripts/runqemu-internal
> +++ b/scripts/runqemu-internal
> @@ -388,6 +388,7 @@ fi
>  
>  if [ "$MACHINE" = "qemux86-64" ]; then
>      QEMU=qemu-system-x86_64
> +    CPU_SUBTYPE=core2duo

What is it set to by default? Just "" right?

>      if [ ! -z "$vga_option" ]; then
>          QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
>      else
> @@ -395,7 +396,7 @@ if [ "$MACHINE" = "qemux86-64" ]; then
>      fi
>      if [ "${FSTYPE:0:3}" = "ext" -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 -cpu $CPU_SUBTYPE $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"

So what happens here when it is empty? "-cpu ''" ?
Darren Hart - Jan. 28, 2014, 10 a.m.
On Tue, 2014-01-28 at 01:33 -0800, Darren Hart wrote:
> On Tue, 2014-01-28 at 19:16 +0200, Stefan Stanacar wrote:
> > Now that the tune for qemux86-64 changed to core2-64 we need to
> > tell the emulator to use a proper CPU model. With the default setting
> > of qemu64 we'll get things like:
> > 
> > root@qemux86-64:~# smart --help
> > traps: python[758] trap invalid opcode ip:7f2af01f6be7 sp:7fff49466ef0 error:0 in strop.so[7f2af01f5000+6000]
> > Illegal instruction
> > 
> > If the tune for qemux86 changes, that needs to be updated too.
> > 
> > Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>

Nevermind, all the calls below are done in the same if block where the
CPU_SUBTYPE is set. This is fine.

Acked-by: Darren Hart <dvhart@linux.intel.com>


> > ---
> >  scripts/runqemu-internal | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
> > index e3b0729..0893107 100755
> > --- a/scripts/runqemu-internal
> > +++ b/scripts/runqemu-internal
> > @@ -388,6 +388,7 @@ fi
> >  
> >  if [ "$MACHINE" = "qemux86-64" ]; then
> >      QEMU=qemu-system-x86_64
> > +    CPU_SUBTYPE=core2duo
> 
> What is it set to by default? Just "" right?
> 
> >      if [ ! -z "$vga_option" ]; then
> >          QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
> >      else
> > @@ -395,7 +396,7 @@ if [ "$MACHINE" = "qemux86-64" ]; then
> >      fi
> >      if [ "${FSTYPE:0:3}" = "ext" -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 -cpu $CPU_SUBTYPE $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"
> 
> So what happens here when it is empty? "-cpu ''" ?
>
Stanacar, StefanX - Jan. 28, 2014, 5:16 p.m.
Now that the tune for qemux86-64 changed to core2-64 we need to
tell the emulator to use a proper CPU model. With the default setting
of qemu64 we'll get things like:

root@qemux86-64:~# smart --help
traps: python[758] trap invalid opcode ip:7f2af01f6be7 sp:7fff49466ef0 error:0 in strop.so[7f2af01f5000+6000]
Illegal instruction

If the tune for qemux86 changes, that needs to be updated too.

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
---
 scripts/runqemu-internal | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index e3b0729..0893107 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -388,6 +388,7 @@  fi
 
 if [ "$MACHINE" = "qemux86-64" ]; then
     QEMU=qemu-system-x86_64
+    CPU_SUBTYPE=core2duo
     if [ ! -z "$vga_option" ]; then
         QEMU_UI_OPTIONS="$QEMU_UI_OPTIONS"
     else
@@ -395,7 +396,7 @@  if [ "$MACHINE" = "qemux86-64" ]; then
     fi
     if [ "${FSTYPE:0:3}" = "ext" -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 -cpu $CPU_SUBTYPE $ROOTFS_OPTIONS $QEMU_UI_OPTIONS"
     fi
     if [ "$FSTYPE" = "nfs" ]; then
         if [ "x$ROOTFS" = "x" ]; then
@@ -407,10 +408,10 @@  if [ "$MACHINE" = "qemux86-64" ]; then
             return 1
         fi
         KERNCMDLINE="root=/dev/nfs nfsroot=$NFS_SERVER:$NFS_DIR,$UNFS_OPTS rw $KERNEL_NETWORK_CMD mem=$QEMU_MEMORY"
-        QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
+        QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE $QEMU_UI_OPTIONS"
     fi
     if [ "$FSTYPE" = "vmdk" ]; then
-        QEMUOPTIONS="$QEMU_NETWORK_CMD $QEMU_UI_OPTIONS"
+        QEMUOPTIONS="$QEMU_NETWORK_CMD -cpu $CPU_SUBTYPE $QEMU_UI_OPTIONS"
     fi
     # Currently oprofile's event based interrupt mode doesn't work(Bug #828) in
     # qemux86 and qemux86-64. We can use timer interrupt mode for now.