qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] ata identify device errors
Date: Sat, 24 Jan 2004 21:20:11 +0100	[thread overview]
Message-ID: <20040124202011.GA1481@suse.de> (raw)

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

                 reply	other threads:[~2004-01-24 20:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040124202011.GA1481@suse.de \
    --to=axboe@suse.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).