From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AkUGt-0001Df-43 for qemu-devel@nongnu.org; Sat, 24 Jan 2004 15:20:47 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AkUGM-0000tH-1g for qemu-devel@nongnu.org; Sat, 24 Jan 2004 15:20:45 -0500 Received: from [195.184.98.160] (helo=virtualhost.dk) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AkUGL-0000t4-DF for qemu-devel@nongnu.org; Sat, 24 Jan 2004 15:20:13 -0500 Received: from brick.kernel.dk ([62.242.22.158] helo=wiggum.home.kernel.dk) by virtualhost.dk with esmtp (Exim 3.36 #1) id 1AkUGO-0002IB-00 for qemu-devel@nongnu.org; Sat, 24 Jan 2004 21:20:16 +0100 Received: from axboe by wiggum.home.kernel.dk with local (Exim 4.22) id 1AkUGJ-0000Sz-Mv for qemu-devel@nongnu.org; Sat, 24 Jan 2004 21:20:11 +0100 Date: Sat, 24 Jan 2004 21:20:11 +0100 From: Jens Axboe Message-ID: <20040124202011.GA1481@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] ata identify device errors Reply-To: qemu-devel@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, In an increasingly pedantic mode, I started looking at other ata standard violations by qemu. I went as far back as ata-2 to verify that these are indeed errors. - word 4+5 have always been vendor unique, qemu should not set them to number of sectors. - word 20, ditto. - word 47, max multisector. Upper byte must be 0x80. - qemu sets word 54-58, it must set word 53 bit 1 as well to indicate that these values are indeed valid. Index: ide.c =================================================================== RCS file: /cvsroot/qemu/qemu/ide.c,v retrieving revision 1.6 diff -u -r1.6 ide.c --- ide.c 22 Jan 2004 23:52:27 -0000 1.6 +++ ide.c 24 Jan 2004 20:19:13 -0000 @@ -392,22 +393,20 @@ stw_raw(p + 0, 0x0040); stw_raw(p + 1, s->cylinders); stw_raw(p + 3, s->heads); - stw_raw(p + 4, 512 * s->sectors); /* sectors */ - stw_raw(p + 5, 512); /* sector size */ stw_raw(p + 6, s->sectors); padstr((uint8_t *)(p + 10), "QM00001", 20); /* serial number */ - stw_raw(p + 20, 3); /* buffer type */ stw_raw(p + 21, 512); /* cache size in sectors */ stw_raw(p + 22, 4); /* ecc bytes */ padstr((uint8_t *)(p + 23), QEMU_VERSION, 8); /* firmware version */ padstr((uint8_t *)(p + 27), "QEMU HARDDISK", 40); /* model */ -#if MAX_MULT_SECTORS > 1 - stw_raw(p + 47, MAX_MULT_SECTORS); +#if MAX_MULT_SECTORS > 1 + stw_raw(p + 47, 0x8000 | MAX_MULT_SECTORS); #endif stw_raw(p + 48, 1); /* dword I/O */ stw_raw(p + 49, 1 << 9); /* LBA supported, no DMA */ stw_raw(p + 51, 0x200); /* PIO transfer cycle */ stw_raw(p + 52, 0x200); /* DMA transfer cycle */ + stw_raw(p + 53, 1); /* words 54-58 are valid */ stw_raw(p + 54, s->cylinders); stw_raw(p + 55, s->heads); stw_raw(p + 56, s->sectors); -- Jens Axboe