<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1627275761;
        mso-list-type:hybrid;
        mso-list-template-ids:-1053524458 -1531793800 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:1.25in;
        text-indent:-.25in;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi Alex,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">See my comments below.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Cristian<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> Damian, Alexandru [mailto:alexandru.damian@intel.com]
<br>
<b>Sent:</b> Monday, April 15, 2013 3:31 PM<br>
<b>To:</b> Iorga, Cristian<br>
<b>Cc:</b> richard.purdie@linuxfoundation.org; tom.zanussi@linux.intel.com; Burton, Ross; paul.eggleton@linux.intel.com; openembedded-core@lists.openembedded.org<br>
<b>Subject:</b> Re: [OE-core] [PATCH] qemu: use default qemu CPU definition<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">Hi Cristian,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Please do post comments on patch on the mailing list.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Regarding the message itself, quoted below, I am addressing your specific concerns.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">- There is no performance impact between &quot;qemu64&quot; and &quot;host&quot; CPU options. The only thing changing is the level of private instructions that the kernel will attempt - which should be clearly restricted to &quot;qemu64&quot; and not &quot;host&quot; since we
 build Yocto for the &quot;qemu&quot; machine.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Agree.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">- I agree that there is an underlying problem in the kernel, but that is not our primary concern, see no 1. It might be our concern if we'd build for a specific BSP which showed the problem, but as it stands, it's KVM folk's concern. Funny
 enough, they know about the problem (I tracked on their mailing list), but they don't have a fix since it runs as it's designed right now - that is, the faulty&nbsp;behavior&nbsp;is a result of how it should work with the current design.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I don’t know the problems exactly in this case, but:<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.25in;text-indent:-.25in;mso-list:l0 level1 lfo1">
<![if !supportLists]><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I suggested that the differences between how this issue is reproducible or not of different host kernels is strange, and I fail to see the logical
 connection between your patch and the aforementioned behaviors. Can you please provide an explanation?<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:1.25in;text-indent:-.25in;mso-list:l0 level1 lfo1">
<![if !supportLists]><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">It is also strange that this issue is reproducible only on qemux86-64 and not on qemux86 (qemux86 also exports CPU of the VM as host CPU), which suggests
 a different root cause.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">I still recommend merging this patch since it fixes the problem with the right fix.<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:1.25in;text-indent:-.25in;mso-list:l0 level1 lfo1">
<![if !supportLists]><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">That’s a fix, but is it the right one, given my previous observations?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Also, may I remind you that this a regression?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">This issue was not present with the same kernel, on the same distro and it is not present on qemux86 VMs.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Alex&nbsp;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">Original message:<o:p></o:p></p>
</div>
<div>
<pre style="white-space:pre-wrap"><span style="color:black">Hi Alex,<o:p></o:p></span></pre>
<pre><span style="color:black">I might be wrong, and I need more time to investigate, but I don't agree with the fix you proposed for this issue.<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p>&nbsp;</o:p></span></pre>
<pre><span style="color:black">What you propose is just a step back from how qemu should optimally work, meaning exporting &quot;-cpu host&quot;.<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p>&nbsp;</o:p></span></pre>
<pre><span style="color:black">That's one thing.<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p>&nbsp;</o:p></span></pre>
<pre><span style="color:black">Another thing is the described issue seems to be specific to some kernels on the host.<o:p></o:p></span></pre>
<pre><span style="color:black">For example, I checked with LaurP and AlexG and thes issue is:<o:p></o:p></span></pre>
<pre><span style="color:black">- reproducible on Ubuntu 12.10 with kernel 3.5.0.27 and Fedora Core 18 with kernel 3.8.5.<o:p></o:p></span></pre>
<pre><span style="color:black">- not reproducible with Ubuntu 12.04 with kernel 3.2.x (need to check the exact details with LaurP).<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p>&nbsp;</o:p></span></pre>
<pre><span style="color:black">This issue needs more investigation.<o:p></o:p></span></pre>
<pre><span style="color:black"><o:p>&nbsp;</o:p></span></pre>
<pre><span style="color:black">Regards,<o:p></o:p></span></pre>
<pre><span style="color:black">Cristian<o:p></o:p></span></pre>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">On Mon, Apr 15, 2013 at 9:58 AM, Iorga, Cristian &lt;<a href="mailto:cristian.iorga@intel.com" target="_blank">cristian.iorga@intel.com</a>&gt; wrote:<o:p></o:p></p>
<p class="MsoNormal">Hi Alex,<br>
<br>
See my comments regarding this patch at:<br>
<a href="https://bugzilla.yoctoproject.org/show_bug.cgi?id=3908" target="_blank">https://bugzilla.yoctoproject.org/show_bug.cgi?id=3908</a><br>
<br>
Regards,<br>
Cristian<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
-----Original Message-----<br>
From: <a href="mailto:openembedded-core-bounces@lists.openembedded.org">openembedded-core-bounces@lists.openembedded.org</a> [mailto:<a href="mailto:openembedded-core-bounces@lists.openembedded.org">openembedded-core-bounces@lists.openembedded.org</a>] On Behalf
 Of Alex DAMIAN<br>
