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] Fix a regression in hvm_pio_assist() when booting Window

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix a regression in hvm_pio_assist() when booting Windows
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 05 Apr 2006 19:38:10 +0000
Delivery-date: Wed, 05 Apr 2006 14:29:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 02e8dd5e4c572dac62750ccd7e8dd93829a79e0c
# Parent  ce7746d47f1854281626742de65bdb590d7ad763
Fix a regression in hvm_pio_assist() when booting Windows
on VT-x. Clean up the function also.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r ce7746d47f18 -r 02e8dd5e4c57 xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c     Wed Apr  5 09:54:29 2006
+++ b/xen/arch/x86/hvm/io.c     Wed Apr  5 11:23:49 2006
@@ -365,57 +365,46 @@
     unsigned long old_eax;
     int sign = p->df ? -1 : 1;
 
-    if (p->pdata_valid || (mmio_opp->flags & OVERLAP)) {
-        if (mmio_opp->flags & REPZ)
+    if ( p->pdata_valid || (mmio_opp->flags & OVERLAP) )
+    {
+        if ( mmio_opp->flags & REPZ )
             regs->ecx -= p->count;
-        if (p->dir == IOREQ_READ) {
+        if ( p->dir == IOREQ_READ )
+        {
             regs->edi += sign * p->count * p->size;
-
-            if (mmio_opp->flags & OVERLAP) {
-                /* 
-                 * If we are doing in IN and it's overlapping a page boundary, 
-                 * we need to copy the data back to user's page with hvm_copy. 
-                 * Note that overlap * can only be set with paging enabled, so 
-                 * we don't need to worry about * real-mode stuff.  
-                 */
-                unsigned long addr;
-                {
-                    /* 
-                    * We completely ignore segment registers here - 
-                     * it's not a good idea. We also may use upper bits
-                     * in edi when in 16-bit real/protected mode.
-                     * We really need to get the actual address back from
-                     * the arch-dependant HVM portion.
-                     */
-                    struct vcpu *v = current;
-                    if (hvm_realmode(v))
-                        __hvm_bug(regs);
-                }
-                addr = regs->edi;
+            if ( mmio_opp->flags & OVERLAP )
+            {
+                unsigned long addr = regs->edi;
+                if (hvm_realmode(current))
+                    addr += regs->es << 4;
                 if (sign > 0)
                     addr -= p->size;
                 hvm_copy(&p->u.data, addr, p->size, HVM_COPY_OUT);
             }
-        } else
+        }
+        else /* p->dir == IOREQ_WRITE */
+        {
+            ASSERT(p->dir == IOREQ_WRITE);
             regs->esi += sign * p->count * p->size;
-
-    } else {
-        if (p->dir == IOREQ_READ) {
-            old_eax = regs->eax;
-            switch (p->size) {
-            case 1:
-                regs->eax = (old_eax & 0xffffff00) | (p->u.data & 0xff);
-                break;
-            case 2:
-                regs->eax = (old_eax & 0xffff0000) | (p->u.data & 0xffff);
-                break;
-            case 4:
-                regs->eax = (p->u.data & 0xffffffff);
-                break;
-            default:
-                printk("Error: %s unknown port size\n", __FUNCTION__);
-                domain_crash_synchronous();
-            }
+        }
+    }
+    else if ( p->dir == IOREQ_READ )
+    {
+        old_eax = regs->eax;
+        switch ( p->size )
+        {
+        case 1:
+            regs->eax = (old_eax & 0xffffff00) | (p->u.data & 0xff);
+            break;
+        case 2:
+            regs->eax = (old_eax & 0xffff0000) | (p->u.data & 0xffff);
+            break;
+        case 4:
+            regs->eax = (p->u.data & 0xffffffff);
+            break;
+        default:
+            printk("Error: %s unknown port size\n", __FUNCTION__);
+            domain_crash_synchronous();
         }
     }
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix a regression in hvm_pio_assist() when booting Windows, Xen patchbot -unstable <=