qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qemu and solaris, suggested pci-ide PATCH


From: Juergen Keil
Subject: Re: [Qemu-devel] qemu and solaris, suggested pci-ide PATCH
Date: Wed, 1 Sep 2004 17:23:13 +0200 (CEST)

Hi,

I'm playing with qemu 0.6.0 running on a Solaris x86 system, trying to
install Solaris 9 / 10 x86 in qemu.


I've run into the problem with timeout errors beeing reported by the
Solaris ata driver when the pci-ide hardware device is in use in qemu
(-pci).

The timeouts are not reported when an isa ide device is in use (-isa).


This problem was reported earlier, for example here:
<URL:http://lists.gnu.org/archive/html/qemu-devel/2004-07/msg00518.html>

> From:         Paul Jakma
> Subject:      [Qemu-devel] qemu and solaris
> Date:         Mon, 19 Jul 2004 16:11:00 +0100 (IST)
>
> - PCI IDE does not work. Drive access times out and pci-ide (eventually) will 
> print out error code=0x03.
>
> With the ISA 'ata' driver it works fine.


As far as I understand it, the Solaris ata driver does not use DMA
transfers with the "pci-ide" qemu hardware, because the "bus master
support indicator" bit in pci configuration space offset 09h is not
set.

The message from the Solaris 10 b63 kernel is something like:

  "ATA DMA off: cntrl not Bus Master DMA capable"

So it'll fall back to PIO mode transfers.  PIO transfers may be slow, but
that's OK, so far.


In the ata interrupt handler, the Solaris ata driver checks the "bus
master status register" when it receives an ide interrupt, and expects
to see the bit 2 set (BM_STATUS_INT, 0x04).  Problem is, the qemu
pci-ide hardware does not set the BM_STATUS_INT bit when it generates
an interrupt for a completed ide command (For booting from the cdrom,
this would be an ATAPI INQUIRY command).  The BM_STATUS_INT bit is only
set when an ide DMA transfer completes.



The following patch fixes the problem for me. It asserts the IDE
interrupt status bit 2 in the "bus master ide status register" whenever
an interrupt is generated.  With this patch installed, Solaris x86 is
able to boot both from the qemu cdrom and qemu hdd in -pci mode.


Index: ide.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ide.c,v
retrieving revision 1.26
diff -u -B -6 -r1.26 ide.c
--- ide.c       25 Jun 2004 14:54:19 -0000      1.26
+++ ide.c       1 Sep 2004 15:02:03 -0000
@@ -495,12 +495,16 @@
     s->error = ABRT_ERR;
 }
 
 static inline void ide_set_irq(IDEState *s)
 {
     if (!(s->cmd & IDE_CMD_DISABLE_IRQ)) {
+       BMDMAState *bm = s->bmdma;
+       if(bm)
+           bm->status |= BM_STATUS_INT;
+
 #ifdef TARGET_PPC
         if (s->openpic) 
             openpic_set_irq(s->openpic, s->irq, 1);
         else 
 #endif
         if (s->irq == 16)


--
J├╝rgen Keil                     address@hidden
Tools GmbH                      +49 (228) 9858011





reply via email to

[Prev in Thread] Current Thread [Next in Thread]