qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Bligh <alex@alex.org.uk>
To: Saptarshi Sen <saptarshi.mrg@gmail.com>,
	qemu-devel@nongnu.org, qemu-discuss@nongnu.org
Cc: Alex Bligh <alex@alex.org.uk>
Subject: Re: [Qemu-devel] IO : Disk Sector Reads not aligned
Date: Tue, 09 Jul 2013 19:06:02 +0100	[thread overview]
Message-ID: <64716B136F12C649DA0F0C40@nimrod.local> (raw)
In-Reply-To: <CAG5Np+pCepDQb7fiwBa_OjoSwQWgOnBDD9NWThq34i8h2UJPHA@mail.gmail.com>



--On 10 July 2013 01:04:35 +0800 Saptarshi Sen <saptarshi.mrg@gmail.com> 
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) {
        dma_buf_commit(s);
        sector_num += n;
        ide_set_sector(s, sector_num);
        s->nsector -= n;
    }

-- 
Alex Bligh

      reply	other threads:[~2013-07-09 18:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 17:04 [Qemu-devel] IO : Disk Sector Reads not aligned Saptarshi Sen
2013-07-09 18:06 ` Alex Bligh [this message]

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=64716B136F12C649DA0F0C40@nimrod.local \
    --to=alex@alex.org.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-discuss@nongnu.org \
    --cc=saptarshi.mrg@gmail.com \
    /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).