rpms/qemu/F-7 qemu-0.9.0-atapi-hsm.patch, NONE, 1.1 qemu-0.9.0-rtl8139-checksum.patch, NONE, 1.1 qemu-0.9.0-rtl8139-mmio-regions.patch, NONE, 1.1 qemu.spec, 1.25, 1.26

Daniel P. Berrange (berrange) fedora-extras-commits at redhat.com
Thu Sep 27 03:27:49 UTC 2007


Author: berrange

Update of /cvs/extras/rpms/qemu/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1549

Modified Files:
	qemu.spec 
Added Files:
	qemu-0.9.0-atapi-hsm.patch qemu-0.9.0-rtl8139-checksum.patch 
	qemu-0.9.0-rtl8139-mmio-regions.patch 
Log Message:
Fixed rtl8139 checksum calculation for Vista (rhbz #308201)
Fixed rtl8139 mmio region mappings
Fix ATAPI CDROM emulation  (rhbz #253542)

qemu-0.9.0-atapi-hsm.patch:

--- NEW FILE qemu-0.9.0-atapi-hsm.patch ---
From: Brandon Philips <brandon at ifup.org>
Newsgroups: gmane.comp.emulators.qemu
Subject: [PATCH][RFC] Fix bugs in the ATAPI cdrom driver
Date: Fri, 17 Aug 2007 16:43:04 -0700
Message-ID: <20070817234304.GB10490 at ifup.org>
Reply-To: qemu-devel at nongnu.org

The new libata-eh in the Linux kernel is throwing a fit over the QEMU
cdrom device for two reasons:

1) DRQ can be set with ERR_STAT set.  This is a violation of the ATAPI
state machine.

2) After a TEST_UNIT_READY ATAPI command is sent ERR_STAT is getting set
which is correct.  But, when the OS issues another ATAPI command
ERR_STAT is still set.  Which is bad since the next expected command
from the OS is REQUEST_SENSE to find out why ERR_STAT is set.

bug this fixes: https://bugzilla.novell.com/show_bug.cgi?id=291775

Signed-off-by: Brandon Philips <bphilips at suse.de>

---
 hw/ide.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: qemu-0.9.0/hw/ide.c
===================================================================
--- qemu-0.9.0.orig/hw/ide.c
+++ qemu-0.9.0/hw/ide.c
@@ -586,7 +586,9 @@ static void ide_transfer_start(IDEState 
     s->end_transfer_func = end_transfer_func;
     s->data_ptr = buf;
     s->data_end = buf + size;
-    s->status |= DRQ_STAT;
+    /* don't violate the HSM */
+    if (!(s->status & ERR_STAT))
+        s->status |= DRQ_STAT;
 }
 
 static void ide_transfer_stop(IDEState *s)
