<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>5956</bug_id>
          
          <creation_ts>2014-03-13 01:34:30 +0000</creation_ts>
          <short_desc>linux-yocto cant boot in qemu when cpu=host</short_desc>
          <delta_ts>2014-04-02 10:10:36 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Kernel</product>
          <component>linux-yocto</component>
          <version>1.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.6</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Khem Raj">raj.khem</reporter>
          <assigned_to name="Stefan Stanacar">sstncr</assigned_to>
          <cc>sgw</cc>
    
    <cc>sstncr</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>41152</commentid>
    <comment_count>0</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2014-03-13 01:34:30 +0000</bug_when>
    <thetext>This bug is actually same for which we did a workaround in bug #3908 this time the problem happens when I try to boot the virtual appliance .vmdk image in virtualbox. Unfortunately virtualbox does not have options to change cpu emulation like qemu-kvm. This issue is still present in current 3.10.x linux-yocto. We need to resolve it properly, since normal upstream kernels are able
to boot normally in virtualbox its a bug in linux-yocto. To reproduce it

apply this patch

--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -398,7 +398,7 @@ fi
 if [ &quot;$MACHINE&quot; = &quot;qemux86-64&quot; ]; then
     QEMU=qemu-system-x86_64
     if [ &quot;$KVM_ACTIVE&quot; = &quot;yes&quot; ]; then
-        CPU_SUBTYPE=kvm64
+        CPU_SUBTYPE=host
     else
         CPU_SUBTYPE=core2duo
     fi

and then

runqemu qemux86-64 kvm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41951</commentid>
    <comment_count>1</comment_count>
    <who name="Stefan Stanacar">sstncr</who>
    <bug_when>2014-03-31 11:49:39 +0000</bug_when>
    <thetext>I think that the right fix to use -cpu host is to include paravirt kernel config for qemux86-64. (this isn&apos;t needed for -cpu kvm64 as it is now)
Note that it is enabled for qemux86 but not for x86-64.
The is what we currently have in linux-yocto-3.10.bb:
KERNEL_FEATURES_append_qemux86=&quot; cfg/sound.scc cfg/paravirt_kvm.scc&quot;
KERNEL_FEATURES_append_qemux86-64=&quot; cfg/sound.scc&quot;

That change has been inherited from recipe to recipe since:

http://git.yoctoproject.org/cgit.cgi/poky/commit/meta/recipes-kernel/linux/linux-yocto_3.4.bb?id=e6149ec6c4c14d3a939022cdc29ac94dced836dd

The reason for that commit was that on AB some qemux86-64 failed to shutdown because of the old host kernel. But that&apos;s more than a year old commit, and the ABs are now on newer kernels.
So if we want kvm and -cpu host on a host with kernel &gt;=3.8 we should enable that config back.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41974</commentid>
    <comment_count>2</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2014-03-31 17:30:50 +0000</bug_when>
    <thetext>No objection from me. Have you tested a change? Could you do so and submit a patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42016</commentid>
    <comment_count>3</comment_count>
    <who name="Stefan Stanacar">sstncr</who>
    <bug_when>2014-04-01 10:02:58 +0000</bug_when>
    <thetext>Patch sent - tested that the image behaves good
  - without kvm
  - with kvm (and the default cpu=kvm64) and
  - with kvm and Khem&apos;s change to runqemu (cpu=host)

Have a look on the ML. Btw, I&apos;ve sent the change for the new linux-yocto-3.14 only, if that matters to anyone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42137</commentid>
    <comment_count>4</comment_count>
    <who name="Stefan Stanacar">sstncr</who>
    <bug_when>2014-04-02 10:10:36 +0000</bug_when>
    <thetext>Merged in master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=02e455f90fbe34e3679fefb9ddc53a3ecad68322</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>