rpms/kvm/devel kvm-qemu-ide-dma.patch, NONE, 1.1 .cvsignore, 1.4, 1.5 kvm.spec, 1.3, 1.4 sources, 1.4, 1.5

Jeremy Katz (katzj) fedora-extras-commits at redhat.com
Fri Jan 26 20:55:00 UTC 2007


Author: katzj

Update of /cvs/extras/rpms/kvm/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20550

Modified Files:
	.cvsignore kvm.spec sources 
Added Files:
	kvm-qemu-ide-dma.patch 
Log Message:
* Fri Jan 26 2007 Jeremy Katz <katzj at redhat.com> - 12-1
- update to kvm-12
- add qemu patch for better ATAPI DMA support (which works with ata_piix)


kvm-qemu-ide-dma.patch:

--- NEW FILE kvm-qemu-ide-dma.patch ---
--- qemu/hw/ide.c	2006-07-22 13:23:34.000000000 -0400
+++ qemu/hw/ide.c	2006-10-11 03:19:22.000000000 -0400
@@ -391,6 +391,9 @@
 } PCIIDEState;
 
 static void ide_dma_start(IDEState *s, IDEDMAFunc *dma_cb);
+static int ide_atapi_cmd_read_dma_cb(IDEState *s, 
+                                     target_phys_addr_t phys_addr, 
+                                     int transfer_size1);
 
 static void padstr(char *str, const char *src, int len)
 {
@@ -454,7 +457,7 @@
     put_le16(p + 49, (1 << 11) | (1 << 9) | (1 << 8)); /* DMA and LBA supported */
     put_le16(p + 51, 0x200); /* PIO transfer cycle */
     put_le16(p + 52, 0x200); /* DMA transfer cycle */
-    put_le16(p + 53, 1 | (1 << 1) | (1 << 2)); /* words 54-58,64-70,88 are valid */
+    put_le16(p + 53, 1 | 1 << 1 | 1 << 2); /* words 54-58,64-70,88 are valid */
     put_le16(p + 54, s->cylinders);
     put_le16(p + 55, s->heads);
     put_le16(p + 56, s->sectors);
@@ -465,6 +468,8 @@
         put_le16(p + 59, 0x100 | s->mult_sectors);
     put_le16(p + 60, s->nb_sectors);
     put_le16(p + 61, s->nb_sectors >> 16);
+    put_le16(p + 63, 0x07 | 0x4 << 8); /* multiword dma supported */
+    put_le16(p + 64, 0x03); /* pio3 and 4 supported */
     put_le16(p + 63, 0x07); /* mdma0-2 supported */
     put_le16(p + 65, 120);
     put_le16(p + 66, 120);
@@ -480,8 +485,8 @@
     /* 13=flush_cache_ext,12=flush_cache,10=lba48 */
     put_le16(p + 86, (1 << 14) | (1 << 13) | (1 <<12) | (1 << 10));
     put_le16(p + 87, (1 << 14));
-    put_le16(p + 88, 0x3f | (1 << 13)); /* udma5 set and supported */
-    put_le16(p + 93, 1 | (1 << 14) | 0x2000);
+    put_le16(p + 88, 0x3f /*| 0x20 << 8*/); /* udma5 supported and set */
+    put_le16(p + 93, 1 | (1 << 1) | (1 << 3) | (1 << 13) | (1 << 14));
     put_le16(p + 100, s->nb_sectors);
     put_le16(p + 101, s->nb_sectors >> 16);
     put_le16(p + 102, s->nb_sectors >> 32);
@@ -513,11 +518,11 @@
     padstr((uint8_t *)(p + 23), QEMU_VERSION, 8); /* firmware version */
     padstr((uint8_t *)(p + 27), "QEMU CD-ROM", 40); /* model */
     put_le16(p + 48, 1); /* dword I/O (XXX: should not be set on CDROM) */
-    put_le16(p + 49, 1 << 9); /* LBA supported, no DMA */
-    put_le16(p + 53, 3); /* words 64-70, 54-58 valid */
-    put_le16(p + 63, 0x103); /* DMA modes XXX: may be incorrect */
-    put_le16(p + 64, 1); /* PIO modes */
-    put_le16(p + 65, 0xb4); /* minimum DMA multiword tx cycle time */
+    put_le16(p + 49, 1 << 8 | 1 << 9); /* dma and lba are supported */
+    put_le16(p + 53, 7); /* words 64-70, 54-58, 88 valid */
+    put_le16(p + 63, 0x07 | 0x4 << 8); /* multiword dma supported / chosen */
+    put_le16(p + 64, 0x03); /* pio3 and 4 supported */
+    put_le16(p + 65, 0xb4); /* minimum dma multiword tx cycle time */
     put_le16(p + 66, 0xb4); /* recommended DMA multiword tx cycle time */
     put_le16(p + 67, 0x12c); /* minimum PIO cycle time without flow control */
     put_le16(p + 68, 0xb4); /* minimum PIO cycle time with IORDY flow control */
@@ -526,6 +531,7 @@
     put_le16(p + 72, 30); /* in ns */
 
     put_le16(p + 80, 0x1e); /* support up to ATA/ATAPI-4 */
+    put_le16(p + 88, 0x3f /*| 0x20 << 8*/); /* udma supported and set */
 
     memcpy(s->identify_data, p, sizeof(s->identify_data));
     s->identify_set = 1;
@@ -559,6 +565,7 @@
 {
     BMDMAState *bm = s->bmdma;
     if (!(s->cmd & IDE_CMD_DISABLE_IRQ)) {
+       BMDMAState *bm = s->bmdma;
         if (bm) {
             bm->status |= BM_STATUS_INT;
         }
@@ -994,8 +1001,13 @@
     s->elementary_transfer_size = 0;
     s->io_buffer_index = 0;
 
+    if (s->atapi_dma) {
+       s->status = READY_STAT | DRQ_STAT;
+       ide_dma_start(s, ide_atapi_cmd_read_dma_cb);
+    } else {
     s->status = READY_STAT;
     ide_atapi_cmd_reply_end(s);
+    }
 }
 
 /* start a CD-CDROM read command */
@@ -1026,6 +1038,9 @@
 #endif
         if (s->packet_transfer_size <= 0)
             break;
+       if (s->lba == -1)
+           len = s->packet_transfer_size;
+       else {
         len = s->cd_sector_size - s->io_buffer_index;
         if (len <= 0) {
             /* transfert next data */
@@ -1034,6 +1049,7 @@
             s->io_buffer_index = 0;
             len = s->cd_sector_size;
         }
+       }
         if (len > transfer_size)
             len = transfer_size;
         cpu_physical_memory_write(phys_addr, 
@@ -2372,6 +2388,11 @@
               cmd646_set_irq, d, 1);
 }
 
+/* pci 0x04(word): command; 0x06(word): status */
+#define PCI_COMMAND_IOACCESS                0x0001
+#define PCI_COMMAND_MEMACCESS               0x0002
+#define PCI_COMMAND_BUSMASTER               0x0004
+
 /* hd_table must contain 4 block drivers */
 /* NOTE: for the PIIX3, the IRQs and IOports are hardcoded */
 void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn)
