NetBSD-Bugs archive

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

Re: port-alpha/56434 (alpha testbed installs fail with cmdide errors)



The following reply was made to PR port-alpha/56434; it has been noted by GNATS.

From: Andreas Gustafsson <gson%NetBSD.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: thorpej%netbsd.org@localhost
Subject: Re: port-alpha/56434 (alpha testbed installs fail with cmdide errors)
Date: Sun, 27 Feb 2022 16:35:31 +0200

 I looked into this a bit by tracing the disk I/O operations in qemu
 using the qemu -trace option, and by running qemu under gdb.
 
 The failing disk read (of 8192 bytes at sector 128) is hitting this
 error condition at qemu-6.2.0/hw/ide/core.c line 917:
 
     if (prep_size < n * 512) {
         /*
          * The PRDs are too short for this request. Error condition!
          * Reset the Active bit and don't raise the interrupt.
          */
         s->status = READY_STAT | SEEK_STAT;
         dma_buf_commit(s, 0);
         goto eot;
     }
 
 where prep_size is 8190 (!) and n * 512 is 8192.  The prep_size
 value comes from this call a few lines earlier:
 
     prep_size = s->bus->dma->ops->prepare_buf(s->bus->dma, s->io_buffer_size);
 
 I don't really know anything about IDE DMA, but it looks like this
 function is dealing with some kind of DMA segments, and their sizes
 look odd (literally, as in not divisble by two):
 
   (gdb) print prd
   $19 = {addr = 2209223277, size = 3475}
   [...]
   (gdb) print prd
   $20 = {addr = 2210054144, size = 2147488365}
 
 where the latter size is 4717 ORed with a flag bit in the MSB.
 
 The segments do sum to the right size (3475 + 4717 = 8192), but
 since their sizes are odd and rounded down to even in
 
             len = prd.size & 0xfffe;
 
 the resulting total size is 2 bytes short.
 
 Perhaps this will provide enough clues to someone who understands
 IDE DMA better than I do to figure out where the bug lies.
 -- 
 Andreas Gustafsson, gson%NetBSD.org@localhost
 


Home | Main Index | Thread Index | Old Index