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] Fix qemu IDE interrupt lost issue

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Fix qemu IDE interrupt lost issue
From: "Yu, Ke" <ke.yu@xxxxxxxxx>
Date: Tue, 29 Nov 2005 11:24:38 +0800
Delivery-date: Tue, 29 Nov 2005 03:24: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
Thread-index: AcX0jZ8wKntC7m0rQIG5qs38BU9ADAABb0Tg
Thread-topic: [PATCH] Fix qemu IDE interrupt lost issue
Fix a racing condition in multi-thread qemu dma, which cause guest ide
interrupt lost.

Signed-off-by: Ke Yu <ke.yu@xxxxxxxxx>

# HG changeset patch
# User ke.yu@xxxxxxxxx
# Node ID 2d698a2fd63b609e782285cf30e2b29f5cfc8dd3
# Parent  243265ade4045314ee4170436cc704afafda54cf

This patch fix a racing condition for multi-thread qemu dma.

phenomena: vmx guest linux show warning "dma interrupt lost" and dma
become very slow

root cause: In the time between set ide irq and set dma status, if guest
receive the irq and query the status, it will find the status is not
ready and therefore treat it as pseudo interrupt. Change the order of
set irq and set dma status will fix this issue.

Signoff-by Yu,Ke <ke.yu@xxxxxxxxx>

diff -r 243265ade404 -r 2d698a2fd63b tools/ioemu/hw/ide.c
--- a/tools/ioemu/hw/ide.c      Mon Nov 28 17:22:02 2005 +0000
+++ b/tools/ioemu/hw/ide.c      Tue Nov 29 10:12:17 2005 +0800
@@ -669,6 +669,8 @@
     }
     if (s->io_buffer_index >= s->io_buffer_size && s->nsector == 0) {
         s->status = READY_STAT | SEEK_STAT;
+        s->bmdma->status &= ~BM_STATUS_DMAING;
+        s->bmdma->status |= BM_STATUS_INT;
         ide_set_irq(s);
 #ifdef DEBUG_IDE_ATAPI
         printf("dma status=0x%x\n", s->status);
@@ -736,6 +738,8 @@
             if (n == 0) {
                 /* end of transfer */
                 s->status = READY_STAT | SEEK_STAT;
+                s->bmdma->status &= ~BM_STATUS_DMAING;
+                s->bmdma->status |= BM_STATUS_INT;
                 ide_set_irq(s);
                 return 0;
             }
@@ -983,6 +987,8 @@
     if (s->packet_transfer_size <= 0) {
         s->status = READY_STAT;
         s->nsector = (s->nsector & ~7) | ATAPI_INT_REASON_IO |
ATAPI_INT_REASON_CD;
+        s->bmdma->status &= ~BM_STATUS_DMAING;
+        s->bmdma->status |= BM_STATUS_INT;
         ide_set_irq(s);
 #ifdef DEBUG_IDE_ATAPI
         printf("dma status=0x%x\n", s->status);
@@ -2065,8 +2071,6 @@
     }
     /* end of transfer */
  the_end:
-    bm->status &= ~BM_STATUS_DMAING;
-    bm->status |= BM_STATUS_INT;
     bm->dma_cb = NULL;
     bm->ide_if = NULL;
 }

Attachment: ide_interrupt.patch
Description: ide_interrupt.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix qemu IDE interrupt lost issue, Yu, Ke <=