@@ -1805,6 +1807,7 @@ static void ide_ioport_write(void *opaqu
             /* overlapping commands not supported */
             if (s->feature & 0x02)
                 goto abort_cmd;
+            s->status = READY_STAT;
             s->atapi_dma = s->feature & 1;
             s->nsector = 1;
             ide_transfer_start(s, s->io_buffer, ATAPI_PACKET_SIZE, 




qemu-0.9.0-rtl8139-checksum.patch:

--- NEW FILE qemu-0.9.0-rtl8139-checksum.patch ---
Index: hw/rtl8139.c
===================================================================
RCS file: /sources/qemu/qemu/hw/rtl8139.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- hw/rtl8139.c	11 Jul 2007 22:48:58 -0000	1.10
+++ hw/rtl8139.c	1 Aug 2007 13:10:29 -0000	1.11
@@ -53,9 +53,8 @@
 /* debug RTL8139 card C+ mode only */
 //#define DEBUG_RTL8139CP 1
 
-/* RTL8139 provides frame CRC with received packet, this feature seems to be
-   ignored by most drivers, disabled by default */
-//#define RTL8139_CALCULATE_RXCRC 1
+/* Calculate CRCs properly on Rx packets */
+#define RTL8139_CALCULATE_RXCRC 1
 
 /* Uncomment to enable on-board timer interrupts */
 //#define RTL8139_ONBOARD_TIMER 1
@@ -747,7 +746,7 @@
         int wrapped = MOD2(s->RxBufAddr + size, s->RxBufferSize);
 
         /* write packet data */
-        if (wrapped && s->RxBufferSize < 65536 && !rtl8139_RxWrap(s))
+        if (wrapped && !(s->RxBufferSize < 65536 && rtl8139_RxWrap(s)))
         {
             DEBUG_PRINT((">>> RTL8139: rx packet wrapped in buffer at %d\n", size-wrapped));
 
@@ -1023,7 +1022,7 @@
 
         /* write checksum */
 #if defined (RTL8139_CALCULATE_RXCRC)
-        val = cpu_to_le32(crc32(~0, buf, size));
+        val = cpu_to_le32(crc32(0, buf, size));
 #else
         val = 0;
 #endif
@@ -1129,7 +1128,7 @@
 
         /* write checksum */
 #if defined (RTL8139_CALCULATE_RXCRC)
-        val = cpu_to_le32(crc32(~0, buf, size));
+        val = cpu_to_le32(crc32(0, buf, size));
 #else
         val = 0;
 #endif

qemu-0.9.0-rtl8139-mmio-regions.patch:

--- NEW FILE qemu-0.9.0-rtl8139-mmio-regions.patch ---
diff -rup qemu-0.9.0.orig/hw/rtl8139.c qemu-0.9.0.new/hw/rtl8139.c
--- qemu-0.9.0.orig/hw/rtl8139.c	2007-02-05 18:01:54.000000000 -0500
+++ qemu-0.9.0.new/hw/rtl8139.c	2007-08-28 11:37:29.000000000 -0400
@@ -3325,7 +3325,7 @@ static void rtl8139_mmio_map(PCIDevice *
     PCIRTL8139State *d = (PCIRTL8139State *)pci_dev;
     RTL8139State *s = &d->rtl8139;
 
-    cpu_register_physical_memory(addr + 0, 0x100, s->rtl8139_mmio_io_addr);
+    cpu_register_physical_memory(addr + 0, 0x1000, s->rtl8139_mmio_io_addr);
 }
 
 static void rtl8139_ioport_map(PCIDevice *pci_dev, int region_num, 
@@ -3438,10 +3438,10 @@ void pci_rtl8139_init(PCIBus *bus, NICIn
     s->rtl8139_mmio_io_addr =
     cpu_register_io_memory(0, rtl8139_mmio_read, rtl8139_mmio_write, s);
 
-    pci_register_io_region(&d->dev, 0, 0x100, 
+    pci_register_io_region(&d->dev, 0, 0x1000, 
                            PCI_ADDRESS_SPACE_IO,  rtl8139_ioport_map);
 
-    pci_register_io_region(&d->dev, 1, 0x100, 
+    pci_register_io_region(&d->dev, 1, 0x1000, 
                            PCI_ADDRESS_SPACE_MEM, rtl8139_mmio_map);
 
     s->irq = 16; /* PCI interrupt */


Index: qemu.spec
===================================================================
RCS file: /cvs/extras/rpms/qemu/F-7/qemu.spec,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- qemu.spec	1 Apr 2007 19:05:10 -0000	1.25
+++ qemu.spec	27 Sep 2007 03:27:17 -0000	1.26
@@ -8,8 +8,8 @@
 Summary: QEMU is a FAST! processor emulator
 Name: qemu
 Version: 0.9.0
-Release: 2%{?dist}
-License: GPL/LGPL
+Release: 3%{?dist}
+License: GPLv2+, LGPLv2+
 Group: Development/Tools
 URL: http://www.qemu.org/
 Source0: http://www.qemu.org/%{name}-%{version}.tar.gz
@@ -17,6 +17,12 @@
 Patch0: qemu-0.7.0-build.patch
 Patch1: qemu-0.8.0-sdata.patch
 Patch2: qemu-0.9.0-load-initrd.patch
+# Fix RTL8139 MMIO regions. Remove at next upgrade
+Patch5: qemu-0.9.0-rtl8139-mmio-regions.patch
+# Fix Atapi errors with latest kernel
+Patch6: qemu-0.9.0-atapi-hsm.patch
+# Fix RTL8139 checksum calculations for Vista
+Patch7: qemu-0.9.0-rtl8139-checksum.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: SDL-devel compat-gcc-%{gccver} zlib-devel which texi2html
 Requires(post): /sbin/chkconfig
@@ -42,6 +48,9 @@
 %patch0 -p1
 %patch1 -p1
 %patch2 -p0
+%patch5 -p1
+%patch6 -p1
+%patch7 -p0
 
 %build
 ./configure \
@@ -92,6 +101,12 @@
 %{_mandir}/man1/*
 
 %changelog
+* Wed Sep 26 2007 Daniel P. Berrange <berrange at redhat.com> - 0.9.0-3.fc7
+- Update licence
+- Fix CDROM emulation (rhbz #253542)
+- Fix rtl8139 mmio region mappings with multiple NICs
+- Fix rtl8139 checksum calculation for Vista (rhbz #308201)
+
 * Sun Apr  1 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 0.9.0-2
 - Fix direct loading of a linux kernel with -kernel & -initrd (bz 234681)
 - Remove spurious execute bits from manpages (bz 222573)




More information about the fedora-extras-commits mailing list