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] VMX: bad PIO/MMIO effective address computations

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] VMX: bad PIO/MMIO effective address computations
From: Leendert van Doorn <leendert@xxxxxxxxxxxxxx>
Date: Mon, 23 May 2005 04:00:12 -0400
Delivery-date: Mon, 23 May 2005 08:30:27 +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>
Organization: IBM T.J. Watson Research Center
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The PIO/MMIO effective address computations in VMX for partitions running
in VM8086 mode are wrong. This bug prevented FreeDOS and Lilo to work under
VMX. The following patches fix this.

        Leendert

Signed-Off-By: Leendert van Doorn <leendert@xxxxxxxxxxxxxx>

diff --exclude=BitKeeper -ru xeno-unstable.orig/xen/arch/x86/vmx.c 
xeno-unstable.latest/xen/arch/x86/vmx.c
--- xeno-unstable.orig/xen/arch/x86/vmx.c       2005-05-22 22:54:41.000000000 
-0400
+++ xeno-unstable.latest/xen/arch/x86/vmx.c     2005-05-23 03:40:57.000000000 
-0400
@@ -366,11 +366,11 @@
             if (p->dir == IOREQ_WRITE) {
                 __vmread(GUEST_DS_SELECTOR, &seg);
                 p->u.pdata = (void *)
-                        ((seg << 4) | (regs->esi & 0xFFFF));
+                        ((seg << 4) + (regs->esi & 0xFFFF));
             } else {
                 __vmread(GUEST_ES_SELECTOR, &seg);
                 p->u.pdata = (void *)
-                        ((seg << 4) | (regs->edi & 0xFFFF));
+                        ((seg << 4) + (regs->edi & 0xFFFF));
             }
         } else {
                p->u.pdata = (void *) ((p->dir == IOREQ_WRITE) ?
@@ -378,7 +378,6 @@
         }
         p->u.pdata = (void *) gva_to_gpa(p->u.data);
 
-
         if (test_bit(5, &exit_qualification))
            p->count = vm86 ? regs->ecx & 0xFFFF : regs->ecx;
         if ((p->u.data & PAGE_MASK) != 
diff --exclude=BitKeeper -ru xeno-unstable.orig/xen/arch/x86/vmx_platform.c 
xeno-unstable.latest/xen/arch/x86/vmx_platform.c
--- xeno-unstable.orig/xen/arch/x86/vmx_platform.c      2005-05-19 
23:15:49.000000000 -0400
+++ xeno-unstable.latest/xen/arch/x86/vmx_platform.c    2005-05-23 
03:43:05.000000000 -0400
@@ -544,7 +544,7 @@
 
     if (vm86) {
         __vmread(GUEST_CS_SELECTOR, &cs);
-        inst_addr = (cs << 4) | eip;
+        inst_addr = (cs << 4) + eip;
     } else
         inst_addr = eip; /* XXX should really look at GDT[cs].base too */
 
@@ -592,13 +592,13 @@
            unsigned long seg;
 
            __vmread(GUEST_ES_SELECTOR, &seg);
-           if (((seg << 4) | (inst_decoder_regs->edi & 0xFFFF)) == va) {
+           if (((seg << 4) + (inst_decoder_regs->edi & 0xFFFF)) == va) {
                dir = IOREQ_WRITE;
                __vmread(GUEST_DS_SELECTOR, &seg);
-               addr = (seg << 4) | (inst_decoder_regs->esi & 0xFFFF);
+               addr = (seg << 4) + (inst_decoder_regs->esi & 0xFFFF);
            } else {
                dir = IOREQ_READ;
-               addr = (seg << 4) | (inst_decoder_regs->edi & 0xFFFF);
+               addr = (seg << 4) + (inst_decoder_regs->edi & 0xFFFF);
            }
        } else { /* XXX should really look at GDT[ds/es].base too */
            if (va == inst_decoder_regs->edi) {


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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] VMX: bad PIO/MMIO effective address computations, Leendert van Doorn <=