Sent: Tuesday, April 09, 2013 5:47 PM<br>
To: <a href="mailto:richard.purdie@linuxfoundation.org">richard.purdie@linuxfoundation.org</a>;
<a href="mailto:tom.zanussi@linux.intel.com">tom.zanussi@linux.intel.com</a>; Burton, Ross;
<a href="mailto:paul.eggleton@linux.intel.com">paul.eggleton@linux.intel.com</a>;
<a href="mailto:openembedded-core@lists.openembedded.org">openembedded-core@lists.openembedded.org</a><br>
Cc: Damian, Alexandru<br>
Subject: [OE-core] [PATCH] qemu: use default qemu CPU definition<br>
<br>
From: Alexandru DAMIAN &lt;<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>&gt;<br>
<br>
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.<br>
<br>
[YOCTO #3908]<br>
<br>
Signed-off-by: Alexandru DAMIAN &lt;<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>&gt;<br>
---<br>
&nbsp;scripts/runqemu &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp;2 &#43;-<br>
&nbsp;scripts/runqemu-internal | &nbsp; &nbsp;6 &#43;&#43;&#43;&#43;--<br>
&nbsp;2 files changed, 5 insertions(&#43;), 3 deletions(-)<br>
<br>
diff --git a/scripts/runqemu b/scripts/runqemu index 8ed1226..43d7600 100755<br>
--- a/scripts/runqemu<br>
&#43;&#43;&#43; b/scripts/runqemu<br>
@@ -261,7 &#43;261,7 @@ if [ &quot;x$KVM_ENABLED&quot; = &quot;xyes&quot; ]; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit 1;<br>
&nbsp; &nbsp; &nbsp;fi<br>
&nbsp; &nbsp; &nbsp;if [ -w /dev/kvm -a -r /dev/kvm ]; then<br>
- &nbsp; &nbsp; &nbsp; &nbsp;SCRIPT_QEMU_OPT=&quot;$SCRIPT_QEMU_OPT -enable-kvm -cpu host&quot;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;SCRIPT_QEMU_OPT=&quot;$SCRIPT_QEMU_OPT -enable-kvm &quot;<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KVM_ACTIVE=&quot;yes&quot;<br>
&nbsp; &nbsp; &nbsp;else<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;echo &quot;You have no rights on /dev/kvm.&quot;<br>
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal index e8191d1..a7813e5 100755<br>
--- a/scripts/runqemu-internal<br>
&#43;&#43;&#43; b/scripts/runqemu-internal<br>
@@ -323,10 &#43;323,11 @@ fi<br>
<br>
&nbsp;if [ &quot;$MACHINE&quot; = &quot;qemux86&quot; ]; then<br>
&nbsp; &nbsp; &nbsp;QEMU=qemu-system-i386<br>
&#43; &nbsp; &nbsp;QEMU_CPU_OPTIONS=&quot;-cpu qemu32&quot;<br>
&nbsp; &nbsp; &nbsp;QEMU_UI_OPTIONS=&quot;$QEMU_UI_OPTIONS -vga vmware&quot;<br>
&nbsp; &nbsp; &nbsp;if [ &quot;$FSTYPE&quot; = &quot;ext2&quot; -o &quot;$FSTYPE&quot; = &quot;ext3&quot; -o &quot;$FSTYPE&quot; = &quot;btrfs&quot; ]; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KERNCMDLINE=&quot;vga=0 uvesafb.mode_option=640x480-32 root=$DROOT rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD&quot;<br>
- &nbsp; &nbsp; &nbsp; &nbsp;QEMUOPTIONS=&quot;$QEMU_NETWORK_CMD $ROOTFS_OPTIONS $QEMU_UI_OPTIONS&quot;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;QEMUOPTIONS=&quot;$QEMU_NETWORK_CMD $ROOTFS_OPTIONS $QEMU_CPU_OPTIONS $QEMU_UI_OPTIONS&quot;<br>
&nbsp; &nbsp; &nbsp;fi<br>
&nbsp; &nbsp; &nbsp;if [ &quot;$FSTYPE&quot; = &quot;nfs&quot; ]; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if [ &quot;$NFS_SERVER&quot; = &quot;192.168.7.1&quot; -a ! -d &quot;$NFS_DIR&quot; ]; then @@ -347,10 &#43;348,11 @@ fi<br>
<br>
&nbsp;if [ &quot;$MACHINE&quot; = &quot;qemux86-64&quot; ]; then<br>
&nbsp; &nbsp; &nbsp;QEMU=qemu-system-x86_64<br>
&#43; &nbsp; &nbsp;QEMU_CPU_OPTIONS=&quot;-cpu qemu64&quot;<br>
&nbsp; &nbsp; &nbsp;QEMU_UI_OPTIONS=&quot;$QEMU_UI_OPTIONS -vga vmware&quot;<br>
&nbsp; &nbsp; &nbsp;if [ &quot;$FSTYPE&quot; = &quot;ext3&quot; -o &quot;$FSTYPE&quot; = &quot;btrfs&quot; ]; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;KERNCMDLINE=&quot;vga=0 root=$DROOT rw mem=$QEMU_MEMORY $KERNEL_NETWORK_CMD&quot;<br>
- &nbsp; &nbsp; &nbsp; &nbsp;QEMUOPTIONS=&quot;$QEMU_NETWORK_CMD $ROOTFS_OPTIONS $QEMU_UI_OPTIONS&quot;<br>
&#43; &nbsp; &nbsp; &nbsp; &nbsp;QEMUOPTIONS=&quot;$QEMU_NETWORK_CMD $ROOTFS_OPTIONS $QEMU_CPU_OPTIONS $QEMU_UI_OPTIONS&quot;<br>
&nbsp; &nbsp; &nbsp;fi<br>
&nbsp; &nbsp; &nbsp;if [ &quot;$FSTYPE&quot; = &quot;nfs&quot; ]; then<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if [ &quot;x$ROOTFS&quot; = &quot;x&quot; ]; then<br>
--<br>
1.7.10.4<br>
<br>
<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core" target="_blank">http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</div>
</body>
</html>