All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] Advertise IDE physical block size as 4K
@ 2009-12-29 10:07 Avi Kivity
  2009-12-29 13:21 ` [Qemu-devel] " Jamie Lokier
  2010-01-04  8:36 ` Christoph Hellwig
  0 siblings, 2 replies; 7+ messages in thread
From: Avi Kivity @ 2009-12-29 10:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: kvm

Guests use this number as a hint for alignment and I/O request sizes.  Given
that modern disks have 4K block sizes, and cached file-backed images also
have 4K block sizes, this hint can improve guest performance.

We probably need to make this configurable depending on machine type.  It
should be the default for -M 0.13 only as it can affect guest code paths.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/ide/core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/hw/ide/core.c b/hw/ide/core.c
index 76c3820..89fd3ce 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -164,6 +164,7 @@ static void ide_identify(IDEState *s)
     put_le16(p + 101, s->nb_sectors >> 16);
     put_le16(p + 102, s->nb_sectors >> 32);
     put_le16(p + 103, s->nb_sectors >> 48);
+    put_le16(p + 106, 0x6000 | 3); /* 8 logical sectors per physical sector */
 
     memcpy(s->identify_data, p, sizeof(s->identify_data));
     s->identify_set = 1;
-- 
1.6.5.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-01-04  8:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-29 10:07 [PATCH RFC] Advertise IDE physical block size as 4K Avi Kivity
2009-12-29 13:21 ` [Qemu-devel] " Jamie Lokier
2009-12-29 13:39   ` Luca Tettamanti
2009-12-29 13:42     ` Avi Kivity
2010-01-04  8:34     ` Christoph Hellwig
2010-01-04  8:34       ` Christoph Hellwig
2010-01-04  8:36 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.