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] HVM patch to add pio IOREQ_WRITE OVERLAP/REPZ support in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] HVM patch to add pio IOREQ_WRITE OVERLAP/REPZ support in hvm io.c
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 04 Apr 2006 19:32:08 +0000
Delivery-date: Tue, 04 Apr 2006 12:33:51 -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 8d08ad8256dff689e04e8b0169c01b669bfa4a12
# Parent  887ff2d1e382e7b0c321b2b4ce8c32dd87a8cfa3
HVM patch to add pio IOREQ_WRITE OVERLAP/REPZ support in hvm io.c
hvm_pio_assist().  Also, cleaned up a bit of duplicate code in the
functions.  Simple guest tests (ide pio) pass now for overlapped/rep
write operations.

Signed-off-by: Tom Woller <thomas.woller@xxxxxxx>
Signed-off-by: Mats Petersson <mats.petersson@xxxxxxx>

diff -r 887ff2d1e382 -r 8d08ad8256df xen/arch/x86/hvm/io.c
--- a/xen/arch/x86/hvm/io.c     Tue Apr  4 14:00:41 2006
+++ b/xen/arch/x86/hvm/io.c     Tue Apr  4 14:05:17 2006
@@ -365,29 +365,42 @@
     unsigned long old_eax;
     int sign = p->df ? -1 : 1;
 
-    if (p->dir == IOREQ_WRITE) {
-        if (p->pdata_valid) {
+    if (p->pdata_valid || (mmio_opp->flags & OVERLAP)) {
+        if (mmio_opp->flags & REPZ)
+            regs->ecx -= p->count;
+        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 (sign > 0)
+                    addr -= p->size;
+                hvm_copy(&p->u.data, addr, p->size, HVM_COPY_OUT);
+            }
+        } else
             regs->esi += sign * p->count * p->size;
-            if (mmio_opp->flags & REPZ)
-                regs->ecx -= p->count;
-        }
+
     } else {
-        if (mmio_opp->flags & OVERLAP) {
-            unsigned long addr;
-
-            regs->edi += sign * p->count * p->size;
-            if (mmio_opp->flags & REPZ)
-                regs->ecx -= p->count;
-
-            addr = regs->edi;
-            if (sign > 0)
-                addr -= p->size;
-            hvm_copy(&p->u.data, addr, p->size, HVM_COPY_OUT);
-        } else if (p->pdata_valid) {
-            regs->edi += sign * p->count * p->size;
-            if (mmio_opp->flags & REPZ)
-                regs->ecx -= p->count;
-        } else {
+        if (p->dir == IOREQ_READ) {
             old_eax = regs->eax;
             switch (p->size) {
             case 1:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] HVM patch to add pio IOREQ_WRITE OVERLAP/REPZ support in hvm io.c, Xen patchbot -unstable <=