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] [xen-unstable] ioemu: Fix rtl8139 emulation so that rebo

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] ioemu: Fix rtl8139 emulation so that reboot works correctly in 64-bit
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 09 Apr 2008 09:10:16 -0700
Delivery-date: Wed, 09 Apr 2008 09:10:20 -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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1207753420 -3600
# Node ID 40c0dda6eae68ec1bbd3bfd3e812d8b9e34051a0
# Parent  70ebf23f8a43000960ca62262941e8207da59369
ioemu: Fix rtl8139 emulation so that reboot works correctly in 64-bit
Windows VMs. Return an error if the guest OS tries to transmit a
packet with the transmitter disabled, so that it doesn't spin forever
waiting for it to complete.

Signed-off-by: Steven Smith <Steven.Smith@xxxxxxxxxxxxx>
---
 tools/ioemu/hw/rtl8139.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+)

diff -r 70ebf23f8a43 -r 40c0dda6eae6 tools/ioemu/hw/rtl8139.c
--- a/tools/ioemu/hw/rtl8139.c  Wed Apr 09 16:02:49 2008 +0100
+++ b/tools/ioemu/hw/rtl8139.c  Wed Apr 09 16:03:40 2008 +0100
@@ -1416,12 +1416,28 @@ static uint32_t rtl8139_ChipCmd_read(RTL
 
 static void rtl8139_CpCmd_write(RTL8139State *s, uint32_t val)
 {
+    int i;
+
     val &= 0xffff;
 
     DEBUG_PRINT(("RTL8139C+ command register write(w) val=0x%04x\n", val));
 
     /* mask unwriteable bits */
     val = SET_MASKED(val, 0xff84, s->CpCmd);
+
+    if (  (s->CpCmd & CPlusTxEnb) &&
+         !(val      & CPlusTxEnb) )
+    {
+        /* Reset TX status when the transmitter drops from C+ to
+           non-C+ mode.  Windows has a habit of turning off C+ and
+           then waiting for the TX requests to clear as part of shut
+           down, and you get stuck forever if there are old DTCRs in
+           the registers. */
+        for (i = 0; i < 4; i++)
+        {
+            s->TxStatus[i] = TxHostOwns;
+        }
+    }
 
     s->CpCmd = val;
 }
@@ -1765,6 +1781,7 @@ static int rtl8139_transmit_one(RTL8139S
     {
         DEBUG_PRINT(("RTL8139: +++ cannot transmit from descriptor %d: 
transmitter disabled\n",
                      descriptor));
+        s->TxStatus[descriptor] = TxAborted | TxHostOwns;
         return 0;
     }
 
@@ -1772,6 +1789,7 @@ static int rtl8139_transmit_one(RTL8139S
     {
         DEBUG_PRINT(("RTL8139: +++ cannot transmit from descriptor %d: owned 
by host (%08x)\n",
                      descriptor, s->TxStatus[descriptor]));
+        s->TxStatus[descriptor] = TxAborted | TxHostOwns;
         return 0;
     }
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] ioemu: Fix rtl8139 emulation so that reboot works correctly in 64-bit, Xen patchbot-unstable <=