From: Avi Kivity Subject: [PATCH RFC] Advertise IDE physical block size as 4K Date: Tue, 29 Dec 2009 12:07:58 +0200 Message-ID: <1262081278-1858-1-git-send-email-avi@redhat.com> Cc: kvm@vger.kernel.org To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52982 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752645AbZL2KIC (ORCPT ); Tue, 29 Dec 2009 05:08:02 -0500 Sender: kvm-owner@vger.kernel.org List-ID: 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 --- 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