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-devel

[Xen-devel] [PATCH][5/5] cmpl workaround for mmio regions

To: Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][5/5] cmpl workaround for mmio regions
From: Arun Sharma <arun.sharma@xxxxxxxxx>
Date: Sun, 10 Jul 2005 12:04:24 -0700
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 10 Jul 2005 18:58:32 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
cmpl workaround for mmio regions

Although we don't normally expect a guest to use cmpl against a MMIO region,
this may happen due to bugs. This workaround is needed for 64 bit linux-2.6.

Signed-off-by: Chengyuan Li <chengyuan.li@xxxxxxxxx>
Signed-off-by: Arun Sharma <arun.sharma@xxxxxxxxx>

diff -r b3872674fc9a -r 8b35a59e4a23 xen/arch/x86/vmx_platform.c
--- a/xen/arch/x86/vmx_platform.c       Fri Jul  8 18:06:34 2005
+++ b/xen/arch/x86/vmx_platform.c       Fri Jul  8 18:58:08 2005
@@ -266,7 +266,7 @@
 
     switch(mod) {
         case 0:
-            if (rm == 5) {
+            if (rm == 5 || rm == 4) {
                 if (op16)
                     inst = inst + 2; //disp16, skip 2 bytes
                 else
@@ -363,6 +363,11 @@
     }
 
     switch(*inst) {
+        case 0x81:
+            /* This is only a workaround for cmpl instruction*/
+            strcpy((char *)thread_inst->i_name, "cmp");
+            return DECODE_success;
+
         case 0x88:
             /* mov r8 to m8 */
             thread_inst->op_size = BYTE;
@@ -635,7 +640,6 @@
 
     __vmread(GUEST_RIP, &eip);
     __vmread(INSTRUCTION_LEN, &inst_len);
-
     __vmread(GUEST_RFLAGS, &eflags);
     vm86 = eflags & X86_EFLAGS_VM;
 
@@ -737,6 +741,12 @@
             inst_decoder_regs->eax, IOREQ_WRITE, 0);
         return;
     }
+    /* Workaround for cmp instruction */
+    if (!strncmp((char *)mmio_inst.i_name, "cmp", 3)) {
+        inst_decoder_regs->eflags &= ~X86_EFLAGS_ZF;
+        __vmwrite(GUEST_RFLAGS, inst_decoder_regs->eflags);
+        return;
+    }
 
     domain_crash_synchronous();
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH][5/5] cmpl workaround for mmio regions, Arun Sharma <=