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-3.1-testing] ioemu: Fix rtl8139 emulation so that r

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] ioemu: Fix rtl8139 emulation so that reboot works correctly in 64-bit
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 09 Apr 2008 09:10:42 -0700
Delivery-date: Wed, 09 Apr 2008 09:11:13 -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 1207756797 -3600
# Node ID c156b4e04617041be3f7804978ce5ecdbc23fc0c
# Parent  fe6e23c8ed76f9124e0c983eeb668dbd33ad34cb
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>
xen-unstable changeset:   17420:40c0dda6eae68ec1bbd3bfd3e812d8b9e34051a0
xen-unstable date:        Wed Apr 09 16:03:40 2008 +0100
---
 tools/ioemu/hw/rtl8139.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+)

diff -r fe6e23c8ed76 -r c156b4e04617 tools/ioemu/hw/rtl8139.c
--- a/tools/ioemu/hw/rtl8139.c  Wed Apr 09 16:59:35 2008 +0100
+++ b/tools/ioemu/hw/rtl8139.c  Wed Apr 09 16:59:57 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-3.1-testing] ioemu: Fix rtl8139 emulation so that reboot works correctly in 64-bit, Xen patchbot-3.1-testing <=