@@ -2392,6 +2413,8 @@
     pci_conf[0x02] = 0x10;
     pci_conf[0x03] = 0x70;
     pci_conf[0x09] = 0x80; // legacy ATA mode
+    pci_conf[0x04] = PCI_COMMAND_IOACCESS | PCI_COMMAND_MEMACCESS | PCI_COMMAND_BUSMASTER;
+    pci_conf[0x09] = 0x8a; // PCI_IDE bus master API
     pci_conf[0x0a] = 0x01; // class_sub = PCI_IDE
     pci_conf[0x0b] = 0x01; // class_base = PCI_mass_storage
     pci_conf[0x0e] = 0x00; // header_type


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/kvm/devel/.cvsignore,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- .cvsignore	19 Jan 2007 19:57:41 -0000	1.4
+++ .cvsignore	26 Jan 2007 20:54:30 -0000	1.5
@@ -1 +1 @@
-kvm-11.tar.gz
+kvm-12.tar.gz


Index: kvm.spec
===================================================================
RCS file: /cvs/extras/rpms/kvm/devel/kvm.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- kvm.spec	19 Jan 2007 19:57:41 -0000	1.3
+++ kvm.spec	26 Jan 2007 20:54:30 -0000	1.4
@@ -1,11 +1,12 @@
 Summary: Kernel-based Virtual Machine
 Name: kvm
-Version: 11
+Version: 12
 Release: 1
 License: GPL
 Group: Development/Tools
 URL: http://kvm.sf.net
 Source0: http://download.sourceforge.net/sourceforge/kvm/kvm-%{version}.tar.gz
+Patch0: kvm-qemu-ide-dma.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: SDL-devel 
 # qemu doesn't build with gcc 4.x
@@ -26,6 +27,7 @@
 
 %prep
 %setup -q
+%patch0 -p0
 
 %build
 ./configure --with-patched-kernel --qemu-cc=gcc34 --kerneldir=$(pwd)/kernel --prefix=%{_prefix}
@@ -53,6 +55,10 @@
 %{_bindir}/qemu-kvm
 
 %changelog
+* Fri Jan 26 2007 Jeremy Katz <katzj at redhat.com> - 12-1
+- update to kvm-12
+- add qemu patch for better ATAPI DMA support (which works with ata_piix)
+
 * Fri Jan 19 2007 Jeremy Katz <katzj at redhat.com> - 11-1
 - update to kvm-11
 


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/kvm/devel/sources,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- sources	19 Jan 2007 19:57:41 -0000	1.4
+++ sources	26 Jan 2007 20:54:30 -0000	1.5
@@ -1 +1 @@
-df25146ef993e8a289b2d6580aad4e82  kvm-11.tar.gz
+c336921942daa096063bbb471ed6eecd  kvm-12.tar.gz




More information about the scm-commits mailing list