[Top][All Lists]

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

Re: [Qemu-devel] IO : Disk Sector Reads not aligned

From: Alex Bligh
Subject: Re: [Qemu-devel] IO : Disk Sector Reads not aligned
Date: Tue, 09 Jul 2013 19:06:02 +0100

--On 10 July 2013 01:04:35 +0800 Saptarshi Sen <address@hidden> wrote:

   the sector reads are not 512 bytes aligned.

   I am gathering the stats from hw/ide/core.c in the function

   ide_dma_cb. variable :sector_num

   Should not these disk reads be 512 bytes aligned.

As illustrated by the code below, sector_num is the number of the sector.
The byte offset is sector_num << 9. As sector_num is an integer, this makes
all the reads 512 byte aligned as far as I can see.

   n = s->io_buffer_size >> 9;
   sector_num = ide_get_sector(s);
   if (n > 0) {
       sector_num += n;
       ide_set_sector(s, sector_num);
       s->nsector -= n;

Alex Bligh

reply via email to

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