WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-4.0-testing] x86_emulate: Emulate CLFLUSH instructi

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] x86_emulate: Emulate CLFLUSH instruction
From: "Xen patchbot-4.0-testing" <patchbot-4.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 16 Apr 2010 09:50:17 -0700
Delivery-date: Mon, 19 Apr 2010 07:25:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1271355553 -3600
# Node ID 2b2e7b4e0267ff68b0ce035a493f063974a5e23d
# Parent  065efaec5e7168cd4fcbfbf3203a6a973017e43c
x86_emulate: Emulate CLFLUSH instruction

We recently found that FreeBSD 8.0 guest failed to install and boot on
Xen. The reason was that FreeBSD detected clflush feature and invoked
this instruction to flush MMIO space. This caused a page fault; but
x86_emulate.c failed to emulate this instruction (not supported). As a
result, a page fault was detected inside FreeBSD. A similar issue was
reported earlier.

http://lists.xensource.com/archives/html/xen-devel/2010-03/msg00362.html

From: Wei Huang <wei.huang2@xxxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   21189:d18e6a6c618a
xen-unstable date:        Thu Apr 15 18:47:58 2010 +0100
---
 xen/arch/x86/x86_emulate/x86_emulate.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletion(-)

diff -r 065efaec5e71 -r 2b2e7b4e0267 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c    Thu Apr 15 19:18:49 2010 +0100
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c    Thu Apr 15 19:19:13 2010 +0100
@@ -227,7 +227,8 @@ static uint8_t twobyte_table[256] = {
     DstMem|SrcReg|ModRM, DstMem|SrcReg|ModRM, 0, 0,
     /* 0xA8 - 0xAF */
     ImplicitOps, ImplicitOps, 0, DstBitBase|SrcReg|ModRM,
-    DstMem|SrcReg|ModRM, DstMem|SrcReg|ModRM, 0, DstReg|SrcMem|ModRM,
+    DstMem|SrcReg|ModRM, DstMem|SrcReg|ModRM,
+    ImplicitOps|ModRM, DstReg|SrcMem|ModRM,
     /* 0xB0 - 0xB7 */
     ByteOp|DstMem|SrcReg|ModRM, DstMem|SrcReg|ModRM,
     DstReg|SrcMem|ModRM|Mov, DstBitBase|SrcReg|ModRM,
@@ -4008,6 +4009,19 @@ x86_emulate(
         emulate_2op_SrcV_nobyte("bts", src, dst, _regs.eflags);
         break;
 
+    case 0xae: /* Grp15 */
+        switch ( modrm_reg & 7 )
+        {
+        case 7: /* clflush */
+            fail_if(ops->wbinvd == NULL);
+            if ( (rc = ops->wbinvd(ctxt)) != 0 )
+                goto done;
+            break;
+        default:
+            goto cannot_emulate;
+        }
+        break;
+
     case 0xaf: /* imul */
         _regs.eflags &= ~(EFLG_OF|EFLG_CF);
         switch ( dst.bytes )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] x86_emulate: Emulate CLFLUSH instruction, Xen patchbot-4.0-testing <=